Merge JEP-349-branch
authormgronlun
Wed, 25 Sep 2019 22:40:41 +0200
branchJEP-349-branch
changeset 58343 ca19b94eac7a
parent 58271 e47423f1318b (current diff)
parent 58341 21a03fa2f6b6 (diff)
child 58357 fe78b5a87287
Merge
src/hotspot/os/linux/gc/z/zVirtualMemory_linux.cpp
src/hotspot/share/runtime/thread.cpp
src/hotspot/share/runtime/thread.hpp
src/java.desktop/windows/native/common/awt/systemscale/systemScale.cpp
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/PolymorphicInliningTest.java
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotClassInitializationPlugin.java
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NormalizeCompareNode.java
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/JLModule.java
src/jdk.jcmd/linux/classes/sun/tools/ProcessHelper.java
test/jdk/sun/java2d/pipe/hw/RSLContextInvalidationTest/RSLContextInvalidationTest.java
--- a/doc/testing.html	Mon Sep 23 09:16:05 2019 -0700
+++ b/doc/testing.html	Wed Sep 25 22:40:41 2019 +0200
@@ -5,7 +5,7 @@
   <meta name="generator" content="pandoc" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
   <title>Testing the JDK</title>
-  <style type="text/css">
+  <style>
       code{white-space: pre-wrap;}
       span.smallcaps{font-variant: small-caps;}
       span.underline{text-decoration: underline;}
@@ -21,9 +21,9 @@
 <header id="title-block-header">
 <h1 class="title">Testing the JDK</h1>
 </header>
-<nav id="TOC">
+<nav id="TOC" role="doc-toc">
 <ul>
-<li><a href="#using-make-test-the-run-test-framework">Using &quot;make test&quot; (the run-test framework)</a><ul>
+<li><a href="#using-make-test-the-run-test-framework">Using "make test" (the run-test framework)</a><ul>
 <li><a href="#configuration">Configuration</a></li>
 </ul></li>
 <li><a href="#test-selection">Test selection</a><ul>
@@ -42,10 +42,11 @@
 <li><a href="#notes-for-specific-tests">Notes for Specific Tests</a><ul>
 <li><a href="#docker-tests">Docker Tests</a></li>
 <li><a href="#non-us-locale">Non-US locale</a></li>
+<li><a href="#pkcs11-tests">PKCS11 Tests</a></li>
 </ul></li>
 </ul>
 </nav>
-<h2 id="using-make-test-the-run-test-framework">Using &quot;make test&quot; (the run-test framework)</h2>
+<h2 id="using-make-test-the-run-test-framework">Using "make test" (the run-test framework)</h2>
 <p>This new way of running tests is developer-centric. It assumes that you have built a JDK locally and want to test it. Running common test targets is simple, and more complex ad-hoc combination of tests is possible. The user interface is forgiving, and clearly report errors it cannot resolve.</p>
 <p>The main target <code>test</code> uses the jdk-image as the tested product. There is also an alternate target <code>exploded-test</code> that uses the exploded image instead. Not all tests will run successfully on the exploded image, but using this target can greatly improve rebuild times for certain workflows.</p>
 <p>Previously, <code>make test</code> was used to invoke an old system for running tests, and <code>make run-test</code> was used for the new test framework. For backward compatibility with scripts and muscle memory, <code>run-test</code> (and variants like <code>exploded-run-test</code> or <code>run-test-tier1</code>) are kept as aliases.</p>
@@ -63,7 +64,7 @@
 <p>To be able to run microbenchmarks, <code>configure</code> needs to know where to find the JMH dependency. Use <code>--with-jmh=&lt;path to JMH jars&gt;</code> to point to a directory containing the core JMH and transitive dependencies. The recommended dependencies can be retrieved by running <code>sh make/devkit/createJMHBundle.sh</code>, after which <code>--with-jmh=build/jmh/jars</code> should work.</p>
 <h2 id="test-selection">Test selection</h2>
 <p>All functionality is available using the <code>test</code> make target. In this use case, the test or tests to be executed is controlled using the <code>TEST</code> variable. To speed up subsequent test runs with no source code changes, <code>test-only</code> can be used instead, which do not depend on the source and test image build.</p>
-<p>For some common top-level tests, direct make targets have been generated. This includes all JTReg test groups, the hotspot gtest, and custom tests (if present). This means that <code>make test-tier1</code> is equivalent to <code>make test TEST=&quot;tier1&quot;</code>, but the latter is more tab-completion friendly. For more complex test runs, the <code>test TEST=&quot;x&quot;</code> solution needs to be used.</p>
+<p>For some common top-level tests, direct make targets have been generated. This includes all JTReg test groups, the hotspot gtest, and custom tests (if present). This means that <code>make test-tier1</code> is equivalent to <code>make test TEST="tier1"</code>, but the latter is more tab-completion friendly. For more complex test runs, the <code>test TEST="x"</code> solution needs to be used.</p>
 <p>The test specifications given in <code>TEST</code> is parsed into fully qualified test descriptors, which clearly and unambigously show which tests will be run. As an example, <code>:tier1</code> will expand to <code>jtreg:$(TOPDIR)/test/hotspot/jtreg:tier1 jtreg:$(TOPDIR)/test/jdk:tier1 jtreg:$(TOPDIR)/test/langtools:tier1 jtreg:$(TOPDIR)/test/nashorn:tier1 jtreg:$(TOPDIR)/test/jaxp:tier1</code>. You can always submit a list of fully qualified test descriptors in the <code>TEST</code> variable if you want to shortcut the parser.</p>
 <h3 id="jtreg">JTReg</h3>
 <p>JTReg tests can be selected either by picking a JTReg test group, or a selection of files or directories containing JTReg tests.</p>
@@ -103,8 +104,8 @@
 <p>Additional work data is stored in <code>build/$BUILD/test-support/$TEST_ID</code>. For some frameworks, this directory might contain information that is useful in determining the cause of a failed test.</p>
 <h2 id="test-suite-control">Test suite control</h2>
 <p>It is possible to control various aspects of the test suites using make control variables.</p>
-<p>These variables use a keyword=value approach to allow multiple values to be set. So, for instance, <code>JTREG=&quot;JOBS=1;TIMEOUT_FACTOR=8&quot;</code> will set the JTReg concurrency level to 1 and the timeout factor to 8. This is equivalent to setting <code>JTREG_JOBS=1 JTREG_TIMEOUT_FACTOR=8</code>, but using the keyword format means that the <code>JTREG</code> variable is parsed and verified for correctness, so <code>JTREG=&quot;TMIEOUT_FACTOR=8&quot;</code> would give an error, while <code>JTREG_TMIEOUT_FACTOR=8</code> would just pass unnoticed.</p>
-<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>These variables use a keyword=value approach to allow multiple values to be set. So, for instance, <code>JTREG="JOBS=1;TIMEOUT_FACTOR=8"</code> will set the JTReg concurrency level to 1 and the timeout factor to 8. This is equivalent to setting <code>JTREG_JOBS=1 JTREG_TIMEOUT_FACTOR=8</code>, but using the keyword format means that the <code>JTREG</code> variable is parsed and verified for correctness, so <code>JTREG="TMIEOUT_FACTOR=8"</code> would give an error, while <code>JTREG_TMIEOUT_FACTOR=8</code> would just pass unnoticed.</p>
+<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="...;..."</code>. This will also make sure spaces are preserved, as in <code>JTREG="VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug"</code>.</p>
 <p>(Other ways are possible, e.g. using backslash: <code>JTREG=JOBS=1\;TIMEOUT_FACTOR=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>
@@ -159,7 +160,7 @@
 <p>Set to <code>true</code> or <code>false</code>. If <code>true</code>, JTReg will use <code>-match:</code> option, otherwise <code>-exclude:</code> will be used. Default is <code>false</code>.</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>
+<p>Use <code>JTREG="OPTIONS=--help all"</code> to see all available JTReg options.</p>
 <h4 id="java_options-1">JAVA_OPTIONS</h4>
 <p>Additional Java options to JTReg (<code>-javaoption</code>).</p>
 <h4 id="vm_options-1">VM_OPTIONS</h4>
@@ -172,7 +173,7 @@
 <p>Default is 1. Set to -1 to repeat indefinitely. This can be especially useful combined with <code>OPTIONS=--gtest_break_on_failure</code> to reproduce an intermittent problem.</p>
 <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>
+<p>Use <code>GTEST="OPTIONS=--help"</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>
@@ -199,8 +200,12 @@
 <p>To run these tests correctly, additional parameters for the correct docker image are required on Ubuntu 18.04 by using <code>JAVA_OPTIONS</code>.</p>
 <pre><code>$ make test TEST=&quot;jtreg:test/hotspot/jtreg/containers/docker&quot; JTREG=&quot;JAVA_OPTIONS=-Djdk.test.docker.image.name=ubuntu -Djdk.test.docker.image.version=latest&quot;</code></pre>
 <h3 id="non-us-locale">Non-US locale</h3>
-<p>If your locale is non-US, some tests are likely to fail. To work around this you can set the locale to US. On Unix platforms simply setting <code>LANG=&quot;en_US&quot;</code> in the environment before running tests should work. On Windows, setting <code>JTREG=&quot;VM_OPTIONS=-Duser.language=en -Duser.country=US&quot;</code> helps for most, but not all test cases. For example:</p>
+<p>If your locale is non-US, some tests are likely to fail. To work around this you can set the locale to US. On Unix platforms simply setting <code>LANG="en_US"</code> in the environment before running tests should work. On Windows, setting <code>JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US"</code> helps for most, but not all test cases. For example:</p>
 <pre><code>$ export LANG=&quot;en_US&quot; &amp;&amp; make test TEST=...
 $ make test JTREG=&quot;VM_OPTIONS=-Duser.language=en -Duser.country=US&quot; TEST=...</code></pre>
+<h3 id="pkcs11-tests">PKCS11 Tests</h3>
+<p>It is highly recommended to use the latest NSS version when running PKCS11 tests. Improper NSS version may lead to unexpected failures which are hard to diagnose. For example, sun/security/pkcs11/Secmod/AddTrustedCert.java may fail on Ubuntu 18.04 with the default NSS version in the system. To run these tests correctly, the system property <code>test.nss.lib.paths</code> is required on Ubuntu 18.04 to specify the alternative NSS lib directories. For example:</p>
+<pre><code>$ make test TEST=&quot;jtreg:sun/security/pkcs11/Secmod/AddTrustedCert.java&quot; JTREG=&quot;JAVA_OPTIONS=-Dtest.nss.lib.paths=/path/to/your/latest/NSS-libs&quot;</code></pre>
+<p>For more notes about the PKCS11 tests, please refer to test/jdk/sun/security/pkcs11/README.</p>
 </body>
 </html>
--- a/doc/testing.md	Mon Sep 23 09:16:05 2019 -0700
+++ b/doc/testing.md	Wed Sep 25 22:40:41 2019 +0200
@@ -407,6 +407,20 @@
     $ export LANG="en_US" && make test TEST=...
     $ make test JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US" TEST=...
 
+### PKCS11 Tests
+
+It is highly recommended to use the latest NSS version when running PKCS11 tests.
+Improper NSS version may lead to unexpected failures which are hard to diagnose.
+For example, sun/security/pkcs11/Secmod/AddTrustedCert.java may fail on Ubuntu
+18.04 with the default NSS version in the system.
+To run these tests correctly, the system property `test.nss.lib.paths` is required
+on Ubuntu 18.04 to specify the alternative NSS lib directories.
+For example:
+
+    $ make test TEST="jtreg:sun/security/pkcs11/Secmod/AddTrustedCert.java" JTREG="JAVA_OPTIONS=-Dtest.nss.lib.paths=/path/to/your/latest/NSS-libs"
+
+For more notes about the PKCS11 tests, please refer to test/jdk/sun/security/pkcs11/README.
+
 ---
 # Override some definitions in the global css file that are not optimal for
 # this document.
--- a/make/Main.gmk	Mon Sep 23 09:16:05 2019 -0700
+++ b/make/Main.gmk	Wed Sep 25 22:40:41 2019 +0200
@@ -707,6 +707,8 @@
   $(foreach m, $(JAVA_MODULES), \
       $(eval $m-java: $(addsuffix -java, $(filter $(JAVA_MODULES), \
       $(call FindDepsForModule,$m)))))
+  # Declare dependencies between the module meta targets
+  $(foreach m, $(ALL_MODULES), $(eval $m: $(call FindDepsForModule,$m)))
 
   # Declare dependencies between <module>-rmic to <module>-java
   $(foreach m, $(RMIC_MODULES), $(eval $m-rmic: $m-java))
--- a/make/autoconf/basics.m4	Mon Sep 23 09:16:05 2019 -0700
+++ b/make/autoconf/basics.m4	Wed Sep 25 22:40:41 2019 +0200
@@ -205,6 +205,32 @@
   fi
 ])
 
+################################################################################
+# This will make a path absolute. Assumes it's already a unix path. Also
+# resolves ~ to homedir.
+AC_DEFUN([BASIC_ABSOLUTE_PATH],
+[
+  if test "x[$]$1" != x; then
+    new_path="[$]$1"
+
+    if [ [[ "$new_path" = ~* ]] ]; then
+      # Use eval to expand a potential ~
+      eval new_path="$new_path"
+      if test ! -f "$new_path" && test ! -d "$new_path"; then
+        AC_MSG_ERROR([The new_path of $1, which resolves as "$new_path", is not found.])
+      fi
+    fi
+
+    if test -d "$new_path"; then
+      $1="`cd "$new_path"; $THEPWDCMD -L`"
+    else
+      dir="`$DIRNAME "$new_path"`"
+      base="`$BASENAME "$new_path"`"
+      $1="`cd "$dir"; $THEPWDCMD -L`/$base"
+    fi
+  fi
+])
+
 ###############################################################################
 # This will make sure the given variable points to a full and proper
 # path. This means:
@@ -217,7 +243,6 @@
 AC_DEFUN([BASIC_FIXUP_PATH],
 [
   # Only process if variable expands to non-empty
-
   if test "x[$]$1" != x; then
     if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
       BASIC_FIXUP_PATH_CYGWIN($1)
@@ -234,19 +259,8 @@
         AC_MSG_ERROR([Spaces are not allowed in this path.])
       fi
 
-      # Use eval to expand a potential ~
-      eval path="$path"
-      if test ! -f "$path" && test ! -d "$path"; then
-        AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.])
-      fi
-
-      if test -d "$path"; then
-        $1="`cd "$path"; $THEPWDCMD -L`"
-      else
-        dir="`$DIRNAME "$path"`"
-        base="`$BASENAME "$path"`"
-        $1="`cd "$dir"; $THEPWDCMD -L`/$base"
-      fi
+      BASIC_ABSOLUTE_PATH(path)
+      $1="$path"
     fi
   fi
 ])
--- a/make/autoconf/basics_windows.m4	Mon Sep 23 09:16:05 2019 -0700
+++ b/make/autoconf/basics_windows.m4	Wed Sep 25 22:40:41 2019 +0200
@@ -148,6 +148,8 @@
   path="[$]$1"
   new_path=`$CYGPATH -u "$path"`
 
+  BASIC_ABSOLUTE_PATH(new_path)
+
   # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
   # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
   # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
@@ -181,6 +183,8 @@
     new_path=`cmd //c echo $path`
   fi
 
+  BASIC_ABSOLUTE_PATH(new_path)
+
   BASIC_MAKE_WINDOWS_SPACE_SAFE_MSYS([$new_path])
   BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(new_path)
   if test "x$path" != "x$new_path"; then
@@ -199,6 +203,8 @@
   new_path="[$]$1"
   BASIC_WINDOWS_REWRITE_AS_UNIX_PATH([new_path])
 
+  BASIC_ABSOLUTE_PATH(new_path)
+
   # Call helper function which possibly converts this using DOS-style short mode.
   # If so, the updated path is stored in $new_path.
   BASIC_MAKE_WINDOWS_SPACE_SAFE_WSL([$new_path])
--- a/make/common/TestFilesCompilation.gmk	Mon Sep 23 09:16:05 2019 -0700
+++ b/make/common/TestFilesCompilation.gmk	Wed Sep 25 22:40:41 2019 +0200
@@ -62,7 +62,7 @@
     $1_OUTPUT_SUBDIR := lib
     $1_BASE_CFLAGS := $(CFLAGS_JDKLIB)
     $1_BASE_CXXFLAGS := $(CXXFLAGS_JDKLIB)
-    $1_LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN)
+    $1_LDFLAGS := $(LDFLAGS_JDKLIB) $$(call SET_SHARED_LIBRARY_ORIGIN)
     $1_COMPILATION_TYPE := LIBRARY
   else ifeq ($$($1_TYPE), PROGRAM)
     $1_PREFIX = exe
--- a/make/data/tzdata/VERSION	Mon Sep 23 09:16:05 2019 -0700
+++ b/make/data/tzdata/VERSION	Wed Sep 25 22:40:41 2019 +0200
@@ -21,4 +21,4 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 #
-tzdata2019b
+tzdata2019c
--- a/make/data/tzdata/asia	Mon Sep 23 09:16:05 2019 -0700
+++ b/make/data/tzdata/asia	Wed Sep 25 22:40:41 2019 +0200
@@ -31,7 +31,7 @@
 # tz@iana.org for general use in the future).  For more, please see
 # the file CONTRIBUTING in the tz distribution.
 
-# From Paul Eggert (2018-06-19):
+# From Paul Eggert (2019-07-11):
 #
 # Unless otherwise specified, the source for data through 1990 is:
 # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
@@ -70,13 +70,13 @@
 #	7:00 WIB	west Indonesia (Waktu Indonesia Barat)
 #	8:00 WITA	central Indonesia (Waktu Indonesia Tengah)
 #	8:00 CST	China
-#	8:00 PST  PDT*	Philippine Standard Time
+#	8:00 HKT  HKST	Hong Kong (HKWT* for Winter Time in late 1941)
+#	8:00 PST  PDT*	Philippines
 #	8:30 KST  KDT	Korea when at +0830
 #	9:00 WIT	east Indonesia (Waktu Indonesia Timur)
 #	9:00 JST  JDT	Japan
 #	9:00 KST  KDT	Korea when at +09
-#	9:30 ACST	Australian Central Standard Time
-# *I invented the abbreviation PDT; see "Philippines" below.
+# *I invented the abbreviations HKWT and PDT; see below.
 # Otherwise, these tables typically use numeric abbreviations like +03
 # and +0330 for integer hour and minute UT offsets.  Although earlier
 # editions invented alphabetic time zone abbreviations for every
@@ -676,6 +676,15 @@
 # * 1941-09-30, Hong Kong Daily Press, Winter Time Warning.
 #   https://i.imgur.com/dge4kFJ.png
 
+# From Paul Eggert (2019-07-11):
+# "Hong Kong winter time" is considered to be daylight saving.
+# "Hong Kong had adopted daylight saving on June 15 as a wartime measure,
+# clocks moving forward one hour until October 1, when they would be put back
+# by just half an hour for 'Hong Kong Winter time', so that daylight saving
+# operated year round." -- Low Z. The longest day: when wartime Hong Kong
+# introduced daylight saving. South China Morning Post. 2019-06-28.
+# https://www.scmp.com/magazines/post-magazine/short-reads/article/3016281/longest-day-when-wartime-hong-kong-introduced
+
 # From P Chan (2018-12-31):
 # * According to the Hong Kong Daylight-Saving Regulations, 1941, the
 #   1941 spring-forward transition was at 03:00.
@@ -777,7 +786,7 @@
 Zone	Asia/Hong_Kong	7:36:42 -	LMT	1904 Oct 30  0:36:42
 			8:00	-	HKT	1941 Jun 15  3:00
 			8:00	1:00	HKST	1941 Oct  1  4:00
-			8:30	-	HKT	1941 Dec 25
+			8:00	0:30	HKWT	1941 Dec 25
 			9:00	-	JST	1945 Nov 18  2:00
 			8:00	HK	HK%sT
 
@@ -2442,7 +2451,7 @@
 Zone	Asia/Seoul	8:27:52	-	LMT	1908 Apr  1
 			8:30	-	KST	1912 Jan  1
 			9:00	-	JST	1945 Sep  8
-			9:00	-	KST	1954 Mar 21
+			9:00	ROK	K%sT	1954 Mar 21
 			8:30	ROK	K%sT	1961 Aug 10
 			9:00	ROK	K%sT
 Zone	Asia/Pyongyang	8:23:00 -	LMT	1908 Apr  1
@@ -3627,7 +3636,7 @@
 # and in South Vietnam in particular (after 1954):
 # To 07:00 on 1911-05-01.
 # To 08:00 on 1942-12-31 at 23:00.
-# To 09:00 in 1945-03-14 at 23:00.
+# To 09:00 on 1945-03-14 at 23:00.
 # To 07:00 on 1945-09-02 in Vietnam.
 # To 08:00 on 1947-04-01 in French-controlled Indochina.
 # To 07:00 on 1955-07-01 in South Vietnam.
--- a/make/data/tzdata/australasia	Mon Sep 23 09:16:05 2019 -0700
+++ b/make/data/tzdata/australasia	Wed Sep 25 22:40:41 2019 +0200
@@ -390,13 +390,18 @@
 # From Raymond Kumar (2018-07-13):
 # http://www.fijitimes.com/government-approves-2018-daylight-saving/
 # ... The daylight saving period will end at 3am on Sunday January 13, 2019.
-#
-# From Paul Eggert (2018-07-15):
-# For now, guess DST from 02:00 the first Sunday in November to 03:00
-# the first Sunday on or after January 13.  January transitions reportedly
+
+# From Paul Eggert (2019-08-06):
+# Today Raymond Kumar reported the Government of Fiji Gazette Supplement No. 27
+# (2019-08-02) said that Fiji observes DST "commencing at 2.00 am on
+# Sunday, 10 November 2019 and ending at 3.00 am on Sunday, 12 January 2020."
+# For now, guess DST from 02:00 the second Sunday in November to 03:00
+# the first Sunday on or after January 12.  January transitions reportedly
 # depend on when school terms start.  Although the guess is ad hoc, it matches
-# transitions since late 2014 and seems more likely to match future
-# practice than guessing no DST.
+# transitions planned this year and seems more likely to match future practice
+# than guessing no DST.
+# From Michael Deckers (2019-08-06):
+# https://www.laws.gov.fj/LawsAsMade/downloadfile/848
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Fiji	1998	1999	-	Nov	Sun>=1	2:00	1:00	-
@@ -407,8 +412,9 @@
 Rule	Fiji	2011	only	-	Mar	Sun>=1	3:00	0	-
 Rule	Fiji	2012	2013	-	Jan	Sun>=18	3:00	0	-
 Rule	Fiji	2014	only	-	Jan	Sun>=18	2:00	0	-
-Rule	Fiji	2014	max	-	Nov	Sun>=1	2:00	1:00	-
-Rule	Fiji	2015	max	-	Jan	Sun>=13	3:00	0	-
+Rule	Fiji	2014	2018	-	Nov	Sun>=1	2:00	1:00	-
+Rule	Fiji	2015	max	-	Jan	Sun>=12	3:00	0	-
+Rule	Fiji	2019	max	-	Nov	Sun>=8	2:00	1:00	-
 # Zone	NAME		STDOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Fiji	11:55:44 -	LMT	1915 Oct 26 # Suva
 			12:00	Fiji	+12/+13
@@ -627,10 +633,11 @@
 # Zone	NAME		STDOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Norfolk	11:11:52 -	LMT	1901 # Kingston
 			11:12	-	+1112	1951
-			11:30	-	+1130	1974 Oct 27 02:00
-			11:30	1:00	+1230	1975 Mar  2 02:00
-			11:30	-	+1130	2015 Oct  4 02:00
-			11:00	-	+11
+			11:30	-	+1130	1974 Oct 27 02:00s
+			11:30	1:00	+1230	1975 Mar  2 02:00s
+			11:30	-	+1130	2015 Oct  4 02:00s
+			11:00	-	+11	2019 Jul
+			11:00	AN	+11/+12
 
 # Palau (Belau)
 # Zone	NAME		STDOFF	RULES	FORMAT	[UNTIL]
@@ -1898,12 +1905,21 @@
 # ... at 12.30 am (by legal time in New South Wales) on 4 October 2015.
 # http://www.norfolkisland.gov.nf/nia/MediaRelease/Media%20Release%20Norfolk%20Island%20Standard%20Time%20Change.pdf
 
-# From Paul Eggert (2015-09-23):
+# From Paul Eggert (2019-08-28):
 # Transitions before 2015 are from timeanddate.com, which consulted
 # the Norfolk Island Museum and the Australian Bureau of Meteorology's
 # Norfolk Island station, and found no record of Norfolk observing DST
 # other than in 1974/5.  See:
 # https://www.timeanddate.com/time/australia/norfolk-island.html
+# However, disagree with timeanddate about the 1975-03-02 transition;
+# timeanddate has 02:00 but 02:00s corresponds to what the NSW law said
+# (thanks to Michael Deckers).
+
+# Norfolk started observing Australian DST in spring 2019.
+# From Kyle Czech (2019-08-13):
+# https://www.legislation.gov.au/Details/F2018L01702
+# From Michael Deckers (2019-08-14):
+# https://www.legislation.gov.au/Details/F2019C00010
 
 # Palau
 # See commentary for Micronesia.
--- a/make/data/tzdata/europe	Mon Sep 23 09:16:05 2019 -0700
+++ b/make/data/tzdata/europe	Wed Sep 25 22:40:41 2019 +0200
@@ -844,11 +844,16 @@
 # Shanks & Pottenger give 02:00, the BEV 00:00.  Go with the BEV,
 # and guess 02:00 for 1945-04-12.
 
+# From Alois Triendl (2019-07-22):
+# In 1946 the end of DST was on Monday, 7 October 1946, at 3:00 am.
+# Shanks had this right.  Source: Die Weltpresse, 5. Oktober 1946, page 5.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Austria	1920	only	-	Apr	 5	2:00s	1:00	S
 Rule	Austria	1920	only	-	Sep	13	2:00s	0	-
 Rule	Austria	1946	only	-	Apr	14	2:00s	1:00	S
-Rule	Austria	1946	1948	-	Oct	Sun>=1	2:00s	0	-
+Rule	Austria	1946	only	-	Oct	 7	2:00s	0	-
+Rule	Austria	1947	1948	-	Oct	Sun>=1	2:00s	0	-
 Rule	Austria	1947	only	-	Apr	 6	2:00s	1:00	S
 Rule	Austria	1948	only	-	Apr	18	2:00s	1:00	S
 Rule	Austria	1980	only	-	Apr	 6	0:00	1:00	S
@@ -898,15 +903,35 @@
 
 # Belgium
 #
-# From Paul Eggert (1997-07-02):
+# From Michael Deckers (2019-08-25):
+# The exposition in the web page
+# https://www.bestor.be/wiki/index.php/Voyager_dans_le_temps._L%E2%80%99introduction_de_la_norme_de_Greenwich_en_Belgique
+# gives several contemporary sources from which one can conclude that
+# the switch in Europe/Brussels on 1892-05-01 was from 00:17:30 to 00:00:00.
+#
+# From Paul Eggert (2019-08-28):
+# This quote helps explain the late-1914 situation:
+#   In early November 1914, the Germans imposed the time zone used in central
+#   Europe and forced the inhabitants to set their watches and public clocks
+#   sixty minutes ahead.  Many were reluctant to accept "German time" and
+#   continued to use "Belgian time" among themselves.  Reflecting the spirit of
+#   resistance that arose in the population, a song made fun of this change....
+# The song ended:
+#   Putting your clock forward
+#   Will but hasten the happy hour
+#   When we kick out the Boches!
+# See: Pluvinage G. Brussels on German time. Cahiers Bruxellois -
+# Brusselse Cahiers. 2014;XLVI(1E):15-38.
+# https://www.cairn.info/revue-cahiers-bruxellois-2014-1E-page-15.htm
+#
+# Entries from 1914 through 1917 are taken from "De tijd in België"
+# <https://www.astro.oma.be/GENERAL/INFO/nli001a.html>.
 # Entries from 1918 through 1991 are taken from:
 #	Annuaire de L'Observatoire Royal de Belgique,
 #	Avenue Circulaire, 3, B-1180 BRUXELLES, CLVIIe année, 1991
 #	(Imprimerie HAYEZ, s.p.r.l., Rue Fin, 4, 1080 BRUXELLES, MCMXC),
 #	pp 8-9.
-# LMT before 1892 was 0:17:30, according to the official journal of Belgium:
-#	Moniteur Belge, Samedi 30 Avril 1892, N.121.
-# Thanks to Pascal Delmoitie for these references.
+# Thanks to Pascal Delmoitie for the 1918/1991 references.
 # The 1918 rules are listed for completeness; they apply to unoccupied Belgium.
 # Assume Brussels switched to WET in 1918 when the armistice took effect.
 #
@@ -951,7 +976,7 @@
 Rule	Belgium	1946	only	-	Oct	 7	 2:00s	0	-
 # Zone	NAME		STDOFF	RULES	FORMAT	[UNTIL]
 Zone	Europe/Brussels	0:17:30 -	LMT	1880
-			0:17:30	-	BMT	1892 May  1 12:00  # Brussels MT
+			0:17:30	-	BMT	1892 May  1 00:17:30
 			0:00	-	WET	1914 Nov  8
 			1:00	-	CET	1916 May  1  0:00
 			1:00	C-Eur	CE%sT	1918 Nov 11 11:00u
@@ -1650,6 +1675,13 @@
 # advanced to sixty minutes later starting at hour two on 1944-04-02; ...
 # Starting at hour three on the date 1944-09-17 standard time will be resumed.
 #
+# From Alois Triendl (2019-07-02):
+# I spent 6 Euros to buy two archive copies of Il Messaggero, a Roman paper,
+# for 1 and 2 April 1944.  The edition of 2 April has this note: "Tonight at 2
+# am, put forward the clock by one hour.  Remember that in the night between
+# today and Monday the 'ora legale' will come in force again."  That makes it
+# clear that in Rome the change was on Monday, 3 April 1944 at 2 am.
+#
 # From Paul Eggert (2016-10-27):
 # Go with INRiM for DST rules, except as corrected by Inglis for 1944
 # for the Kingdom of Italy.  This is consistent with Renzo Baldini.
@@ -1797,15 +1829,10 @@
 # From Paul Eggert (2013-09-09):
 # Shanks & Pottenger say Vaduz is like Zurich.
 
-# From Alois Treindl (2013-09-18):
-# http://www.eliechtensteinensia.li/LIJ/1978/1938-1978/1941.pdf
-# ... confirms on p. 6 that Liechtenstein followed Switzerland in 1941 and 1942.
-# I ... translate only the last two paragraphs:
-#    ... during second world war, in the years 1941 and 1942, Liechtenstein
-#    introduced daylight saving time, adapting to Switzerland.  From 1943 on
-#    central European time was in force throughout the year.
-#    From a report of the duke's government to the high council,
-#    regarding the introduction of a time law, of 31 May 1977.
+# From Alois Treindl (2019-07-04):
+# I was able to access the online archive of the Vaduz paper Vaterland ...
+# I could confirm from the paper that Liechtenstein did in fact follow
+# the same DST in 1941 and 1942 as Switzerland did.
 
 Link Europe/Zurich Europe/Vaduz
 
@@ -2513,6 +2540,12 @@
 # Europe/Kaliningrad covers...
 # 39	RU-KGD	Kaliningrad Oblast
 
+# From Paul Eggert (2019-07-25):
+# Although Shanks lists 1945-01-01 as the date for transition from
+# +01/+02 to +02/+03, more likely this is a placeholder.  Guess that
+# the transition occurred at 1945-04-10 00:00, which is about when
+# Königsberg surrendered to Soviet troops.  (Thanks to Alois Triendl.)
+
 # From Paul Eggert (2016-03-18):
 # The 1989 transition is from USSR act No. 227 (1989-03-14).
 
@@ -2529,8 +2562,8 @@
 # Moscow on 1991-11-03, switched to Moscow-1 on 1992-01-19.
 
 Zone Europe/Kaliningrad	 1:22:00 -	LMT	1893 Apr
-			 1:00	C-Eur	CE%sT	1945
-			 2:00	Poland	CE%sT	1946
+			 1:00	C-Eur	CE%sT	1945 Apr 10
+			 2:00	Poland	EE%sT	1946 Apr  7
 			 3:00	Russia	MSK/MSD	1989 Mar 26  2:00s
 			 2:00	Russia	EE%sT	2011 Mar 27  2:00s
 			 3:00	-	+03	2014 Oct 26  2:00s
@@ -3673,20 +3706,75 @@
 
 # Turkey
 
+# From Alois Treindl (2019-08-12):
+# http://www.astrolojidergisi.com/yazsaati.htm has researched the time zone
+# history of Turkey, based on newspaper archives and official documents.
+# From Paul Eggert (2019-08-28):
+# That source (Oya Vulaş, "Türkiye'de Yaz Saati Uygulamaları")
+# is used for 1940/1972, where it seems more reliable than our other
+# sources.
+
+# From Kıvanç Yazan (2019-08-12):
+# http://www.resmigazete.gov.tr/arsiv/14539.pdf#page=24
+# 1973-06-03 01:00 -> 02:00, 1973-11-04 02:00 -> 01:00
+#
+# http://www.resmigazete.gov.tr/arsiv/14829.pdf#page=1
+# 1974-03-31 02:00 -> 03:00, 1974-11-03 02:00 -> 01:00
+#
+# http://www.resmigazete.gov.tr/arsiv/15161.pdf#page=1
+# 1975-03-22 02:00 -> 03:00, 1975-11-02 02:00 -> 01:00
+#
+# http://www.resmigazete.gov.tr/arsiv/15535_1.pdf#page=1
+# 1976-03-21 02:00 -> 03:00, 1976-10-31 02:00 -> 01:00
+#
+# http://www.resmigazete.gov.tr/arsiv/15778.pdf#page=5
+# 1977-04-03 02:00 -> 03:00, 1977-10-16 02:00 -> 01:00,
+# 1978-04-02 02:00 -> 03:00 (not applied, see below)
+# 1978-10-15 02:00 -> 01:00 (not applied, see below)
+# 1979-04-01 02:00 -> 03:00 (not applied, see below)
+# 1979-10-14 02:00 -> 01:00 (not applied, see below)
+#
+# http://www.resmigazete.gov.tr/arsiv/16245.pdf#page=17
+# This cancels the previous decision, and repeats it only for 1978.
+# 1978-04-02 02:00 -> 03:00, 1978-10-15 02:00 -> 01:00
+# (not applied due to standard TZ change below)
+#
+# http://www.resmigazete.gov.tr/arsiv/16331.pdf#page=3
+# This decision changes the default longitude for Turkish time zone from 30
+# degrees East to 45 degrees East.  This means a standard TZ change, from +2
+# to +3.  This is published & applied on 1978-06-29.  At that time, Turkey was
+# already on summer time (already on 45E).  Hence, this new law just meant an
+# "continuous summer time".  Note that this was reversed in a few years.
+#
+# http://www.resmigazete.gov.tr/arsiv/18119_1.pdf#page=1
+# 1983-07-31 02:00 -> 03:00 (note that this jumps TZ to +4)
+# 1983-10-02 02:00 -> 01:00 (back to +3)
+#
+# http://www.resmigazete.gov.tr/arsiv/18561.pdf (page 1 and 34)
+# At this time, Turkey is still on +3 with no spring-forward on early
+# 1984.  This decision is published on 10/31/1984.  Page 1 declares
+# the decision of reverting the "default longitude change".  So the
+# standard time should go back to +3 (30E).  And page 34 explains when
+# that will happen: 1984-11-01 02:00 -> 01:00.  You can think of this
+# as "end of continuous summer time, change of standard time zone".
+#
+# http://www.resmigazete.gov.tr/arsiv/18713.pdf#page=1
+# 1985-04-20 01:00 -> 02:00, 1985-09-28 02:00 -> 01:00
+
 # From Kıvanç Yazan (2016-09-25):
 # 1) For 1986-2006, DST started at 01:00 local and ended at 02:00 local, with
 #    no exceptions.
 # 2) 1994's lastSun was overridden with Mar 20 ...
 # Here are official papers:
-# http://www.resmigazete.gov.tr/arsiv/19032.pdf  - page 2 for 1986
-# http://www.resmigazete.gov.tr/arsiv/19400.pdf  - page 4 for 1987
-# http://www.resmigazete.gov.tr/arsiv/19752.pdf  - page 15 for 1988
-# http://www.resmigazete.gov.tr/arsiv/20102.pdf  - page 6 for 1989
-# http://www.resmigazete.gov.tr/arsiv/20464.pdf  - page 1 for 1990 - 1992
-# http://www.resmigazete.gov.tr/arsiv/21531.pdf  - page 15 for 1993 - 1995
-# http://www.resmigazete.gov.tr/arsiv/21879.pdf  - page 1 for overriding 1994
-# http://www.resmigazete.gov.tr/arsiv/22588.pdf  - page 1 for 1996, 1997
-# http://www.resmigazete.gov.tr/arsiv/23286.pdf  - page 10 for 1998 - 2000
+# http://www.resmigazete.gov.tr/arsiv/19032.pdf#page=2 for 1986
+# http://www.resmigazete.gov.tr/arsiv/19400.pdf#page=4 for 1987
+# http://www.resmigazete.gov.tr/arsiv/19752.pdf#page=15 for 1988
+# http://www.resmigazete.gov.tr/arsiv/20102.pdf#page=6 for 1989
+# http://www.resmigazete.gov.tr/arsiv/20464.pdf#page=1 for 1990 - 1992
+# http://www.resmigazete.gov.tr/arsiv/21531.pdf#page=15 for 1993 - 1995
+# http://www.resmigazete.gov.tr/arsiv/21879.pdf#page=1 for overriding 1994
+# http://www.resmigazete.gov.tr/arsiv/22588.pdf#page=1 for 1996, 1997
+# http://www.resmigazete.gov.tr/arsiv/23286.pdf#page=10 for 1998 - 2000
 # http://www.resmigazete.gov.tr/eskiler/2001/03/20010324.htm#2  - for 2001
 # http://www.resmigazete.gov.tr/eskiler/2002/03/20020316.htm#2  - for 2002-2006
 # From Paul Eggert (2016-09-25):
@@ -3770,46 +3858,36 @@
 Rule	Turkey	1924	only	-	May	13	0:00	1:00	S
 Rule	Turkey	1924	1925	-	Oct	 1	0:00	0	-
 Rule	Turkey	1925	only	-	May	 1	0:00	1:00	S
-Rule	Turkey	1940	only	-	Jun	30	0:00	1:00	S
-Rule	Turkey	1940	only	-	Oct	 5	0:00	0	-
+Rule	Turkey	1940	only	-	Jul	 1	0:00	1:00	S
+Rule	Turkey	1940	only	-	Oct	 6	0:00	0	-
 Rule	Turkey	1940	only	-	Dec	 1	0:00	1:00	S
 Rule	Turkey	1941	only	-	Sep	21	0:00	0	-
 Rule	Turkey	1942	only	-	Apr	 1	0:00	1:00	S
-# Whitman omits the next two transition and gives 1945 Oct 1;
-# go with Shanks & Pottenger.
-Rule	Turkey	1942	only	-	Nov	 1	0:00	0	-
-Rule	Turkey	1945	only	-	Apr	 2	0:00	1:00	S
 Rule	Turkey	1945	only	-	Oct	 8	0:00	0	-
 Rule	Turkey	1946	only	-	Jun	 1	0:00	1:00	S
 Rule	Turkey	1946	only	-	Oct	 1	0:00	0	-
 Rule	Turkey	1947	1948	-	Apr	Sun>=16	0:00	1:00	S
-Rule	Turkey	1947	1950	-	Oct	Sun>=2	0:00	0	-
+Rule	Turkey	1947	1951	-	Oct	Sun>=2	0:00	0	-
 Rule	Turkey	1949	only	-	Apr	10	0:00	1:00	S
-Rule	Turkey	1950	only	-	Apr	19	0:00	1:00	S
+Rule	Turkey	1950	only	-	Apr	16	0:00	1:00	S
 Rule	Turkey	1951	only	-	Apr	22	0:00	1:00	S
-Rule	Turkey	1951	only	-	Oct	 8	0:00	0	-
+# DST for 15 months; unusual but we'll let it pass.
 Rule	Turkey	1962	only	-	Jul	15	0:00	1:00	S
-Rule	Turkey	1962	only	-	Oct	 8	0:00	0	-
+Rule	Turkey	1963	only	-	Oct	30	0:00	0	-
 Rule	Turkey	1964	only	-	May	15	0:00	1:00	S
 Rule	Turkey	1964	only	-	Oct	 1	0:00	0	-
-Rule	Turkey	1970	1972	-	May	Sun>=2	0:00	1:00	S
-Rule	Turkey	1970	1972	-	Oct	Sun>=2	0:00	0	-
 Rule	Turkey	1973	only	-	Jun	 3	1:00	1:00	S
-Rule	Turkey	1973	only	-	Nov	 4	3:00	0	-
+Rule	Turkey	1973	1976	-	Oct	Sun>=31	2:00	0	-
 Rule	Turkey	1974	only	-	Mar	31	2:00	1:00	S
-Rule	Turkey	1974	only	-	Nov	 3	5:00	0	-
-Rule	Turkey	1975	only	-	Mar	30	0:00	1:00	S
-Rule	Turkey	1975	1976	-	Oct	lastSun	0:00	0	-
-Rule	Turkey	1976	only	-	Jun	 1	0:00	1:00	S
-Rule	Turkey	1977	1978	-	Apr	Sun>=1	0:00	1:00	S
-Rule	Turkey	1977	only	-	Oct	16	0:00	0	-
-Rule	Turkey	1979	1980	-	Apr	Sun>=1	3:00	1:00	S
-Rule	Turkey	1979	1982	-	Oct	Mon>=11	0:00	0	-
-Rule	Turkey	1981	1982	-	Mar	lastSun	3:00	1:00	S
-Rule	Turkey	1983	only	-	Jul	31	0:00	1:00	S
-Rule	Turkey	1983	only	-	Oct	 2	0:00	0	-
-Rule	Turkey	1985	only	-	Apr	20	0:00	1:00	S
-Rule	Turkey	1985	only	-	Sep	28	0:00	0	-
+Rule	Turkey	1975	only	-	Mar	22	2:00	1:00	S
+Rule	Turkey	1976	only	-	Mar	21	2:00	1:00	S
+Rule	Turkey	1977	1978	-	Apr	Sun>=1	2:00	1:00	S
+Rule	Turkey	1977	1978	-	Oct	Sun>=15	2:00	0	-
+Rule	Turkey	1978	only	-	Jun	29	0:00	0	-
+Rule	Turkey	1983	only	-	Jul	31	2:00	1:00	S
+Rule	Turkey	1983	only	-	Oct	 2	2:00	0	-
+Rule	Turkey	1985	only	-	Apr	20	1:00s	1:00	S
+Rule	Turkey	1985	only	-	Sep	28	1:00s	0	-
 Rule	Turkey	1986	1993	-	Mar	lastSun	1:00s	1:00	S
 Rule	Turkey	1986	1995	-	Sep	lastSun	1:00s	0	-
 Rule	Turkey	1994	only	-	Mar	20	1:00s	1:00	S
@@ -3818,8 +3896,8 @@
 # Zone	NAME		STDOFF	RULES	FORMAT	[UNTIL]
 Zone	Europe/Istanbul	1:55:52 -	LMT	1880
 			1:56:56	-	IMT	1910 Oct # Istanbul Mean Time?
-			2:00	Turkey	EE%sT	1978 Oct 15
-			3:00	Turkey	+03/+04	1985 Apr 20
+			2:00	Turkey	EE%sT	1978 Jun 29
+			3:00	Turkey	+03/+04	1984 Nov  1  2:00
 			2:00	Turkey	EE%sT	2007
 			2:00	EU	EE%sT	2011 Mar 27  1:00u
 			2:00	-	EET	2011 Mar 28  1:00u
--- a/make/data/tzdata/leapseconds	Mon Sep 23 09:16:05 2019 -0700
+++ b/make/data/tzdata/leapseconds	Wed Sep 25 22:40:41 2019 +0200
@@ -26,36 +26,39 @@
 # This file is in the public domain.
 
 # This file is generated automatically from the data in the public-domain
-# leap-seconds.list file, which can be copied from
+# NIST format leap-seconds.list file, which can be copied from
 # <ftp://ftp.nist.gov/pub/time/leap-seconds.list>
-# or <ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.list>
-# or <ftp://tycho.usno.navy.mil/pub/ntp/leap-seconds.list>.
+# or <ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.list>.
 # For more about leap-seconds.list, please see
 # The NTP Timescale and Leap Seconds
 # <https://www.eecis.udel.edu/~mills/leap.html>.
 
-# The International Earth Rotation and Reference Systems Service
+# The rules for leap seconds are specified in Annex 1 (Time scales) of:
+# Standard-frequency and time-signal emissions.
+# International Telecommunication Union - Radiocommunication Sector
+# (ITU-R) Recommendation TF.460-6 (02/2002)
+# <https://www.itu.int/rec/R-REC-TF.460-6-200202-I/>.
+# The International Earth Rotation and Reference Systems Service (IERS)
 # periodically uses leap seconds to keep UTC to within 0.9 s of UT1
-# (which measures the true angular orientation of the earth in space)
+# (a proxy for Earth's angle in space as measured by astronomers)
 # and publishes leap second data in a copyrighted file
 # <https://hpiers.obspm.fr/iers/bul/bulc/Leap_Second.dat>.
 # See: Levine J. Coordinated Universal Time and the leap second.
 # URSI Radio Sci Bull. 2016;89(4):30-6. doi:10.23919/URSIRSB.2016.7909995
 # <https://ieeexplore.ieee.org/document/7909995>.
 
-# There were no leap seconds before 1972, because the official mechanism
-# accounting for the discrepancy between atomic time and the earth's rotation
-# did not exist.  The first ("1 Jan 1972") data line in leap-seconds.list
+# There were no leap seconds before 1972, as no official mechanism
+# accounted for the discrepancy between atomic time (TAI) and the earth's
+# rotation.  The first ("1 Jan 1972") data line in leap-seconds.list
 # does not denote a leap second; it denotes the start of the current definition
 # of UTC.
 
-# The correction (+ or -) is made at the given time, so lines
-# will typically look like:
-#	Leap	YEAR	MON	DAY	23:59:60	+	R/S
-# or
-#	Leap	YEAR	MON	DAY	23:59:59	-	R/S
-
-# If the leap second is Rolling (R) the given time is local time (unused here).
+# All leap-seconds are Stationary (S) at the given UTC time.
+# The correction (+ or -) is made at the given time, so in the unlikely
+# event of a negative leap second, a line would look like this:
+# Leap	YEAR	MON	DAY	23:59:59	-	S
+# Typical lines look like this:
+# Leap	YEAR	MON	DAY	23:59:60	+	S
 Leap	1972	Jun	30	23:59:60	+	S
 Leap	1972	Dec	31	23:59:60	+	S
 Leap	1973	Dec	31	23:59:60	+	S
@@ -85,8 +88,8 @@
 Leap	2016	Dec	31	23:59:60	+	S
 
 # POSIX timestamps for the data in this file:
-#updated 1467936000
-#expires 1577491200
+#updated 1467936000 (2016-07-08 00:00:00 UTC)
+#expires 1593302400 (2020-06-28 00:00:00 UTC)
 
-#	Updated through IERS Bulletin C57
-#	File expires on:  28 December 2019
+#	Updated through IERS Bulletin C58
+#	File expires on:  28 June 2020
--- a/make/data/tzdata/northamerica	Mon Sep 23 09:16:05 2019 -0700
+++ b/make/data/tzdata/northamerica	Wed Sep 25 22:40:41 2019 +0200
@@ -429,6 +429,31 @@
 # From Paul Eggert (2015-12-25):
 # Assume this practice predates 1970, so Fort Pierre can use America/Chicago.
 
+# From Paul Eggert (2015-04-06):
+# In 1950s Nashville a public clock had dueling faces, one for conservatives
+# and the other for liberals; the two sides didn't agree about the time of day.
+# I haven't found a photo of this clock, nor have I tracked down the TIME
+# magazine report cited below, but here's the story as told by the late
+# American journalist John Seigenthaler, who was there:
+#
+# "The two [newspaper] owners held strongly contrasting political and
+# ideological views.  Evans was a New South liberal, Stahlman an Old South
+# conservative, and their two papers frequently clashed editorially, often on
+# the same day....  In the 1950s as the state legislature was grappling with
+# the question of whether to approve daylight saving time for the entire state,
+# TIME magazine reported:
+#
+# "'The Nashville Banner and The Nashville Tennessean rarely agree on anything
+# but the time of day - and last week they couldn't agree on that.'
+#
+# "It was all too true. The clock on the front of the building had two faces -
+# The Tennessean side of the building facing west, the other, east.  When it
+# was high noon Banner time, it was 11 a.m. Tennessean time."
+#
+# Seigenthaler J. For 100 years, Tennessean had it covered.
+# The Tennessean 2007-05-11, republished 2015-04-06.
+# https://www.tennessean.com/story/insider/extras/2015/04/06/archives-seigenthaler-for-100-years-the-tennessean-had-it-covered/25348545/
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
 Rule	Chicago	1920	only	-	Jun	13	2:00	1:00	D
 Rule	Chicago	1920	1921	-	Oct	lastSun	2:00	0	S
@@ -968,21 +993,21 @@
 			-5:00	US	E%sT
 #
 # Perry County, Indiana, switched from eastern to central time in April 2006.
+# From Alois Triendl (2019-07-09):
+# The Indianapolis News, Friday 27 October 1967 states that Perry County
+# returned to CST.  It went again to EST on 27 April 1969, as documented by the
+# Indianapolis star of Saturday 26 April.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
-Rule Perry	1946	only	-	Apr	lastSun	2:00	1:00	D
-Rule Perry	1946	only	-	Sep	lastSun	2:00	0	S
-Rule Perry	1953	1954	-	Apr	lastSun	2:00	1:00	D
-Rule Perry	1953	1959	-	Sep	lastSun	2:00	0	S
 Rule Perry	1955	only	-	May	 1	0:00	1:00	D
+Rule Perry	1955	1960	-	Sep	lastSun	2:00	0	S
 Rule Perry	1956	1963	-	Apr	lastSun	2:00	1:00	D
-Rule Perry	1960	only	-	Oct	lastSun	2:00	0	S
-Rule Perry	1961	only	-	Sep	lastSun	2:00	0	S
-Rule Perry	1962	1963	-	Oct	lastSun	2:00	0	S
+Rule Perry	1961	1963	-	Oct	lastSun	2:00	0	S
 # Zone	NAME		STDOFF	RULES	FORMAT	[UNTIL]
 Zone America/Indiana/Tell_City -5:47:03 - LMT	1883 Nov 18 12:12:57
 			-6:00	US	C%sT	1946
 			-6:00 Perry	C%sT	1964 Apr 26  2:00
-			-5:00	-	EST	1969
+			-5:00	-	EST	1967 Oct 29  2:00
+			-6:00	US	C%sT	1969 Apr 27  2:00
 			-5:00	US	E%sT	1971
 			-5:00	-	EST	2006 Apr  2  2:00
 			-6:00	US	C%sT
@@ -1058,16 +1083,27 @@
 # clear how this matched civil time in Louisville, so for now continue
 # to assume Louisville switched at noon new local time, like New York.
 #
+# From Michael Deckers (2019-08-06):
+# From the contemporary source given by Alois Treindl,
+# the switch in Louisville on 1946-04-28 was on 00:01
+# From Paul Eggert (2019-08-26):
+# That source was the Louisville Courier-Journal, 1946-04-27, p 4.
+# Shanks gives 02:00 for all 20th-century transition times in Louisville.
+# Evidently this is wrong for spring 1946.  Although also likely wrong
+# for other dates, we have no data.
+#
 # Part of Kentucky left its clocks alone in 1974.
 # This also includes Clark, Floyd, and Harrison counties in Indiana.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
 Rule Louisville	1921	only	-	May	1	2:00	1:00	D
 Rule Louisville	1921	only	-	Sep	1	2:00	0	S
-Rule Louisville	1941	1961	-	Apr	lastSun	2:00	1:00	D
+Rule Louisville	1941	only	-	Apr	lastSun	2:00	1:00	D
 Rule Louisville	1941	only	-	Sep	lastSun	2:00	0	S
+Rule Louisville	1946	only	-	Apr	lastSun	0:01	1:00	D
 Rule Louisville	1946	only	-	Jun	2	2:00	0	S
+Rule Louisville	1950	1961	-	Apr	lastSun	2:00	1:00	D
 Rule Louisville	1950	1955	-	Sep	lastSun	2:00	0	S
-Rule Louisville	1956	1960	-	Oct	lastSun	2:00	0	S
+Rule Louisville	1956	1961	-	Oct	lastSun	2:00	0	S
 # Zone	NAME		STDOFF	RULES	FORMAT	[UNTIL]
 Zone America/Kentucky/Louisville -5:43:02 -	LMT	1883 Nov 18 12:16:58
 			-6:00	US	C%sT	1921
@@ -1157,18 +1193,19 @@
 # one hour in 1914."  This change is not in Shanks.  We have no more
 # info, so omit this for now.
 #
-# From Paul Eggert (2017-07-26):
-# Although Shanks says Detroit observed DST in 1967 from 06-14 00:01
-# until 10-29 00:01, I now see multiple reports that this is incorrect.
-# For example, according to a 50-year anniversary report about the 1967
-# Detroit riots and a major-league doubleheader on 1967-07-23, "By the time
-# the last fly ball of the doubleheader settled into the glove of leftfielder
-# Lenny Green, it was after 7 p.m.  Detroit did not observe daylight saving
-# time, so light was already starting to fail.  Twilight was made even deeper
-# by billowing columns of smoke that ascended in an unbroken wall north of the
-# ballpark."  See: Dow B. Detroit '67: As violence unfolded, Tigers played two
-# at home vs. Yankees. Detroit Free Press 2017-07-23.
-# https://www.freep.com/story/sports/mlb/tigers/2017/07/23/detroit-tigers-1967-riot-new-york-yankees/499951001/
+# From Paul Eggert (2019-07-06):
+# Due to a complicated set of legal maneuvers, in 1967 Michigan did
+# not start daylight saving time when the rest of the US did.
+# Instead, it began DST on Jun 14 at 00:01.  This was big news:
+# the Detroit Free Press reported it at the top of Page 1 on
+# 1967-06-14, in an article "State Adjusting to Switch to Fast Time"
+# by Gary Blonston, above an article about Thurgood Marshall's
+# confirmation to the US Supreme Court.  Although Shanks says Detroit
+# observed DST until 1967-10-29 00:01, that time of day seems to be
+# incorrect, as the Free Press later said DST ended in Michigan at the
+# same time as the rest of the US.  Also, although Shanks reports no DST in
+# Detroit in 1968, it did observe DST that year; in the November 1968
+# election Michigan voters narrowly repealed DST, effective 1969.
 #
 # Most of Michigan observed DST from 1973 on, but was a bit late in 1975.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
@@ -1179,7 +1216,9 @@
 			-6:00	-	CST	1915 May 15  2:00
 			-5:00	-	EST	1942
 			-5:00	US	E%sT	1946
-			-5:00	Detroit	E%sT	1973
+			-5:00	Detroit	E%sT	1967 Jun 14  0:01
+			-5:00	US	E%sT	1969
+			-5:00	-	EST	1973
 			-5:00	US	E%sT	1975
 			-5:00	-	EST	1975 Apr 27  2:00
 			-5:00	US	E%sT
@@ -1228,6 +1267,12 @@
 #
 # Other sources occasionally used include:
 #
+#	Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
+#	<https://www.jstor.org/stable/1774359>.
+#
+#	Pearce C. The Great Daylight Saving Time Controversy.
+#	Australian Ebook Publisher. 2017. ISBN 978-1-925516-96-8.
+#
 #	Edward W. Whitman, World Time Differences,
 #	Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated),
 #	which I found in the UCLA library.
@@ -1236,9 +1281,6 @@
 #	<http://cs.ucla.edu/~eggert/The-Waste-of-Daylight-19th.pdf>
 #	[PDF] (1914-03)
 #
-#	Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
-#	<https://www.jstor.org/stable/1774359>.
-#
 # See the 'europe' file for Greenland.
 
 # Canada
@@ -1880,9 +1922,8 @@
 # Willett (1914-03) notes that DST "has been in operation ... in the
 # City of Moose Jaw, Saskatchewan, for one year."
 
-# From Paul Eggert (2019-04-26):
-# Chris Pearce's book "The Great Daylight Saving Time Controversy" (2017)
-# says that Regina observed DST in 1914-1917.  No dates and times,
+# From Paul Eggert (2019-07-25):
+# Pearce's book says Regina observed DST in 1914-1917.  No dates and times,
 # unfortunately.  It also says that in 1914 Saskatoon observed DST
 # from 1 June to 6 July, and that DST was also tried out in Davidson,
 # Melfort, and Prince Albert.
@@ -1962,6 +2003,19 @@
 
 # Alberta
 
+# From Alois Triendl (2019-07-19):
+# There was no DST in Alberta in 1967... Calgary Herald, 29 April 1967.
+# 1969, no DST, from Edmonton Journal 18 April 1969
+#
+# From Paul Eggert (2019-07-25):
+# Pearce's book says that Alberta's 1948 Daylight Saving Act required
+# Mountain Standard Time without DST, and that "anyone who broke that law
+# could be fined up to $25 and costs".  There seems to be no record of
+# anybody paying the fine.  The law was not changed until an August 1971
+# plebiscite reinstituted DST in 1972.  This story is also mentioned in:
+# Boyer JP. Forcing Choice: The Risky Reward of Referendums. Dundum. 2017.
+# ISBN 978-1459739123.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Edm	1918	1919	-	Apr	Sun>=8	2:00	1:00	D
 Rule	Edm	1918	only	-	Oct	27	2:00	0	S
@@ -1974,10 +2028,6 @@
 Rule	Edm	1945	only	-	Sep	lastSun	2:00	0	S
 Rule	Edm	1947	only	-	Apr	lastSun	2:00	1:00	D
 Rule	Edm	1947	only	-	Sep	lastSun	2:00	0	S
-Rule	Edm	1967	only	-	Apr	lastSun	2:00	1:00	D
-Rule	Edm	1967	only	-	Oct	lastSun	2:00	0	S
-Rule	Edm	1969	only	-	Apr	lastSun	2:00	1:00	D
-Rule	Edm	1969	only	-	Oct	lastSun	2:00	0	S
 Rule	Edm	1972	1986	-	Apr	lastSun	2:00	1:00	D
 Rule	Edm	1972	2006	-	Oct	lastSun	2:00	0	S
 # Zone	NAME		STDOFF	RULES	FORMAT	[UNTIL]
@@ -2060,8 +2110,20 @@
 # been on MST (-0700) like Dawson Creek since it advanced its clocks on
 # 2015-03-08.
 #
-# From Paul Eggert (2015-09-23):
+# From Paul Eggert (2019-07-25):
 # Shanks says Fort Nelson did not observe DST in 1946, unlike Vancouver.
+# Alois Triendl confirmed this on 07-22, citing the 1946-04-27 Vancouver Daily
+# Province.  He also cited the 1946-09-28 Victoria Daily Times, which said
+# that Vancouver, Victoria, etc. "change at midnight Saturday"; for now,
+# guess they meant 02:00 Sunday since 02:00 was common practice in Vancouver.
+#
+# Early Vancouver, Volume Four, by Major J.S. Matthews, V.D., 2011 edition
+# says that a 1922 plebiscite adopted DST, but a 1923 plebiscite rejected it.
+# http://former.vancouver.ca/ctyclerk/archives/digitized/EarlyVan/SearchEarlyVan/Vol4pdf/MatthewsEarlyVancouverVol4_DaylightSavings.pdf
+# A catalog entry for a newspaper clipping seems to indicate that Vancouver
+# observed DST in 1941 from 07-07 through 09-27; see
+# https://searcharchives.vancouver.ca/daylight-saving-1918-starts-again-july-7-1941-start-d-s-sept-27-end-of-d-s-1941
+# We have no further details, so omit them for now.
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Vanc	1918	only	-	Apr	14	2:00	1:00	D
@@ -2070,7 +2132,7 @@
 Rule	Vanc	1945	only	-	Aug	14	23:00u	1:00	P # Peace
 Rule	Vanc	1945	only	-	Sep	30	2:00	0	S
 Rule	Vanc	1946	1986	-	Apr	lastSun	2:00	1:00	D
-Rule	Vanc	1946	only	-	Oct	13	2:00	0	S
+Rule	Vanc	1946	only	-	Sep	29	2:00	0	S
 Rule	Vanc	1947	1961	-	Sep	lastSun	2:00	0	S
 Rule	Vanc	1962	2006	-	Oct	lastSun	2:00	0	S
 # Zone	NAME		STDOFF	RULES	FORMAT	[UNTIL]
--- a/make/data/tzdata/southamerica	Mon Sep 23 09:16:05 2019 -0700
+++ b/make/data/tzdata/southamerica	Wed Sep 25 22:40:41 2019 +0200
@@ -1253,14 +1253,8 @@
 # From Juan Correa (2016-12-04):
 # Magallanes region ... will keep DST (UTC -3) all year round....
 # http://www.soychile.cl/Santiago/Sociedad/2016/12/04/433428/Bachelet-firmo-el-decreto-para-establecer-un-horario-unico-para-la-Region-de-Magallanes.aspx
-#
 # From Deborah Goldsmith (2017-01-19):
 # http://www.diariooficial.interior.gob.cl/publicaciones/2017/01/17/41660/01/1169626.pdf
-# From Paul Eggert (2017-01-19):
-# The above says the Magallanes change expires 2019-05-11 at 24:00,
-# so in theory, they will revert to -04/-03 after that, which means
-# they will switch from -03 to -04 one hour after Santiago does that day.
-# For now, assume that they will not revert.
 
 # From Juan Correa (2018-08-13):
 # As of moments ago, the Ministry of Energy in Chile has announced the new
@@ -1281,6 +1275,11 @@
 # So we extend the new rules on Saturdays at 24:00 mainland time indefinitely.
 # From Juan Correa (2019-02-04):
 # http://www.diariooficial.interior.gob.cl/publicaciones/2018/11/23/42212/01/1498738.pdf
+# From Paul Eggert (2019-09-01):
+# The above says the Magallanes exception expires 2022-04-02 at 24:00,
+# so in theory, they will revert to -04/-03 after that.
+# For now, assume that they will not revert,
+# since they have extended the expiration date once already.
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Chile	1927	1931	-	Sep	 1	0:00	1:00	-
--- a/src/hotspot/cpu/aarch64/c1_FrameMap_aarch64.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/aarch64/c1_FrameMap_aarch64.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -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.
  * Copyright (c) 2014, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -45,7 +45,7 @@
       Register reg2 = r_2->as_Register();
       assert(reg2 == reg, "must be same register");
       opr = as_long_opr(reg);
-    } else if (type == T_OBJECT || type == T_ARRAY) {
+    } else if (is_reference_type(type)) {
       opr = as_oop_opr(reg);
     } else if (type == T_METADATA) {
       opr = as_metadata_opr(reg);
--- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -728,7 +728,7 @@
     move_regs(src->as_register(), dest->as_register());
 
   } else if (dest->is_double_cpu()) {
-    if (src->type() == T_OBJECT || src->type() == T_ARRAY) {
+    if (is_reference_type(src->type())) {
       // Surprising to me but we can see move of a long to t_object
       __ verify_oop(src->as_register());
       move_regs(src->as_register(), dest->as_register_lo());
@@ -756,7 +756,7 @@
 
 void LIR_Assembler::reg2stack(LIR_Opr src, LIR_Opr dest, BasicType type, bool pop_fpu_stack) {
   if (src->is_single_cpu()) {
-    if (type == T_ARRAY || type == T_OBJECT) {
+    if (is_reference_type(type)) {
       __ str(src->as_register(), frame_map()->address_for_slot(dest->single_stack_ix()));
       __ verify_oop(src->as_register());
     } else if (type == T_METADATA || type == T_DOUBLE) {
@@ -794,7 +794,7 @@
     return;
   }
 
-  if (type == T_ARRAY || type == T_OBJECT) {
+  if (is_reference_type(type)) {
     __ verify_oop(src->as_register());
 
     if (UseCompressedOops && !wide) {
@@ -869,7 +869,7 @@
   assert(dest->is_register(), "should not call otherwise");
 
   if (dest->is_single_cpu()) {
-    if (type == T_ARRAY || type == T_OBJECT) {
+    if (is_reference_type(type)) {
       __ ldr(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix()));
       __ verify_oop(dest->as_register());
     } else if (type == T_METADATA) {
@@ -1019,7 +1019,7 @@
       ShouldNotReachHere();
   }
 
-  if (type == T_ARRAY || type == T_OBJECT) {
+  if (is_reference_type(type)) {
     if (UseCompressedOops && !wide) {
       __ decode_heap_oop(dest->as_register());
     }
@@ -1227,8 +1227,8 @@
   __ uxtw(len, len);
 
   if (UseSlowPath ||
-      (!UseFastNewObjectArray && (op->type() == T_OBJECT || op->type() == T_ARRAY)) ||
-      (!UseFastNewTypeArray   && (op->type() != T_OBJECT && op->type() != T_ARRAY))) {
+      (!UseFastNewObjectArray && is_reference_type(op->type())) ||
+      (!UseFastNewTypeArray   && !is_reference_type(op->type()))) {
     __ b(*op->stub()->entry());
   } else {
     Register tmp1 = op->tmp1()->as_register();
@@ -1948,10 +1948,10 @@
     if (opr2->is_single_cpu()) {
       // cpu register - cpu register
       Register reg2 = opr2->as_register();
-      if (opr1->type() == T_OBJECT || opr1->type() == T_ARRAY) {
+      if (is_reference_type(opr1->type())) {
         __ cmpoop(reg1, reg2);
       } else {
-        assert(opr2->type() != T_OBJECT && opr2->type() != T_ARRAY, "cmp int, oop?");
+        assert(!is_reference_type(opr2->type()), "cmp int, oop?");
         __ cmpw(reg1, reg2);
       }
       return;
@@ -2243,7 +2243,7 @@
   CodeStub* stub = op->stub();
   int flags = op->flags();
   BasicType basic_type = default_type != NULL ? default_type->element_type()->basic_type() : T_ILLEGAL;
-  if (basic_type == T_ARRAY) basic_type = T_OBJECT;
+  if (is_reference_type(basic_type)) basic_type = T_OBJECT;
 
   // if we don't know anything, just go through the generic arraycopy
   if (default_type == NULL // || basic_type == T_OBJECT
@@ -3131,7 +3131,7 @@
 void LIR_Assembler::atomic_op(LIR_Code code, LIR_Opr src, LIR_Opr data, LIR_Opr dest, LIR_Opr tmp_op) {
   Address addr = as_Address(src->as_address_ptr());
   BasicType type = src->type();
-  bool is_oop = type == T_OBJECT || type == T_ARRAY;
+  bool is_oop = is_reference_type(type);
 
   void (MacroAssembler::* add)(Register prev, RegisterOrConstant incr, Register addr);
   void (MacroAssembler::* xchg)(Register prev, Register newv, Register addr);
--- a/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -733,7 +733,7 @@
   new_value.load_item();
   cmp_value.load_item();
   LIR_Opr result = new_register(T_INT);
-  if (type == T_OBJECT || type == T_ARRAY) {
+  if (is_reference_type(type)) {
     __ cas_obj(addr, cmp_value.result(), new_value.result(), new_register(T_INT), new_register(T_INT), result);
   } else if (type == T_INT) {
     __ cas_int(addr->as_address_ptr()->base(), cmp_value.result(), new_value.result(), ill, ill);
@@ -748,7 +748,7 @@
 }
 
 LIR_Opr LIRGenerator::atomic_xchg(BasicType type, LIR_Opr addr, LIRItem& value) {
-  bool is_oop = type == T_OBJECT || type == T_ARRAY;
+  bool is_oop = is_reference_type(type);
   LIR_Opr result = new_register(type);
   value.load_item();
   assert(type == T_INT || is_oop LP64_ONLY( || type == T_LONG ), "unexpected type");
--- a/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -251,7 +251,7 @@
 
 void G1BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
                                     Register dst, Address src, Register tmp1, Register tmp_thread) {
-  bool on_oop = type == T_OBJECT || type == T_ARRAY;
+  bool on_oop = is_reference_type(type);
   bool on_weak = (decorators & ON_WEAK_OOP_REF) != 0;
   bool on_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
   bool on_reference = on_weak || on_phantom;
--- a/src/hotspot/cpu/aarch64/gc/shared/modRefBarrierSetAssembler_aarch64.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/aarch64/gc/shared/modRefBarrierSetAssembler_aarch64.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -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,7 +46,7 @@
 
 void ModRefBarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
                                          Address dst, Register val, Register tmp1, Register tmp2) {
-  if (type == T_OBJECT || type == T_ARRAY) {
+  if (is_reference_type(type)) {
     oop_store_at(masm, decorators, type, dst, val, tmp1, tmp2);
   } else {
     BarrierSetAssembler::store_at(masm, decorators, type, dst, val, tmp1, tmp2);
--- a/src/hotspot/cpu/aarch64/gc/shenandoah/c1/shenandoahBarrierSetC1_aarch64.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/aarch64/gc/shenandoah/c1/shenandoahBarrierSetC1_aarch64.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -94,7 +94,7 @@
     value_opr = storeval_barrier(access.gen(), value_opr, access.access_emit_info(), access.decorators());
   }
 
-  assert(type == T_INT || type == T_OBJECT || type == T_ARRAY LP64_ONLY( || type == T_LONG ), "unexpected type");
+  assert(type == T_INT || is_reference_type(type) LP64_ONLY( || type == T_LONG ), "unexpected type");
   LIR_Opr tmp = gen->new_register(T_INT);
   __ xchg(access.resolved_addr(), value_opr, result, tmp);
 
--- a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -317,7 +317,7 @@
 
 void ShenandoahBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
                                             Register dst, Address src, Register tmp1, Register tmp_thread) {
-  bool on_oop = type == T_OBJECT || type == T_ARRAY;
+  bool on_oop = is_reference_type(type);
   bool not_in_heap = (decorators & IN_NATIVE) != 0;
   bool on_weak = (decorators & ON_WEAK_OOP_REF) != 0;
   bool on_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
@@ -352,7 +352,7 @@
 
 void ShenandoahBarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
                                              Address dst, Register val, Register tmp1, Register tmp2) {
-  bool on_oop = type == T_OBJECT || type == T_ARRAY;
+  bool on_oop = is_reference_type(type);
   if (!on_oop) {
     BarrierSetAssembler::store_at(masm, decorators, type, dst, val, tmp1, tmp2);
     return;
--- a/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -127,7 +127,7 @@
                                         Register tmp1,
                                         Register tmp2) {
   // Verify value
-  if (type == T_OBJECT || type == T_ARRAY) {
+  if (is_reference_type(type)) {
     // Note that src could be noreg, which means we
     // are storing null and can skip verification.
     if (val != noreg) {
--- a/src/hotspot/cpu/aarch64/gc/z/zGlobals_aarch64.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/aarch64/gc/z/zGlobals_aarch64.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -135,26 +135,6 @@
 //  * 63-48 Fixed (16-bits, always zero)
 //
 
-uintptr_t ZPlatformAddressSpaceStart() {
-  const uintptr_t first_heap_view_address = (uintptr_t)1 << (ZPlatformAddressMetadataShift() + 0);
-  const size_t min_address_offset = 0;
-  return first_heap_view_address + min_address_offset;
-}
-
-uintptr_t ZPlatformAddressSpaceEnd() {
-  const uintptr_t last_heap_view_address = (uintptr_t)1 << (ZPlatformAddressMetadataShift() + 2);
-  const size_t max_address_offset = (size_t)1 << ZPlatformAddressOffsetBits();
-  return last_heap_view_address + max_address_offset;
-}
-
-uintptr_t ZPlatformAddressReservedStart() {
-  return ZPlatformAddressSpaceStart();
-}
-
-uintptr_t ZPlatformAddressReservedEnd() {
-  return ZPlatformAddressSpaceEnd();
-}
-
 uintptr_t ZPlatformAddressBase() {
   return 0;
 }
--- a/src/hotspot/cpu/aarch64/gc/z/zGlobals_aarch64.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/aarch64/gc/z/zGlobals_aarch64.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -40,10 +40,6 @@
 const size_t ZPlatformNMethodDisarmedOffset = 4;
 const size_t ZPlatformCacheLineSize         = 64;
 
-uintptr_t    ZPlatformAddressSpaceStart();
-uintptr_t    ZPlatformAddressSpaceEnd();
-uintptr_t    ZPlatformAddressReservedStart();
-uintptr_t    ZPlatformAddressReservedEnd();
 uintptr_t    ZPlatformAddressBase();
 size_t       ZPlatformAddressOffsetBits();
 size_t       ZPlatformAddressMetadataShift();
--- a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -1952,7 +1952,7 @@
   __ reset_last_Java_frame(false);
 
   // Unbox oop result, e.g. JNIHandles::resolve result.
-  if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
+  if (is_reference_type(ret_type)) {
     __ resolve_jobject(r0, rthread, rscratch2);
   }
 
--- a/src/hotspot/cpu/sparc/c1_FrameMap_sparc.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/sparc/c1_FrameMap_sparc.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, 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
@@ -51,7 +51,7 @@
     }
     if (r_2->is_Register() && (type == T_LONG || type == T_DOUBLE)) {
       opr = as_long_opr(reg);
-    } else if (type == T_OBJECT || type == T_ARRAY) {
+    } else if (is_reference_type(type)) {
       opr = as_oop_opr(reg);
     } else if (type == T_METADATA) {
       opr = as_metadata_opr(reg);
--- a/src/hotspot/cpu/sparc/c1_LIRAssembler_sparc.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/sparc/c1_LIRAssembler_sparc.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -107,8 +107,8 @@
       }
 
       if (UseCompressedOops) {
-        if (dst->is_address() && !dst->is_stack() && (dst->type() == T_OBJECT || dst->type() == T_ARRAY)) return false;
-        if (src->is_address() && !src->is_stack() && (src->type() == T_OBJECT || src->type() == T_ARRAY)) return false;
+        if (dst->is_address() && !dst->is_stack() && is_reference_type(dst->type())) return false;
+        if (src->is_address() && !src->is_stack() && is_reference_type(src->type())) return false;
       }
 
       if (UseCompressedClassPointers) {
@@ -728,7 +728,7 @@
     __ set(offset, O7);
     store_offset = store(from_reg, base, O7, type, wide);
   } else {
-    if (type == T_ARRAY || type == T_OBJECT) {
+    if (is_reference_type(type)) {
       __ verify_oop(from_reg->as_register());
     }
     store_offset = code_offset();
@@ -789,7 +789,7 @@
 
 
 int LIR_Assembler::store(LIR_Opr from_reg, Register base, Register disp, BasicType type, bool wide) {
-  if (type == T_ARRAY || type == T_OBJECT) {
+  if (is_reference_type(type)) {
     __ verify_oop(from_reg->as_register());
   }
   int store_offset = code_offset();
@@ -889,7 +889,7 @@
         }
       default      : ShouldNotReachHere();
     }
-    if (type == T_ARRAY || type == T_OBJECT) {
+    if (is_reference_type(type)) {
       __ verify_oop(to_reg->as_register());
     }
   }
@@ -924,7 +924,7 @@
       break;
     default      : ShouldNotReachHere();
   }
-  if (type == T_ARRAY || type == T_OBJECT) {
+  if (is_reference_type(type)) {
     __ verify_oop(to_reg->as_register());
   }
   return load_offset;
@@ -1359,7 +1359,7 @@
   } else {
     ShouldNotReachHere();
   }
-  if (to_reg->type() == T_OBJECT || to_reg->type() == T_ARRAY) {
+  if (is_reference_type(to_reg->type())) {
     __ verify_oop(to_reg->as_register());
   }
 }
@@ -2295,8 +2295,8 @@
 
   __ signx(op->len()->as_register());
   if (UseSlowPath ||
-      (!UseFastNewObjectArray && (op->type() == T_OBJECT || op->type() == T_ARRAY)) ||
-      (!UseFastNewTypeArray   && (op->type() != T_OBJECT && op->type() != T_ARRAY))) {
+      (!UseFastNewObjectArray && is_reference_type(op->type())) ||
+      (!UseFastNewTypeArray   && !is_reference_type(op->type()))) {
     __ br(Assembler::always, false, Assembler::pt, *op->stub()->entry());
     __ delayed()->nop();
   } else {
--- a/src/hotspot/cpu/sparc/c1_LIRGenerator_sparc.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/sparc/c1_LIRGenerator_sparc.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -568,7 +568,7 @@
   LIR_Opr t2 = FrameMap::G3_opr;
   cmp_value.load_item();
   new_value.load_item();
-  if (type == T_OBJECT || type == T_ARRAY) {
+  if (is_reference_type(type)) {
     __ cas_obj(addr->as_address_ptr()->base(), cmp_value.result(), new_value.result(), t1, t2);
   } else if (type == T_INT) {
     __ cas_int(addr->as_address_ptr()->base(), cmp_value.result(), new_value.result(), t1, t2);
@@ -583,7 +583,7 @@
 }
 
 LIR_Opr LIRGenerator::atomic_xchg(BasicType type, LIR_Opr addr, LIRItem& value) {
-  bool is_obj = type == T_OBJECT || type == T_ARRAY;
+  bool is_obj = is_reference_type(type);
   LIR_Opr result = new_register(type);
   LIR_Opr tmp = LIR_OprFact::illegalOpr;
 
--- a/src/hotspot/cpu/sparc/gc/g1/g1BarrierSetAssembler_sparc.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/sparc/gc/g1/g1BarrierSetAssembler_sparc.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -450,7 +450,7 @@
 
 void G1BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
                                     Address src, Register dst, Register tmp) {
-  bool on_oop = type == T_OBJECT || type == T_ARRAY;
+  bool on_oop = is_reference_type(type);
   bool on_weak = (decorators & ON_WEAK_OOP_REF) != 0;
   bool on_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
   bool on_reference = on_weak || on_phantom;
--- a/src/hotspot/cpu/sparc/gc/shared/modRefBarrierSetAssembler_sparc.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/sparc/gc/shared/modRefBarrierSetAssembler_sparc.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -58,7 +58,7 @@
 
 void ModRefBarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
                                          Register val, Address dst, Register tmp) {
-  if (type == T_OBJECT || type == T_ARRAY) {
+  if (is_reference_type(type)) {
     oop_store_at(masm, decorators, type, val, dst, tmp);
   } else {
     BarrierSetAssembler::store_at(masm, decorators, type, val, dst, tmp);
--- a/src/hotspot/cpu/sparc/sharedRuntime_sparc.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/sparc/sharedRuntime_sparc.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -561,7 +561,7 @@
 
     if (r_1->is_Register()) {
       Register r = r_1->as_Register()->after_restore();
-      if (sig_bt[i] == T_OBJECT || sig_bt[i] == T_ARRAY) {
+      if (is_reference_type(sig_bt[i])) {
         store_c2i_object(r, base, st_off);
       } else if (sig_bt[i] == T_LONG || sig_bt[i] == T_DOUBLE) {
         store_c2i_long(r, base, st_off, r_2->is_stack());
@@ -1637,8 +1637,7 @@
   Register temp_reg = G5_method;  // not part of any compiled calling seq
   if (VerifyOops) {
     for (int i = 0; i < method->size_of_parameters(); i++) {
-      if (sig_bt[i] == T_OBJECT ||
-          sig_bt[i] == T_ARRAY) {
+      if (is_reference_type(sig_bt[i])) {
         VMReg r = regs[i].first();
         assert(r->is_valid(), "bad oop arg");
         if (r->is_stack()) {
@@ -2507,7 +2506,7 @@
   __ reset_last_Java_frame();
 
   // Unbox oop result, e.g. JNIHandles::resolve value in I0.
-  if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
+  if (is_reference_type(ret_type)) {
     __ resolve_jobject(I0, G3_scratch);
   }
 
--- a/src/hotspot/cpu/x86/c1_FrameMap_x86.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/x86/c1_FrameMap_x86.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, 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
@@ -50,7 +50,7 @@
 #else
       opr = as_long_opr(reg2, reg);
 #endif // _LP64
-    } else if (type == T_OBJECT || type == T_ARRAY) {
+    } else if (is_reference_type(type)) {
       opr = as_oop_opr(reg);
     } else if (type == T_METADATA) {
       opr = as_metadata_opr(reg);
--- a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -861,7 +861,7 @@
 
   } else if (dest->is_double_cpu()) {
 #ifdef _LP64
-    if (src->type() == T_OBJECT || src->type() == T_ARRAY) {
+    if (is_reference_type(src->type())) {
       // Surprising to me but we can see move of a long to t_object
       __ verify_oop(src->as_register());
       move_regs(src->as_register(), dest->as_register_lo());
@@ -932,7 +932,7 @@
 
   if (src->is_single_cpu()) {
     Address dst = frame_map()->address_for_slot(dest->single_stack_ix());
-    if (type == T_OBJECT || type == T_ARRAY) {
+    if (is_reference_type(type)) {
       __ verify_oop(src->as_register());
       __ movptr (dst, src->as_register());
     } else if (type == T_METADATA) {
@@ -978,7 +978,7 @@
   PatchingStub* patch = NULL;
   Register compressed_src = rscratch1;
 
-  if (type == T_ARRAY || type == T_OBJECT) {
+  if (is_reference_type(type)) {
     __ verify_oop(src->as_register());
 #ifdef _LP64
     if (UseCompressedOops && !wide) {
@@ -1113,7 +1113,7 @@
   assert(dest->is_register(), "should not call otherwise");
 
   if (dest->is_single_cpu()) {
-    if (type == T_ARRAY || type == T_OBJECT) {
+    if (is_reference_type(type)) {
       __ movptr(dest->as_register(), frame_map()->address_for_slot(src->single_stack_ix()));
       __ verify_oop(dest->as_register());
     } else if (type == T_METADATA) {
@@ -1154,7 +1154,7 @@
 
 void LIR_Assembler::stack2stack(LIR_Opr src, LIR_Opr dest, BasicType type) {
   if (src->is_single_stack()) {
-    if (type == T_OBJECT || type == T_ARRAY) {
+    if (is_reference_type(type)) {
       __ pushptr(frame_map()->address_for_slot(src ->single_stack_ix()));
       __ popptr (frame_map()->address_for_slot(dest->single_stack_ix()));
     } else {
@@ -1355,7 +1355,7 @@
     patching_epilog(patch, patch_code, addr->base()->as_register(), info);
   }
 
-  if (type == T_ARRAY || type == T_OBJECT) {
+  if (is_reference_type(type)) {
 #ifdef _LP64
     if (UseCompressedOops && !wide) {
       __ decode_heap_oop(dest->as_register());
@@ -1593,8 +1593,8 @@
   LP64_ONLY( __ movslq(len, len); )
 
   if (UseSlowPath ||
-      (!UseFastNewObjectArray && (op->type() == T_OBJECT || op->type() == T_ARRAY)) ||
-      (!UseFastNewTypeArray   && (op->type() != T_OBJECT && op->type() != T_ARRAY))) {
+      (!UseFastNewObjectArray && is_reference_type(op->type())) ||
+      (!UseFastNewTypeArray   && !is_reference_type(op->type()))) {
     __ jmp(*op->stub()->entry());
   } else {
     Register tmp1 = op->tmp1()->as_register();
@@ -2510,7 +2510,7 @@
     } else {
 #ifdef _LP64
       Register r_lo;
-      if (right->type() == T_OBJECT || right->type() == T_ARRAY) {
+      if (is_reference_type(right->type())) {
         r_lo = right->as_register();
       } else {
         r_lo = right->as_register_lo();
@@ -2623,15 +2623,15 @@
     Register reg1 = opr1->as_register();
     if (opr2->is_single_cpu()) {
       // cpu register - cpu register
-      if (opr1->type() == T_OBJECT || opr1->type() == T_ARRAY) {
+      if (is_reference_type(opr1->type())) {
         __ cmpoop(reg1, opr2->as_register());
       } else {
-        assert(opr2->type() != T_OBJECT && opr2->type() != T_ARRAY, "cmp int, oop?");
+        assert(!is_reference_type(opr2->type()), "cmp int, oop?");
         __ cmpl(reg1, opr2->as_register());
       }
     } else if (opr2->is_stack()) {
       // cpu register - stack
-      if (opr1->type() == T_OBJECT || opr1->type() == T_ARRAY) {
+      if (is_reference_type(opr1->type())) {
         __ cmpoop(reg1, frame_map()->address_for_slot(opr2->single_stack_ix()));
       } else {
         __ cmpl(reg1, frame_map()->address_for_slot(opr2->single_stack_ix()));
@@ -2641,7 +2641,7 @@
       LIR_Const* c = opr2->as_constant_ptr();
       if (c->type() == T_INT) {
         __ cmpl(reg1, c->as_jint());
-      } else if (c->type() == T_OBJECT || c->type() == T_ARRAY) {
+      } else if (is_reference_type(c->type())) {
         // In 64bit oops are single register
         jobject o = c->as_jobject();
         if (o == NULL) {
@@ -2741,7 +2741,7 @@
   } else if (opr1->is_address() && opr2->is_constant()) {
     LIR_Const* c = opr2->as_constant_ptr();
 #ifdef _LP64
-    if (c->type() == T_OBJECT || c->type() == T_ARRAY) {
+    if (is_reference_type(c->type())) {
       assert(condition == lir_cond_equal || condition == lir_cond_notEqual, "need to reverse");
       __ movoop(rscratch1, c->as_jobject());
     }
@@ -2753,7 +2753,7 @@
     LIR_Address* addr = opr1->as_address_ptr();
     if (c->type() == T_INT) {
       __ cmpl(as_Address(addr), c->as_jint());
-    } else if (c->type() == T_OBJECT || c->type() == T_ARRAY) {
+    } else if (is_reference_type(c->type())) {
 #ifdef _LP64
       // %%% Make this explode if addr isn't reachable until we figure out a
       // better strategy by giving noreg as the temp for as_Address
@@ -3052,7 +3052,7 @@
   CodeStub* stub = op->stub();
   int flags = op->flags();
   BasicType basic_type = default_type != NULL ? default_type->element_type()->basic_type() : T_ILLEGAL;
-  if (basic_type == T_ARRAY) basic_type = T_OBJECT;
+  if (is_reference_type(basic_type)) basic_type = T_OBJECT;
 
   // if we don't know anything, just go through the generic arraycopy
   if (default_type == NULL) {
--- a/src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -671,7 +671,7 @@
 
 LIR_Opr LIRGenerator::atomic_cmpxchg(BasicType type, LIR_Opr addr, LIRItem& cmp_value, LIRItem& new_value) {
   LIR_Opr ill = LIR_OprFact::illegalOpr;  // for convenience
-  if (type == T_OBJECT || type == T_ARRAY) {
+  if (is_reference_type(type)) {
     cmp_value.load_item_force(FrameMap::rax_oop_opr);
     new_value.load_item();
     __ cas_obj(addr->as_address_ptr()->base(), cmp_value.result(), new_value.result(), ill, ill);
@@ -693,7 +693,7 @@
 }
 
 LIR_Opr LIRGenerator::atomic_xchg(BasicType type, LIR_Opr addr, LIRItem& value) {
-  bool is_oop = type == T_OBJECT || type == T_ARRAY;
+  bool is_oop = is_reference_type(type);
   LIR_Opr result = new_register(type);
   value.load_item();
   // Because we want a 2-arg form of xchg and xadd
--- a/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -118,7 +118,7 @@
 
 void G1BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
                                     Register dst, Address src, Register tmp1, Register tmp_thread) {
-  bool on_oop = type == T_OBJECT || type == T_ARRAY;
+  bool on_oop = is_reference_type(type);
   bool on_weak = (decorators & ON_WEAK_OOP_REF) != 0;
   bool on_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
   bool on_reference = on_weak || on_phantom;
--- a/src/hotspot/cpu/x86/gc/shared/modRefBarrierSetAssembler_x86.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/x86/gc/shared/modRefBarrierSetAssembler_x86.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -34,7 +34,7 @@
   bool disjoint = (decorators & ARRAYCOPY_DISJOINT) != 0;
   bool obj_int = type == T_OBJECT LP64_ONLY(&& UseCompressedOops);
 
-  if (type == T_OBJECT || type == T_ARRAY) {
+  if (is_reference_type(type)) {
 #ifdef _LP64
     if (!checkcast) {
       if (!obj_int) {
@@ -61,7 +61,7 @@
   bool obj_int = type == T_OBJECT LP64_ONLY(&& UseCompressedOops);
   Register tmp = rax;
 
-  if (type == T_OBJECT || type == T_ARRAY) {
+  if (is_reference_type(type)) {
 #ifdef _LP64
     if (!checkcast) {
       if (!obj_int) {
@@ -85,7 +85,7 @@
 
 void ModRefBarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
                                          Address dst, Register val, Register tmp1, Register tmp2) {
-  if (type == T_OBJECT || type == T_ARRAY) {
+  if (is_reference_type(type)) {
     oop_store_at(masm, decorators, type, dst, val, tmp1, tmp2);
   } else {
     BarrierSetAssembler::store_at(masm, decorators, type, dst, val, tmp1, tmp2);
--- a/src/hotspot/cpu/x86/gc/shenandoah/c1/shenandoahBarrierSetC1_x86.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/x86/gc/shenandoah/c1/shenandoahBarrierSetC1_x86.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -106,7 +106,7 @@
   // Because we want a 2-arg form of xchg and xadd
   __ move(value_opr, result);
 
-  assert(type == T_INT || type == T_OBJECT || type == T_ARRAY LP64_ONLY( || type == T_LONG ), "unexpected type");
+  assert(type == T_INT || is_reference_type(type) LP64_ONLY( || type == T_LONG ), "unexpected type");
   __ xchg(access.resolved_addr(), result, result, LIR_OprFact::illegalOpr);
 
   if (access.is_oop()) {
--- a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -49,7 +49,7 @@
 
   bool dest_uninitialized = (decorators & IS_DEST_UNINITIALIZED) != 0;
 
-  if (type == T_OBJECT || type == T_ARRAY) {
+  if (is_reference_type(type)) {
 
     if ((ShenandoahSATBBarrier && !dest_uninitialized) || ShenandoahLoadRefBarrier) {
 #ifdef _LP64
@@ -461,22 +461,18 @@
 
 void ShenandoahBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
              Register dst, Address src, Register tmp1, Register tmp_thread) {
-  bool on_oop = type == T_OBJECT || type == T_ARRAY;
+  bool on_oop = is_reference_type(type);
   bool on_weak = (decorators & ON_WEAK_OOP_REF) != 0;
   bool on_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
   bool not_in_heap = (decorators & IN_NATIVE) != 0;
   bool on_reference = on_weak || on_phantom;
-  bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0;
+  bool is_traversal_mode = ShenandoahHeap::heap()->is_traversal_mode();
+  bool keep_alive = ((decorators & AS_NO_KEEPALIVE) == 0) || is_traversal_mode;
 
   BarrierSetAssembler::load_at(masm, decorators, type, dst, src, tmp1, tmp_thread);
   if (on_oop) {
-    if (not_in_heap) {
-      if (ShenandoahHeap::heap()->is_traversal_mode()) {
-        load_reference_barrier(masm, dst);
-        keep_alive = true;
-      } else {
-        load_reference_barrier_native(masm, dst);
-      }
+    if (not_in_heap && !is_traversal_mode) {
+      load_reference_barrier_native(masm, dst);
     } else {
       load_reference_barrier(masm, dst);
     }
@@ -501,7 +497,7 @@
 void ShenandoahBarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
               Address dst, Register val, Register tmp1, Register tmp2) {
 
-  bool on_oop = type == T_OBJECT || type == T_ARRAY;
+  bool on_oop = is_reference_type(type);
   bool in_heap = (decorators & IN_HEAP) != 0;
   bool as_normal = (decorators & AS_NORMAL) != 0;
   if (on_oop && in_heap) {
--- a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -198,7 +198,7 @@
   BLOCK_COMMENT("ZBarrierSetAssembler::store_at {");
 
   // Verify oop store
-  if (type == T_OBJECT || type == T_ARRAY) {
+  if (is_reference_type(type)) {
     // Note that src could be noreg, which means we
     // are storing null and can skip verification.
     if (src != noreg) {
--- a/src/hotspot/cpu/x86/gc/z/zGlobals_x86.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/x86/gc/z/zGlobals_x86.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -135,26 +135,6 @@
 //  * 63-48 Fixed (16-bits, always zero)
 //
 
-uintptr_t ZPlatformAddressSpaceStart() {
-  const uintptr_t first_heap_view_address = (uintptr_t)1 << (ZPlatformAddressMetadataShift() + 0);
-  const size_t min_address_offset = 0;
-  return first_heap_view_address + min_address_offset;
-}
-
-uintptr_t ZPlatformAddressSpaceEnd() {
-  const uintptr_t last_heap_view_address = (uintptr_t)1 << (ZPlatformAddressMetadataShift() + 2);
-  const size_t max_address_offset = (size_t)1 << ZPlatformAddressOffsetBits();
-  return last_heap_view_address + max_address_offset;
-}
-
-uintptr_t ZPlatformAddressReservedStart() {
-  return ZPlatformAddressSpaceStart();
-}
-
-uintptr_t ZPlatformAddressReservedEnd() {
-  return ZPlatformAddressSpaceEnd();
-}
-
 uintptr_t ZPlatformAddressBase() {
   return 0;
 }
--- a/src/hotspot/cpu/x86/gc/z/zGlobals_x86.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/x86/gc/z/zGlobals_x86.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -40,10 +40,6 @@
 const size_t ZPlatformNMethodDisarmedOffset = 4;
 const size_t ZPlatformCacheLineSize         = 64;
 
-uintptr_t    ZPlatformAddressSpaceStart();
-uintptr_t    ZPlatformAddressSpaceEnd();
-uintptr_t    ZPlatformAddressReservedStart();
-uintptr_t    ZPlatformAddressReservedEnd();
 uintptr_t    ZPlatformAddressBase();
 size_t       ZPlatformAddressOffsetBits();
 size_t       ZPlatformAddressMetadataShift();
--- a/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -1416,8 +1416,7 @@
   Register temp_reg = rbx;  // not part of any compiled calling seq
   if (VerifyOops) {
     for (int i = 0; i < method->size_of_parameters(); i++) {
-      if (sig_bt[i] == T_OBJECT ||
-          sig_bt[i] == T_ARRAY) {
+      if (is_reference_type(sig_bt[i])) {
         VMReg r = regs[i].first();
         assert(r->is_valid(), "bad oop arg");
         if (r->is_stack()) {
@@ -2218,7 +2217,7 @@
   __ reset_last_Java_frame(thread, false);
 
   // Unbox oop result, e.g. JNIHandles::resolve value.
-  if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
+  if (is_reference_type(ret_type)) {
     __ resolve_jobject(rax /* value */,
                        thread /* thread */,
                        rcx /* tmp */);
--- a/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -1816,8 +1816,7 @@
   Register temp_reg = rbx;  // not part of any compiled calling seq
   if (VerifyOops) {
     for (int i = 0; i < method->size_of_parameters(); i++) {
-      if (sig_bt[i] == T_OBJECT ||
-          sig_bt[i] == T_ARRAY) {
+      if (is_reference_type(sig_bt[i])) {
         VMReg r = regs[i].first();
         assert(r->is_valid(), "bad oop arg");
         if (r->is_stack()) {
@@ -2717,7 +2716,7 @@
   __ reset_last_Java_frame(false);
 
   // Unbox oop result, e.g. JNIHandles::resolve value.
-  if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
+  if (is_reference_type(ret_type)) {
     __ resolve_jobject(rax /* value */,
                        r15_thread /* thread */,
                        rcx /* tmp */);
--- a/src/hotspot/os/aix/os_perf_aix.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/os/aix/os_perf_aix.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -445,9 +445,6 @@
 bool CPUPerformanceInterface::CPUPerformance::initialize() {
   size_t array_entry_count = _counters.nProcs + 1;
   _counters.cpus = NEW_C_HEAP_ARRAY(CPUPerfTicks, array_entry_count, mtInternal);
-  if (NULL == _counters.cpus) {
-    return false;
-  }
   memset(_counters.cpus, 0, array_entry_count * sizeof(*_counters.cpus));
 
   // For the CPU load total
@@ -535,7 +532,7 @@
 
 bool CPUPerformanceInterface::initialize() {
   _impl = new CPUPerformanceInterface::CPUPerformance();
-  return NULL == _impl ? false : _impl->initialize();
+  return _impl->initialize();
 }
 
 CPUPerformanceInterface::~CPUPerformanceInterface() {
@@ -688,19 +685,17 @@
     }
     if (size > 0) {
       cmdline = NEW_C_HEAP_ARRAY(char, size + 1, mtInternal);
-      if (cmdline != NULL) {
-        cmdline[0] = '\0';
-        if (fseek(fp, 0, SEEK_SET) == 0) {
-          if (fread(cmdline, 1, size, fp) == size) {
-            // the file has the arguments separated by '\0',
-            // so we translate '\0' to ' '
-            for (size_t i = 0; i < size; i++) {
-              if (cmdline[i] == '\0') {
-                cmdline[i] = ' ';
-              }
+      cmdline[0] = '\0';
+      if (fseek(fp, 0, SEEK_SET) == 0) {
+        if (fread(cmdline, 1, size, fp) == size) {
+          // the file has the arguments separated by '\0',
+          // so we translate '\0' to ' '
+          for (size_t i = 0; i < size; i++) {
+            if (cmdline[i] == '\0') {
+              cmdline[i] = ' ';
             }
-            cmdline[size] = '\0';
           }
+          cmdline[size] = '\0';
         }
       }
     }
@@ -790,7 +785,7 @@
 
 bool SystemProcessInterface::SystemProcesses::initialize() {
   _iterator = new SystemProcessInterface::SystemProcesses::ProcessIterator();
-  return NULL == _iterator ? false : _iterator->initialize();
+  return _iterator->initialize();
 }
 
 SystemProcessInterface::SystemProcesses::~SystemProcesses() {
@@ -837,7 +832,7 @@
 
 bool SystemProcessInterface::initialize() {
   _impl = new SystemProcessInterface::SystemProcesses();
-  return NULL == _impl ? false : _impl->initialize();
+  return _impl->initialize();
 }
 
 SystemProcessInterface::~SystemProcessInterface() {
@@ -852,15 +847,11 @@
 
 bool CPUInformationInterface::initialize() {
   _cpu_info = new CPUInformation();
-  if (NULL == _cpu_info) {
-    return false;
-  }
   _cpu_info->set_number_of_hardware_threads(VM_Version_Ext::number_of_threads());
   _cpu_info->set_number_of_cores(VM_Version_Ext::number_of_cores());
   _cpu_info->set_number_of_sockets(VM_Version_Ext::number_of_sockets());
   _cpu_info->set_cpu_name(VM_Version_Ext::cpu_name());
   _cpu_info->set_cpu_description(VM_Version_Ext::cpu_description());
-
   return true;
 }
 
@@ -928,7 +919,7 @@
 
 bool NetworkPerformanceInterface::initialize() {
   _impl = new NetworkPerformanceInterface::NetworkPerformance();
-  return _impl != NULL && _impl->initialize();
+  return _impl->initialize();
 }
 
 int NetworkPerformanceInterface::network_utilization(NetworkInterface** network_interfaces) const {
--- a/src/hotspot/os/bsd/os_bsd.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/os/bsd/os_bsd.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -136,8 +136,6 @@
 static sigset_t check_signal_done;
 static bool check_signals = true;
 
-static pid_t _initial_pid = 0;
-
 // Signal number used to suspend/resume a thread
 
 // do not use any signal number less than SIGSEGV, see 4355769
@@ -1124,24 +1122,7 @@
 }
 
 int os::current_process_id() {
-
-  // Under the old bsd thread library, bsd gives each thread
-  // its own process id. Because of this each thread will return
-  // a different pid if this method were to return the result
-  // of getpid(2). Bsd provides no api that returns the pid
-  // of the launcher thread for the vm. This implementation
-  // returns a unique pid, the pid of the launcher thread
-  // that starts the vm 'process'.
-
-  // Under the NPTL, getpid() returns the same pid as the
-  // launcher thread rather than a unique pid per thread.
-  // Use gettid() if you want the old pre NPTL behaviour.
-
-  // if you are looking for the result of a call to getpid() that
-  // returns a unique pid for the calling thread, then look at the
-  // OSThread::thread_id() method in osThread_bsd.hpp file
-
-  return (int)(_initial_pid ? _initial_pid : getpid());
+  return (int)(getpid());
 }
 
 // DLL functions
@@ -3087,16 +3068,6 @@
 void os::init(void) {
   char dummy;   // used to get a guess on initial stack address
 
-  // With BsdThreads the JavaMain thread pid (primordial thread)
-  // is different than the pid of the java launcher thread.
-  // So, on Bsd, the launcher thread pid is passed to the VM
-  // via the sun.java.launcher.pid property.
-  // Use this property instead of getpid() if it was correctly passed.
-  // See bug 6351349.
-  pid_t java_launcher_pid = (pid_t) Arguments::sun_java_launcher_pid();
-
-  _initial_pid = (java_launcher_pid > 0) ? java_launcher_pid : getpid();
-
   clock_tics_per_sec = CLK_TCK;
 
   init_random(1234567);
--- a/src/hotspot/os/bsd/os_perf_bsd.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/os/bsd/os_perf_bsd.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -234,7 +234,7 @@
 
 bool CPUPerformanceInterface::initialize() {
   _impl = new CPUPerformanceInterface::CPUPerformance();
-  return _impl != NULL && _impl->initialize();
+  return _impl->initialize();
 }
 
 CPUPerformanceInterface::~CPUPerformanceInterface() {
@@ -355,7 +355,7 @@
 
 bool SystemProcessInterface::initialize() {
   _impl = new SystemProcessInterface::SystemProcesses();
-  return _impl != NULL && _impl->initialize();
+  return _impl->initialize();
 }
 
 SystemProcessInterface::~SystemProcessInterface() {
@@ -370,16 +370,11 @@
 
 bool CPUInformationInterface::initialize() {
   _cpu_info = new CPUInformation();
-
-  if (NULL == _cpu_info) {
-    return false;
-  }
   _cpu_info->set_number_of_hardware_threads(VM_Version_Ext::number_of_threads());
   _cpu_info->set_number_of_cores(VM_Version_Ext::number_of_cores());
   _cpu_info->set_number_of_sockets(VM_Version_Ext::number_of_sockets());
   _cpu_info->set_cpu_name(VM_Version_Ext::cpu_name());
   _cpu_info->set_cpu_description(VM_Version_Ext::cpu_description());
-
   return true;
 }
 
@@ -483,7 +478,7 @@
 
 bool NetworkPerformanceInterface::initialize() {
   _impl = new NetworkPerformanceInterface::NetworkPerformance();
-  return _impl != NULL && _impl->initialize();
+  return _impl->initialize();
 }
 
 int NetworkPerformanceInterface::network_utilization(NetworkInterface** network_interfaces) const {
--- a/src/hotspot/os/linux/gc/z/zVirtualMemory_linux.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "precompiled.hpp"
-#include "gc/z/zVirtualMemory.hpp"
-#include "logging/log.hpp"
-
-#include <sys/mman.h>
-#include <sys/types.h>
-
-bool ZVirtualMemoryManager::reserve(uintptr_t start, size_t size) {
-  // Reserve address space
-  const uintptr_t actual_start = (uintptr_t)mmap((void*)start, size, PROT_NONE,
-                                                 MAP_ANONYMOUS|MAP_PRIVATE|MAP_NORESERVE, -1, 0);
-  if (actual_start != start) {
-    log_error(gc)("Failed to reserve address space for Java heap");
-    return false;
-  }
-
-  return true;
-}
--- a/src/hotspot/os/linux/os_perf_linux.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/os/linux/os_perf_linux.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -505,9 +505,6 @@
 bool CPUPerformanceInterface::CPUPerformance::initialize() {
   size_t array_entry_count = _counters.nProcs + 1;
   _counters.cpus = NEW_C_HEAP_ARRAY(os::Linux::CPUPerfTicks, array_entry_count, mtInternal);
-  if (NULL == _counters.cpus) {
-    return false;
-  }
   memset(_counters.cpus, 0, array_entry_count * sizeof(*_counters.cpus));
 
   // For the CPU load total
@@ -595,7 +592,7 @@
 
 bool CPUPerformanceInterface::initialize() {
   _impl = new CPUPerformanceInterface::CPUPerformance();
-  return NULL == _impl ? false : _impl->initialize();
+  return _impl->initialize();
 }
 
 CPUPerformanceInterface::~CPUPerformanceInterface() {
@@ -748,19 +745,17 @@
     }
     if (size > 0) {
       cmdline = NEW_C_HEAP_ARRAY(char, size + 1, mtInternal);
-      if (cmdline != NULL) {
-        cmdline[0] = '\0';
-        if (fseek(fp, 0, SEEK_SET) == 0) {
-          if (fread(cmdline, 1, size, fp) == size) {
-            // the file has the arguments separated by '\0',
-            // so we translate '\0' to ' '
-            for (size_t i = 0; i < size; i++) {
-              if (cmdline[i] == '\0') {
-                cmdline[i] = ' ';
-              }
+      cmdline[0] = '\0';
+      if (fseek(fp, 0, SEEK_SET) == 0) {
+        if (fread(cmdline, 1, size, fp) == size) {
+          // the file has the arguments separated by '\0',
+          // so we translate '\0' to ' '
+          for (size_t i = 0; i < size; i++) {
+            if (cmdline[i] == '\0') {
+              cmdline[i] = ' ';
             }
-            cmdline[size] = '\0';
           }
+          cmdline[size] = '\0';
         }
       }
     }
@@ -854,7 +849,7 @@
 
 bool SystemProcessInterface::SystemProcesses::initialize() {
   _iterator = new SystemProcessInterface::SystemProcesses::ProcessIterator();
-  return NULL == _iterator ? false : _iterator->initialize();
+  return _iterator->initialize();
 }
 
 SystemProcessInterface::SystemProcesses::~SystemProcesses() {
@@ -901,7 +896,7 @@
 
 bool SystemProcessInterface::initialize() {
   _impl = new SystemProcessInterface::SystemProcesses();
-  return NULL == _impl ? false : _impl->initialize();
+  return _impl->initialize();
 }
 
 SystemProcessInterface::~SystemProcessInterface() {
@@ -916,15 +911,11 @@
 
 bool CPUInformationInterface::initialize() {
   _cpu_info = new CPUInformation();
-  if (NULL == _cpu_info) {
-    return false;
-  }
   _cpu_info->set_number_of_hardware_threads(VM_Version_Ext::number_of_threads());
   _cpu_info->set_number_of_cores(VM_Version_Ext::number_of_cores());
   _cpu_info->set_number_of_sockets(VM_Version_Ext::number_of_sockets());
   _cpu_info->set_cpu_name(VM_Version_Ext::cpu_name());
   _cpu_info->set_cpu_description(VM_Version_Ext::cpu_description());
-
   return true;
 }
 
@@ -1038,7 +1029,7 @@
 
 bool NetworkPerformanceInterface::initialize() {
   _impl = new NetworkPerformanceInterface::NetworkPerformance();
-  return _impl != NULL && _impl->initialize();
+  return _impl->initialize();
 }
 
 int NetworkPerformanceInterface::network_utilization(NetworkInterface** network_interfaces) const {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/os/posix/gc/z/zVirtualMemory_posix.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,81 @@
+/*
+ * 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.
+ */
+
+#include "precompiled.hpp"
+#include "gc/z/zAddress.inline.hpp"
+#include "gc/z/zVirtualMemory.hpp"
+#include "logging/log.hpp"
+
+#include <sys/mman.h>
+#include <sys/types.h>
+
+static void unmap(uintptr_t start, size_t size) {
+  const int res = munmap((void*)start, size);
+  assert(res == 0, "Failed to unmap memory");
+}
+
+static bool map(uintptr_t start, size_t size) {
+  const void* const res = mmap((void*)start, size, PROT_NONE, MAP_ANONYMOUS|MAP_PRIVATE|MAP_NORESERVE, -1, 0);
+  if (res == MAP_FAILED) {
+    // Failed to reserve memory
+    return false;
+  }
+
+  if ((uintptr_t)res != start) {
+    // Failed to reserve memory at the requested address
+    unmap(start, size);
+    return false;
+  }
+
+  // Success
+  return true;
+}
+
+bool ZVirtualMemoryManager::reserve_platform(uintptr_t start, size_t size) {
+  // Reserve address views
+  const uintptr_t marked0 = ZAddress::marked0(start);
+  const uintptr_t marked1 = ZAddress::marked1(start);
+  const uintptr_t remapped = ZAddress::remapped(start);
+
+  if (!map(marked0, size)) {
+    return false;
+  }
+
+  if (!map(marked1, size)) {
+    unmap(marked0, size);
+    return false;
+  }
+
+  if (!map(remapped, size)) {
+    unmap(marked0, size);
+    unmap(marked1, size);
+    return false;
+  }
+
+  // Register address views with native memory tracker
+  nmt_reserve(marked0, size);
+  nmt_reserve(marked1, size);
+  nmt_reserve(remapped, size);
+
+  return true;
+}
--- a/src/hotspot/os/solaris/os_perf_solaris.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/os/solaris/os_perf_solaris.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -302,9 +302,6 @@
   // Data structure(s) for saving CPU load (one per CPU)
   size_t array_entry_count = _counters.nProcs;
   _counters.jvmTicks = NEW_C_HEAP_ARRAY(CPUPerfTicks, array_entry_count, mtInternal);
-  if (NULL == _counters.jvmTicks) {
-    return false;
-  }
   memset(_counters.jvmTicks, 0, array_entry_count * sizeof(*_counters.jvmTicks));
 
   // Get kstat cpu_stat counters for every CPU
@@ -432,7 +429,7 @@
 
 bool CPUPerformanceInterface::initialize() {
   _impl = new CPUPerformanceInterface::CPUPerformance();
-  return _impl != NULL && _impl->initialize();
+  return _impl->initialize();
 }
 
 CPUPerformanceInterface::~CPUPerformanceInterface(void) {
@@ -574,10 +571,8 @@
     if (path_substring != NULL) {
       int len = path_substring - psinfo_data.pr_psargs;
       exe_path = NEW_C_HEAP_ARRAY(char, len+1, mtInternal);
-      if (exe_path != NULL) {
-        jio_snprintf(exe_path, len, "%s", psinfo_data.pr_psargs);
-        exe_path[len] = '\0';
-      }
+      jio_snprintf(exe_path, len, "%s", psinfo_data.pr_psargs);
+      exe_path[len] = '\0';
     }
   }
 
@@ -642,7 +637,7 @@
 
 bool SystemProcessInterface::SystemProcesses::initialize() {
   _iterator = new SystemProcessInterface::SystemProcesses::ProcessIterator();
-  return _iterator != NULL && _iterator->initialize();
+  return _iterator->initialize();
 }
 
 SystemProcessInterface::SystemProcesses::~SystemProcesses() {
@@ -689,7 +684,7 @@
 
 bool SystemProcessInterface::initialize() {
   _impl = new SystemProcessInterface::SystemProcesses();
-  return _impl != NULL && _impl->initialize();
+  return _impl->initialize();
 
 }
 
@@ -705,9 +700,6 @@
 
 bool CPUInformationInterface::initialize() {
   _cpu_info = new CPUInformation();
-  if (_cpu_info == NULL) {
-    return false;
-  }
   _cpu_info->set_number_of_hardware_threads(VM_Version_Ext::number_of_threads());
   _cpu_info->set_number_of_cores(VM_Version_Ext::number_of_cores());
   _cpu_info->set_number_of_sockets(VM_Version_Ext::number_of_sockets());
@@ -820,7 +812,7 @@
 
 bool NetworkPerformanceInterface::initialize() {
   _impl = new NetworkPerformanceInterface::NetworkPerformance();
-  return _impl != NULL && _impl->initialize();
+  return _impl->initialize();
 }
 
 int NetworkPerformanceInterface::network_utilization(NetworkInterface** network_interfaces) const {
--- a/src/hotspot/os/windows/os_perf_windows.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/os/windows/os_perf_windows.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -194,34 +194,27 @@
   return open_query(&query->query);
 }
 
-static int allocate_counters(MultiCounterQueryP query, size_t nofCounters) {
+static void allocate_counters(MultiCounterQueryP query, size_t nofCounters) {
   assert(query != NULL, "invariant");
   assert(!query->initialized, "invariant");
   assert(0 == query->noOfCounters, "invariant");
   assert(query->counters == NULL, "invariant");
   query->counters = NEW_C_HEAP_ARRAY(HCOUNTER, nofCounters, mtInternal);
-  if (query->counters == NULL) {
-    return OS_ERR;
-  }
   memset(query->counters, 0, nofCounters * sizeof(HCOUNTER));
   query->noOfCounters = (int)nofCounters;
-  return OS_OK;
 }
 
-static int allocate_counters(MultiCounterQuerySetP query_set, size_t nofCounters) {
+static void allocate_counters(MultiCounterQuerySetP query_set, size_t nofCounters) {
   assert(query_set != NULL, "invariant");
   assert(!query_set->initialized, "invariant");
   for (int i = 0; i < query_set->size; ++i) {
-    if (allocate_counters(&query_set->queries[i], nofCounters) != OS_OK) {
-      return OS_ERR;
-    }
+    allocate_counters(&query_set->queries[i], nofCounters);
   }
-  return OS_OK;
 }
 
-static int allocate_counters(ProcessQueryP process_query, size_t nofCounters) {
+static void allocate_counters(ProcessQueryP process_query, size_t nofCounters) {
   assert(process_query != NULL, "invariant");
-  return allocate_counters(&process_query->set, nofCounters);
+  allocate_counters(&process_query->set, nofCounters);
 }
 
 static void deallocate_counters(MultiCounterQueryP query) {
@@ -600,7 +593,7 @@
 static const char* copy_string_to_c_heap(const char* string) {
   assert(string != NULL, "invariant");
   const size_t len = strlen(string);
-  char* const cheap_allocated_string = NEW_C_HEAP_ARRAY(char, len + 1, mtInternal);
+  char* const cheap_allocated_string = NEW_C_HEAP_ARRAY_RETURN_NULL(char, len + 1, mtInternal);
   if (NULL == cheap_allocated_string) {
     return NULL;
   }
@@ -849,9 +842,7 @@
   const int logical_cpu_count = number_of_logical_cpus();
   assert(logical_cpu_count >= os::processor_count(), "invariant");
   // we also add another counter for instance "_Total"
-  if (allocate_counters(cpu_query, logical_cpu_count + 1) != OS_OK) {
-    return OS_ERR;
-  }
+  allocate_counters(cpu_query, logical_cpu_count + 1);
   assert(cpu_query->noOfCounters == logical_cpu_count + 1, "invariant");
   return initialize_cpu_query_counters(cpu_query, pdh_counter_idx);
 }
@@ -1017,9 +1008,7 @@
   if (_process_cpu_load == NULL) {
     return true;
   }
-  if (allocate_counters(_process_cpu_load, 2) != OS_OK) {
-    return true;
-  }
+  allocate_counters(_process_cpu_load, 2);
   if (initialize_process_counter(_process_cpu_load, 0, PDH_PROCESSOR_TIME_IDX) != OS_OK) {
     return true;
   }
@@ -1057,7 +1046,7 @@
 
 bool CPUPerformanceInterface::initialize() {
   _impl = new CPUPerformanceInterface::CPUPerformance();
-  return _impl != NULL && _impl->initialize();
+  return _impl->initialize();
 }
 
 CPUPerformanceInterface::~CPUPerformanceInterface() {
@@ -1263,7 +1252,7 @@
 
 bool SystemProcessInterface::SystemProcesses::initialize() {
   _iterator = new SystemProcessInterface::SystemProcesses::ProcessIterator();
-  return _iterator != NULL && _iterator->initialize();
+  return _iterator->initialize();
 }
 
 SystemProcessInterface::SystemProcesses::~SystemProcesses() {
@@ -1318,7 +1307,7 @@
 
 bool SystemProcessInterface::initialize() {
   _impl = new SystemProcessInterface::SystemProcesses();
-  return _impl != NULL && _impl->initialize();
+  return _impl->initialize();
 }
 
 SystemProcessInterface::~SystemProcessInterface() {
@@ -1333,9 +1322,6 @@
 
 bool CPUInformationInterface::initialize() {
   _cpu_info = new CPUInformation();
-  if (NULL == _cpu_info) {
-    return false;
-  }
   _cpu_info->set_number_of_hardware_threads(VM_Version_Ext::number_of_threads());
   _cpu_info->set_number_of_cores(VM_Version_Ext::number_of_cores());
   _cpu_info->set_number_of_sockets(VM_Version_Ext::number_of_sockets());
@@ -1431,7 +1417,7 @@
 
 bool NetworkPerformanceInterface::initialize() {
   _impl = new NetworkPerformanceInterface::NetworkPerformance();
-  return _impl != NULL && _impl->initialize();
+  return _impl->initialize();
 }
 
 int NetworkPerformanceInterface::network_utilization(NetworkInterface** network_interfaces) const {
--- a/src/hotspot/os/windows/os_windows.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/os/windows/os_windows.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -224,18 +224,12 @@
     }
 
     home_path = NEW_C_HEAP_ARRAY(char, strlen(home_dir) + 1, mtInternal);
-    if (home_path == NULL) {
-      return;
-    }
     strcpy(home_path, home_dir);
     Arguments::set_java_home(home_path);
     FREE_C_HEAP_ARRAY(char, home_path);
 
     dll_path = NEW_C_HEAP_ARRAY(char, strlen(home_dir) + strlen(bin) + 1,
                                 mtInternal);
-    if (dll_path == NULL) {
-      return;
-    }
     strcpy(dll_path, home_dir);
     strcat(dll_path, bin);
     Arguments::set_dll_dir(dll_path);
--- a/src/hotspot/share/aot/aotCodeHeap.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/aot/aotCodeHeap.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -401,9 +401,6 @@
     int len = Bytes::get_Java_u2((address)stub_name);
     stub_name += 2;
     char* full_name = NEW_C_HEAP_ARRAY(char, len+5, mtCode);
-    if (full_name == NULL) { // No memory?
-      break;
-    }
     memcpy(full_name, "AOT ", 4);
     memcpy(full_name+4, stub_name, len);
     full_name[len+4] = 0;
--- a/src/hotspot/share/aot/aotLoader.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/aot/aotLoader.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -151,17 +151,15 @@
     if (AOTLibrary != NULL) {
       const int len = (int)strlen(AOTLibrary);
       char* cp  = NEW_C_HEAP_ARRAY(char, len+1, mtCode);
-      if (cp != NULL) { // No memory?
-        memcpy(cp, AOTLibrary, len);
-        cp[len] = '\0';
-        char* end = cp + len;
-        while (cp < end) {
-          const char* name = cp;
-          while ((*cp) != '\0' && (*cp) != '\n' && (*cp) != ',' && (*cp) != pathSep) cp++;
-          cp[0] = '\0';  // Terminate name
-          cp++;
-          load_library(name, true);
-        }
+      memcpy(cp, AOTLibrary, len);
+      cp[len] = '\0';
+      char* end = cp + len;
+      while (cp < end) {
+        const char* name = cp;
+        while ((*cp) != '\0' && (*cp) != '\n' && (*cp) != ',' && (*cp) != pathSep) cp++;
+        cp[0] = '\0';  // Terminate name
+        cp++;
+        load_library(name, true);
       }
     }
 
--- a/src/hotspot/share/asm/codeBuffer.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/asm/codeBuffer.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -1104,7 +1104,7 @@
 // Convenience for add_comment.
 CodeString* CodeStrings::find_last(intptr_t offset) const {
   CodeString* a = _strings_last;
-  while (a != NULL && !a->is_comment() && a->offset() > offset) {
+  while (a != NULL && !(a->is_comment() && a->offset() == offset)) {
     a = a->_prev;
   }
   return a;
--- a/src/hotspot/share/c1/c1_GraphBuilder.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/c1/c1_GraphBuilder.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -3168,7 +3168,7 @@
     ciType* type = sig->type_at(i);
     BasicType basic_type = type->basic_type();
     // don't allow T_ARRAY to propagate into locals types
-    if (basic_type == T_ARRAY) basic_type = T_OBJECT;
+    if (is_reference_type(basic_type)) basic_type = T_OBJECT;
     ValueType* vt = as_ValueType(basic_type);
     state->store_local(idx, new Local(type, vt, idx, false));
     idx += type->size();
--- a/src/hotspot/share/c1/c1_LIRGenerator.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/c1/c1_LIRGenerator.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -1546,7 +1546,7 @@
   assert(x->is_pinned(),"");
   bool needs_range_check = x->compute_needs_range_check();
   bool use_length = x->length() != NULL;
-  bool obj_store = x->elt_type() == T_ARRAY || x->elt_type() == T_OBJECT;
+  bool obj_store = is_reference_type(x->elt_type());
   bool needs_store_check = obj_store && (x->value()->as_Constant() == NULL ||
                                          !get_jobject_constant(x->value())->is_null_object() ||
                                          x->should_profile());
@@ -2163,7 +2163,7 @@
   if (type == T_BOOLEAN) {
     decorators |= C1_MASK_BOOLEAN;
   }
-  if (type == T_ARRAY || type == T_OBJECT) {
+  if (is_reference_type(type)) {
     decorators |= ON_UNKNOWN_OOP_REF;
   }
 
@@ -2190,7 +2190,7 @@
   set_no_result(x);
 
   DecoratorSet decorators = IN_HEAP | C1_UNSAFE_ACCESS;
-  if (type == T_ARRAY || type == T_OBJECT) {
+  if (is_reference_type(type)) {
     decorators |= ON_UNKNOWN_OOP_REF;
   }
   if (x->is_volatile()) {
@@ -2207,7 +2207,7 @@
 
   DecoratorSet decorators = IN_HEAP | C1_UNSAFE_ACCESS | MO_SEQ_CST;
 
-  if (type == T_ARRAY || type == T_OBJECT) {
+  if (is_reference_type(type)) {
     decorators |= ON_UNKNOWN_OOP_REF;
   }
 
@@ -2600,7 +2600,7 @@
         LIR_Opr src = args->at(i);
         assert(!src->is_illegal(), "check");
         BasicType t = src->type();
-        if (t == T_OBJECT || t == T_ARRAY) {
+        if (is_reference_type(t)) {
           intptr_t profiled_k = parameters->type(j);
           Local* local = x->state()->local_at(java_index)->as_Local();
           ciKlass* exact = profile_type(md, md->byte_offset_of_slot(parameters_type_data, ParametersTypeData::type_offset(0)),
--- a/src/hotspot/share/c1/c1_Optimizer.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/c1/c1_Optimizer.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2017, 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
@@ -868,7 +868,7 @@
       if (field->is_constant()) {
         ciConstant field_val = field->constant_value();
         BasicType field_type = field_val.basic_type();
-        if (field_type == T_OBJECT || field_type == T_ARRAY) {
+        if (is_reference_type(field_type)) {
           ciObject* obj_val = field_val.as_object();
           if (!obj_val->is_null_object()) {
             if (PrintNullCheckElimination) {
--- a/src/hotspot/share/ci/bcEscapeAnalyzer.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/ci/bcEscapeAnalyzer.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -859,7 +859,7 @@
           if (s.cur_bc() != Bytecodes::_getstatic) {
             set_method_escape(state.apop());
           }
-          if (field_type == T_OBJECT || field_type == T_ARRAY) {
+          if (is_reference_type(field_type)) {
             state.apush(unknown_obj);
           } else if (type2size[field_type] == 1) {
             state.spush();
@@ -873,7 +873,7 @@
         { bool will_link;
           ciField* field = s.get_field(will_link);
           BasicType field_type = field->type()->basic_type();
-          if (field_type == T_OBJECT || field_type == T_ARRAY) {
+          if (is_reference_type(field_type)) {
             set_global_escape(state.apop());
           } else if (type2size[field_type] == 1) {
             state.spop();
--- a/src/hotspot/share/ci/ciArray.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/ci/ciArray.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2017, 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
@@ -37,7 +37,7 @@
 // This class represents an arrayOop in the HotSpot virtual
 // machine.
 static BasicType fixup_element_type(BasicType bt) {
-  if (bt == T_ARRAY)    return T_OBJECT;
+  if (is_reference_type(bt))  return T_OBJECT;
   if (bt == T_BOOLEAN)  return T_BYTE;
   return bt;
 }
--- a/src/hotspot/share/ci/ciConstant.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/ci/ciConstant.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, 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
@@ -56,12 +56,12 @@
   case T_DOUBLE:
     tty->print("%lf", _value._double);
     break;
-  case T_OBJECT:
-  case T_ARRAY:
-    _value._object->print();
-    break;
   default:
-    tty->print("ILLEGAL");
+    if (is_reference_type(basic_type())) {
+      _value._object->print();
+    } else {
+      tty->print("ILLEGAL");
+    }
     break;
   }
   tty->print(">");
--- a/src/hotspot/share/ci/ciConstant.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/ci/ciConstant.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -106,7 +106,7 @@
     return _value._double;
   }
   ciObject* as_object() const {
-    assert(basic_type() == T_OBJECT || basic_type() == T_ARRAY, "wrong type");
+    assert(is_reference_type(basic_type()), "wrong type");
     return _value._object;
   }
 
--- a/src/hotspot/share/ci/ciField.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/ci/ciField.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -90,7 +90,7 @@
 
   // If the field is a pointer type, get the klass of the
   // field.
-  if (field_type == T_OBJECT || field_type == T_ARRAY) {
+  if (is_reference_type(field_type)) {
     bool ignore;
     // This is not really a class reference; the index always refers to the
     // field's type signature, as a symbol.  Linkage checks do not apply.
@@ -199,7 +199,7 @@
 
   // If the field is a pointer type, get the klass of the
   // field.
-  if (field_type == T_OBJECT || field_type == T_ARRAY) {
+  if (is_reference_type(field_type)) {
     _type = NULL;  // must call compute_type on first access
   } else {
     _type = ciType::make(field_type);
--- a/src/hotspot/share/ci/ciMethod.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/ci/ciMethod.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -1454,8 +1454,8 @@
 // ------------------------------------------------------------------
 
 static BasicType erase_to_word_type(BasicType bt) {
-  if (is_subword_type(bt)) return T_INT;
-  if (bt == T_ARRAY)       return T_OBJECT;
+  if (is_subword_type(bt))   return T_INT;
+  if (is_reference_type(bt)) return T_OBJECT;
   return bt;
 }
 
--- a/src/hotspot/share/ci/ciObjectFactory.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/ci/ciObjectFactory.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -149,7 +149,8 @@
 
   for (int i = T_BOOLEAN; i <= T_CONFLICT; i++) {
     BasicType t = (BasicType)i;
-    if (type2name(t) != NULL && t != T_OBJECT && t != T_ARRAY && t != T_NARROWOOP && t != T_NARROWKLASS) {
+    if (type2name(t) != NULL && !is_reference_type(t) &&
+        t != T_NARROWOOP && t != T_NARROWKLASS) {
       ciType::_basic_types[t] = new (_arena) ciType(t);
       init_ident_of(ciType::_basic_types[t]);
     }
--- a/src/hotspot/share/ci/ciType.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/ci/ciType.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -35,8 +35,7 @@
 
 // ciType
 //
-// This class represents either a class (T_OBJECT), array (T_ARRAY),
-// or one of the primitive types such as T_INT.
+// This class represents a Java reference or primitive type.
 
 // ------------------------------------------------------------------
 // ciType::ciType
--- a/src/hotspot/share/ci/ciType.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/ci/ciType.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -29,8 +29,8 @@
 
 // ciType
 //
-// This class represents either a class (T_OBJECT), array (T_ARRAY),
-// or one of the primitive types such as T_INT.
+// This class represents a Java reference or primitive type.
+
 class ciType : public ciMetadata {
   CI_PACKAGE_ACCESS
   friend class ciKlass;
@@ -67,7 +67,7 @@
   ciKlass*  box_klass();
 
   // Returns true if this is not a klass or array (i.e., not a reference type).
-  bool is_primitive_type() const            { return basic_type() != T_OBJECT && basic_type() != T_ARRAY; }
+  bool is_primitive_type() const            { return !is_reference_type(basic_type()); }
   int size() const                          { return type2size[basic_type()]; }
   bool is_void() const                      { return basic_type() == T_VOID; }
   bool is_one_word() const                  { return size() == 1; }
--- a/src/hotspot/share/ci/ciTypeFlow.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/ci/ciTypeFlow.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -729,7 +729,7 @@
     outer()->record_failure("ldc did not link");
     return;
   }
-  if (basic_type == T_OBJECT || basic_type == T_ARRAY) {
+  if (is_reference_type(basic_type)) {
     ciObject* obj = con.as_object();
     if (obj->is_null_object()) {
       push_null();
--- a/src/hotspot/share/classfile/bytecodeAssembler.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/classfile/bytecodeAssembler.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2017, 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
@@ -187,9 +187,11 @@
     case T_FLOAT:   fload(index); break;
     case T_DOUBLE:  dload(index); break;
     case T_LONG:    lload(index); break;
-    case T_OBJECT:
-    case T_ARRAY:   aload(index); break;
     default:
+      if (is_reference_type(bt)) {
+                    aload(index);
+                    break;
+      }
       ShouldNotReachHere();
   }
 }
@@ -254,10 +256,12 @@
     case T_FLOAT:   freturn(); break;
     case T_DOUBLE:  dreturn(); break;
     case T_LONG:    lreturn(); break;
-    case T_OBJECT:
-    case T_ARRAY:   areturn(); break;
     case T_VOID:    _return(); break;
     default:
+      if (is_reference_type(bt)) {
+                    areturn();
+                    break;
+      }
       ShouldNotReachHere();
   }
 }
--- a/src/hotspot/share/classfile/classLoaderDataGraph.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/classfile/classLoaderDataGraph.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -285,17 +285,27 @@
   }
 }
 
-// Closure for locking and iterating through classes.
-LockedClassesDo::LockedClassesDo(classes_do_func_t f) : _function(f) {
-  ClassLoaderDataGraph_lock->lock();
+// Closure for locking and iterating through classes. Only lock outside of safepoint.
+LockedClassesDo::LockedClassesDo(classes_do_func_t f) : _function(f),
+  _do_lock(!SafepointSynchronize::is_at_safepoint()) {
+  if (_do_lock) {
+    ClassLoaderDataGraph_lock->lock();
+  }
 }
 
-LockedClassesDo::LockedClassesDo() : _function(NULL) {
+LockedClassesDo::LockedClassesDo() : _function(NULL),
+  _do_lock(!SafepointSynchronize::is_at_safepoint()) {
   // callers provide their own do_klass
-  ClassLoaderDataGraph_lock->lock();
+  if (_do_lock) {
+    ClassLoaderDataGraph_lock->lock();
+  }
 }
 
-LockedClassesDo::~LockedClassesDo() { ClassLoaderDataGraph_lock->unlock(); }
+LockedClassesDo::~LockedClassesDo() {
+  if (_do_lock) {
+    ClassLoaderDataGraph_lock->unlock();
+  }
+}
 
 
 // Iterating over the CLDG needs to be locked because
--- a/src/hotspot/share/classfile/classLoaderDataGraph.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/classfile/classLoaderDataGraph.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -156,6 +156,7 @@
 class LockedClassesDo : public KlassClosure {
   typedef void (*classes_do_func_t)(Klass*);
   classes_do_func_t _function;
+  bool _do_lock;
 public:
   LockedClassesDo();  // For callers who provide their own do_klass
   LockedClassesDo(classes_do_func_t function);
--- a/src/hotspot/share/classfile/systemDictionary.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/classfile/systemDictionary.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -1268,116 +1268,116 @@
                                                    Handle protection_domain,
                                                    const ClassFileStream *cfs,
                                                    TRAPS) {
-
-  if (ik != NULL) {
-    Symbol* class_name = ik->name();
-
-    bool visible = is_shared_class_visible(
-                            class_name, ik, class_loader, CHECK_NULL);
-    if (!visible) {
-      return NULL;
-    }
-
-    // Resolve the superclass and interfaces. They must be the same
-    // as in dump time, because the layout of <ik> depends on
-    // the specific layout of ik->super() and ik->local_interfaces().
-    //
-    // If unexpected superclass or interfaces are found, we cannot
-    // load <ik> from the shared archive.
+  assert(ik != NULL, "sanity");
+  assert(!ik->is_unshareable_info_restored(), "shared class can be loaded only once");
+  Symbol* class_name = ik->name();
 
-    if (ik->super() != NULL) {
-      Symbol*  cn = ik->super()->name();
-      Klass *s = resolve_super_or_fail(class_name, cn,
-                                       class_loader, protection_domain, true, CHECK_NULL);
-      if (s != ik->super()) {
-        // The dynamically resolved super class is not the same as the one we used during dump time,
-        // so we cannot use ik.
-        return NULL;
-      } else {
-        assert(s->is_shared(), "must be");
-      }
-    }
+  bool visible = is_shared_class_visible(
+                          class_name, ik, class_loader, CHECK_NULL);
+  if (!visible) {
+    return NULL;
+  }
 
-    Array<InstanceKlass*>* interfaces = ik->local_interfaces();
-    int num_interfaces = interfaces->length();
-    for (int index = 0; index < num_interfaces; index++) {
-      InstanceKlass* k = interfaces->at(index);
-      Symbol* name  = k->name();
-      Klass* i = resolve_super_or_fail(class_name, name, class_loader, protection_domain, false, CHECK_NULL);
-      if (k != i) {
-        // The dynamically resolved interface class is not the same as the one we used during dump time,
-        // so we cannot use ik.
-        return NULL;
-      } else {
-        assert(i->is_shared(), "must be");
-      }
-    }
-
-    InstanceKlass* new_ik = KlassFactory::check_shared_class_file_load_hook(
-        ik, class_name, class_loader, protection_domain, cfs, CHECK_NULL);
-    if (new_ik != NULL) {
-      // The class is changed by CFLH. Return the new class. The shared class is
-      // not used.
-      return new_ik;
-    }
+  // Resolve the superclass and interfaces. They must be the same
+  // as in dump time, because the layout of <ik> depends on
+  // the specific layout of ik->super() and ik->local_interfaces().
+  //
+  // If unexpected superclass or interfaces are found, we cannot
+  // load <ik> from the shared archive.
 
-    // Adjust methods to recover missing data.  They need addresses for
-    // interpreter entry points and their default native method address
-    // must be reset.
-
-    // Updating methods must be done under a lock so multiple
-    // threads don't update these in parallel
-    //
-    // Shared classes are all currently loaded by either the bootstrap or
-    // internal parallel class loaders, so this will never cause a deadlock
-    // on a custom class loader lock.
-
-    ClassLoaderData* loader_data = ClassLoaderData::class_loader_data(class_loader());
-    {
-      HandleMark hm(THREAD);
-      Handle lockObject = compute_loader_lock_object(class_loader, THREAD);
-      check_loader_lock_contention(lockObject, THREAD);
-      ObjectLocker ol(lockObject, THREAD, true);
-      // prohibited package check assumes all classes loaded from archive call
-      // restore_unshareable_info which calls ik->set_package()
-      ik->restore_unshareable_info(loader_data, protection_domain, CHECK_NULL);
+  if (ik->super() != NULL) {
+    Symbol*  cn = ik->super()->name();
+    Klass *s = resolve_super_or_fail(class_name, cn,
+                                     class_loader, protection_domain, true, CHECK_NULL);
+    if (s != ik->super()) {
+      // The dynamically resolved super class is not the same as the one we used during dump time,
+      // so we cannot use ik.
+      return NULL;
+    } else {
+      assert(s->is_shared(), "must be");
     }
-
-    ik->print_class_load_logging(loader_data, NULL, NULL);
+  }
 
-    // For boot loader, ensure that GetSystemPackage knows that a class in this
-    // package was loaded.
-    if (class_loader.is_null()) {
-      int path_index = ik->shared_classpath_index();
-      ResourceMark rm;
-      ClassLoader::add_package(ik->name()->as_C_string(), path_index, THREAD);
-    }
-
-    if (DumpLoadedClassList != NULL && classlist_file->is_open()) {
-      // Only dump the classes that can be stored into CDS archive
-      if (SystemDictionaryShared::is_sharing_possible(loader_data)) {
-        ResourceMark rm(THREAD);
-        classlist_file->print_cr("%s", ik->name()->as_C_string());
-        classlist_file->flush();
-      }
-    }
-
-    // notify a class loaded from shared object
-    ClassLoadingService::notify_class_loaded(ik, true /* shared class */);
-
-    ik->set_has_passed_fingerprint_check(false);
-    if (UseAOT && ik->supers_have_passed_fingerprint_checks()) {
-      uint64_t aot_fp = AOTLoader::get_saved_fingerprint(ik);
-      uint64_t cds_fp = ik->get_stored_fingerprint();
-      if (aot_fp != 0 && aot_fp == cds_fp) {
-        // This class matches with a class saved in an AOT library
-        ik->set_has_passed_fingerprint_check(true);
-      } else {
-        ResourceMark rm;
-        log_info(class, fingerprint)("%s :  expected = " PTR64_FORMAT " actual = " PTR64_FORMAT, ik->external_name(), aot_fp, cds_fp);
-      }
+  Array<InstanceKlass*>* interfaces = ik->local_interfaces();
+  int num_interfaces = interfaces->length();
+  for (int index = 0; index < num_interfaces; index++) {
+    InstanceKlass* k = interfaces->at(index);
+    Symbol* name  = k->name();
+    Klass* i = resolve_super_or_fail(class_name, name, class_loader, protection_domain, false, CHECK_NULL);
+    if (k != i) {
+      // The dynamically resolved interface class is not the same as the one we used during dump time,
+      // so we cannot use ik.
+      return NULL;
+    } else {
+      assert(i->is_shared(), "must be");
     }
   }
+
+  InstanceKlass* new_ik = KlassFactory::check_shared_class_file_load_hook(
+      ik, class_name, class_loader, protection_domain, cfs, CHECK_NULL);
+  if (new_ik != NULL) {
+    // The class is changed by CFLH. Return the new class. The shared class is
+    // not used.
+    return new_ik;
+  }
+
+  // Adjust methods to recover missing data.  They need addresses for
+  // interpreter entry points and their default native method address
+  // must be reset.
+
+  // Updating methods must be done under a lock so multiple
+  // threads don't update these in parallel
+  //
+  // Shared classes are all currently loaded by either the bootstrap or
+  // internal parallel class loaders, so this will never cause a deadlock
+  // on a custom class loader lock.
+
+  ClassLoaderData* loader_data = ClassLoaderData::class_loader_data(class_loader());
+  {
+    HandleMark hm(THREAD);
+    Handle lockObject = compute_loader_lock_object(class_loader, THREAD);
+    check_loader_lock_contention(lockObject, THREAD);
+    ObjectLocker ol(lockObject, THREAD, true);
+    // prohibited package check assumes all classes loaded from archive call
+    // restore_unshareable_info which calls ik->set_package()
+    ik->restore_unshareable_info(loader_data, protection_domain, CHECK_NULL);
+  }
+
+  ik->print_class_load_logging(loader_data, NULL, NULL);
+
+  // For boot loader, ensure that GetSystemPackage knows that a class in this
+  // package was loaded.
+  if (class_loader.is_null()) {
+    int path_index = ik->shared_classpath_index();
+    ResourceMark rm;
+    ClassLoader::add_package(ik->name()->as_C_string(), path_index, THREAD);
+  }
+
+  if (DumpLoadedClassList != NULL && classlist_file->is_open()) {
+    // Only dump the classes that can be stored into CDS archive
+    if (SystemDictionaryShared::is_sharing_possible(loader_data)) {
+      ResourceMark rm(THREAD);
+      classlist_file->print_cr("%s", ik->name()->as_C_string());
+      classlist_file->flush();
+    }
+  }
+
+  // notify a class loaded from shared object
+  ClassLoadingService::notify_class_loaded(ik, true /* shared class */);
+
+  ik->set_has_passed_fingerprint_check(false);
+  if (UseAOT && ik->supers_have_passed_fingerprint_checks()) {
+    uint64_t aot_fp = AOTLoader::get_saved_fingerprint(ik);
+    uint64_t cds_fp = ik->get_stored_fingerprint();
+    if (aot_fp != 0 && aot_fp == cds_fp) {
+      // This class matches with a class saved in an AOT library
+      ik->set_has_passed_fingerprint_check(true);
+    } else {
+      ResourceMark rm;
+      log_info(class, fingerprint)("%s :  expected = " PTR64_FORMAT " actual = " PTR64_FORMAT, ik->external_name(), aot_fp, cds_fp);
+    }
+  }
+
   return ik;
 }
 #endif // INCLUDE_CDS
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -132,7 +132,7 @@
   RedirtyLoggedCardTableEntryClosure(G1CollectedHeap* g1h) : G1CardTableEntryClosure(),
     _num_dirtied(0), _g1h(g1h), _g1_ct(g1h->card_table()) { }
 
-  void do_card_ptr(CardValue* card_ptr, uint worker_i) {
+  void do_card_ptr(CardValue* card_ptr, uint worker_id) {
     HeapRegion* hr = region_for_card(card_ptr);
 
     // Should only dirty cards in regions that won't be freed.
@@ -1938,8 +1938,8 @@
   return _hrm->total_free_bytes();
 }
 
-void G1CollectedHeap::iterate_hcc_closure(G1CardTableEntryClosure* cl, uint worker_i) {
-  _hot_card_cache->drain(cl, worker_i);
+void G1CollectedHeap::iterate_hcc_closure(G1CardTableEntryClosure* cl, uint worker_id) {
+  _hot_card_cache->drain(cl, worker_id);
 }
 
 // Computes the sum of the storage used by the various regions.
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -991,7 +991,7 @@
   void scrub_rem_set();
 
   // Apply the given closure on all cards in the Hot Card Cache, emptying it.
-  void iterate_hcc_closure(G1CardTableEntryClosure* cl, uint worker_i);
+  void iterate_hcc_closure(G1CardTableEntryClosure* cl, uint worker_id);
 
   // The shared block offset table array.
   G1BlockOffsetTable* bot() const { return _bot; }
--- a/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -198,10 +198,10 @@
 
 static Thresholds calc_thresholds(size_t green_zone,
                                   size_t yellow_zone,
-                                  uint worker_i) {
+                                  uint worker_id) {
   double yellow_size = yellow_zone - green_zone;
   double step = yellow_size / G1ConcurrentRefine::max_num_threads();
-  if (worker_i == 0) {
+  if (worker_id == 0) {
     // Potentially activate worker 0 more aggressively, to keep
     // available buffers near green_zone value.  When yellow_size is
     // large we don't want to allow a full step to accumulate before
@@ -209,8 +209,8 @@
     // than green_zone buffers to be processed during scanning.
     step = MIN2(step, ParallelGCThreads / 2.0);
   }
-  size_t activate_offset = static_cast<size_t>(ceil(step * (worker_i + 1)));
-  size_t deactivate_offset = static_cast<size_t>(floor(step * worker_i));
+  size_t activate_offset = static_cast<size_t>(ceil(step * (worker_id + 1)));
+  size_t deactivate_offset = static_cast<size_t>(floor(step * worker_id));
   return Thresholds(green_zone + activate_offset,
                     green_zone + deactivate_offset);
 }
--- a/src/hotspot/share/gc/g1/g1DirtyCardQueue.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/g1/g1DirtyCardQueue.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -158,7 +158,7 @@
   // Stops processing a buffer if SuspendibleThreadSet::should_yield(),
   // returning the incompletely processed buffer to the completed buffer
   // list, for later processing of the remainder.
-  bool refine_completed_buffer_concurrently(uint worker_i, size_t stop_at);
+  bool refine_completed_buffer_concurrently(uint worker_id, size_t stop_at);
 
   // If a full collection is happening, reset partial logs, and release
   // completed ones: the full collection will make them all irrelevant.
--- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -62,8 +62,7 @@
   _gc_par_phases[JVMTIRoots] = new WorkerDataArray<double>(max_gc_threads, "JVMTI Roots (ms):");
   AOT_ONLY(_gc_par_phases[AOTCodeRoots] = new WorkerDataArray<double>(max_gc_threads, "AOT Root Scan (ms):");)
   _gc_par_phases[CMRefRoots] = new WorkerDataArray<double>(max_gc_threads, "CM RefProcessor Roots (ms):");
-  _gc_par_phases[WaitForStrongCLD] = new WorkerDataArray<double>(max_gc_threads, "Wait For Strong CLD (ms):");
-  _gc_par_phases[WeakCLDRoots] = new WorkerDataArray<double>(max_gc_threads, "Weak CLD Roots (ms):");
+  _gc_par_phases[WaitForStrongRoots] = new WorkerDataArray<double>(max_gc_threads, "Wait For Strong Roots (ms):");
 
   _gc_par_phases[MergeER] = new WorkerDataArray<double>(max_gc_threads, "Eager Reclaim (ms):");
 
@@ -273,37 +272,37 @@
 #undef ASSERT_PHASE_UNINITIALIZED
 
 // record the time a phase took in seconds
-void G1GCPhaseTimes::record_time_secs(GCParPhases phase, uint worker_i, double secs) {
-  _gc_par_phases[phase]->set(worker_i, secs);
+void G1GCPhaseTimes::record_time_secs(GCParPhases phase, uint worker_id, double secs) {
+  _gc_par_phases[phase]->set(worker_id, secs);
 }
 
 // add a number of seconds to a phase
-void G1GCPhaseTimes::add_time_secs(GCParPhases phase, uint worker_i, double secs) {
-  _gc_par_phases[phase]->add(worker_i, secs);
+void G1GCPhaseTimes::add_time_secs(GCParPhases phase, uint worker_id, double secs) {
+  _gc_par_phases[phase]->add(worker_id, secs);
 }
 
-void G1GCPhaseTimes::record_or_add_time_secs(GCParPhases phase, uint worker_i, double secs) {
-  if (_gc_par_phases[phase]->get(worker_i) == _gc_par_phases[phase]->uninitialized()) {
-    record_time_secs(phase, worker_i, secs);
+void G1GCPhaseTimes::record_or_add_time_secs(GCParPhases phase, uint worker_id, double secs) {
+  if (_gc_par_phases[phase]->get(worker_id) == _gc_par_phases[phase]->uninitialized()) {
+    record_time_secs(phase, worker_id, secs);
   } else {
-    add_time_secs(phase, worker_i, secs);
+    add_time_secs(phase, worker_id, secs);
   }
 }
 
-double G1GCPhaseTimes::get_time_secs(GCParPhases phase, uint worker_i) {
-  return _gc_par_phases[phase]->get(worker_i);
+double G1GCPhaseTimes::get_time_secs(GCParPhases phase, uint worker_id) {
+  return _gc_par_phases[phase]->get(worker_id);
 }
 
-void G1GCPhaseTimes::record_thread_work_item(GCParPhases phase, uint worker_i, size_t count, uint index) {
-  _gc_par_phases[phase]->set_thread_work_item(worker_i, count, index);
+void G1GCPhaseTimes::record_thread_work_item(GCParPhases phase, uint worker_id, size_t count, uint index) {
+  _gc_par_phases[phase]->set_thread_work_item(worker_id, count, index);
 }
 
-void G1GCPhaseTimes::record_or_add_thread_work_item(GCParPhases phase, uint worker_i, size_t count, uint index) {
-  _gc_par_phases[phase]->set_or_add_thread_work_item(worker_i, count, index);
+void G1GCPhaseTimes::record_or_add_thread_work_item(GCParPhases phase, uint worker_id, size_t count, uint index) {
+  _gc_par_phases[phase]->set_or_add_thread_work_item(worker_id, count, index);
 }
 
-size_t G1GCPhaseTimes::get_thread_work_item(GCParPhases phase, uint worker_i, uint index) {
-  return _gc_par_phases[phase]->get_thread_work_item(worker_i, index);
+size_t G1GCPhaseTimes::get_thread_work_item(GCParPhases phase, uint worker_id, uint index) {
+  return _gc_par_phases[phase]->get_thread_work_item(worker_id, index);
 }
 
 // return the average time for a phase in milliseconds
@@ -567,8 +566,7 @@
       "JVMTIRoots",
       AOT_ONLY("AOTCodeRoots" COMMA)
       "CMRefRoots",
-      "WaitForStrongCLD",
-      "WeakCLDRoots",
+      "WaitForStrongRoots",
       "MergeER",
       "MergeRS",
       "OptMergeRS",
--- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -57,8 +57,7 @@
     JVMTIRoots,
     AOT_ONLY(AOTCodeRoots COMMA)
     CMRefRoots,
-    WaitForStrongCLD,
-    WeakCLDRoots,
+    WaitForStrongRoots,
     MergeER,
     MergeRS,
     OptMergeRS,
@@ -84,7 +83,7 @@
   };
 
   static const GCParPhases ExtRootScanSubPhasesFirst = ThreadRoots;
-  static const GCParPhases ExtRootScanSubPhasesLast = WeakCLDRoots;
+  static const GCParPhases ExtRootScanSubPhasesLast = WaitForStrongRoots;
 
   enum GCMergeRSWorkTimes {
     MergeRSMergedSparse,
@@ -251,20 +250,20 @@
   static const char* phase_name(GCParPhases phase);
 
   // record the time a phase took in seconds
-  void record_time_secs(GCParPhases phase, uint worker_i, double secs);
+  void record_time_secs(GCParPhases phase, uint worker_id, double secs);
 
   // add a number of seconds to a phase
-  void add_time_secs(GCParPhases phase, uint worker_i, double secs);
+  void add_time_secs(GCParPhases phase, uint worker_id, double secs);
 
-  void record_or_add_time_secs(GCParPhases phase, uint worker_i, double secs);
+  void record_or_add_time_secs(GCParPhases phase, uint worker_id, double secs);
 
-  double get_time_secs(GCParPhases phase, uint worker_i);
+  double get_time_secs(GCParPhases phase, uint worker_id);
 
-  void record_thread_work_item(GCParPhases phase, uint worker_i, size_t count, uint index = 0);
+  void record_thread_work_item(GCParPhases phase, uint worker_id, size_t count, uint index = 0);
 
-  void record_or_add_thread_work_item(GCParPhases phase, uint worker_i, size_t count, uint index = 0);
+  void record_or_add_thread_work_item(GCParPhases phase, uint worker_id, size_t count, uint index = 0);
 
-  size_t get_thread_work_item(GCParPhases phase, uint worker_i, uint index = 0);
+  size_t get_thread_work_item(GCParPhases phase, uint worker_id, uint index = 0);
 
   // return the average time for a phase in milliseconds
   double average_time_ms(GCParPhases phase);
--- a/src/hotspot/share/gc/g1/g1HotCardCache.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/g1/g1HotCardCache.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -84,7 +84,7 @@
   return (previous_ptr == current_ptr) ? previous_ptr : card_ptr;
 }
 
-void G1HotCardCache::drain(G1CardTableEntryClosure* cl, uint worker_i) {
+void G1HotCardCache::drain(G1CardTableEntryClosure* cl, uint worker_id) {
   assert(default_use_cache(), "Drain only necessary if we use the hot card cache.");
 
   assert(_hot_cache != NULL, "Logic");
@@ -99,7 +99,7 @@
     for (size_t i = start_idx; i < end_idx; i++) {
       CardValue* card_ptr = _hot_cache[i];
       if (card_ptr != NULL) {
-        cl->do_card_ptr(card_ptr, worker_i);
+        cl->do_card_ptr(card_ptr, worker_id);
       } else {
         break;
       }
--- a/src/hotspot/share/gc/g1/g1HotCardCache.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/g1/g1HotCardCache.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -113,7 +113,7 @@
 
   // Refine the cards that have delayed as a result of
   // being in the cache.
-  void drain(G1CardTableEntryClosure* cl, uint worker_i);
+  void drain(G1CardTableEntryClosure* cl, uint worker_id);
 
   // Set up for parallel processing of the cards in the hot cache
   void reset_hot_cache_claimed_index() {
--- a/src/hotspot/share/gc/g1/g1OopClosures.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/g1/g1OopClosures.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -43,16 +43,14 @@
 
 void G1CLDScanClosure::do_cld(ClassLoaderData* cld) {
   // If the class loader data has not been dirtied we know that there's
-  // no references into  the young gen and we can skip it.
+  // no references into the young gen and we can skip it.
   if (!_process_only_dirty || cld->has_modified_oops()) {
 
     // Tell the closure that this class loader data is the CLD to scavenge
     // and is the one to dirty if oops are left pointing into the young gen.
     _closure->set_scanned_cld(cld);
-
-    // Clean the cld since we're going to scavenge all the metadata.
-    // Clear modified oops only if this cld is claimed.
-    cld->oops_do(_closure, _claim, /*clear_modified_oops*/true);
+    // Clean modified oops since we're going to scavenge all the metadata.
+    cld->oops_do(_closure, ClassLoaderData::_claim_none, true /*clear_modified_oops*/);
 
     _closure->set_scanned_cld(NULL);
 
--- a/src/hotspot/share/gc/g1/g1OopClosures.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/g1/g1OopClosures.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -175,12 +175,10 @@
 class G1CLDScanClosure : public CLDClosure {
   G1ParCopyHelper* _closure;
   bool             _process_only_dirty;
-  int              _claim;
   int              _count;
 public:
-  G1CLDScanClosure(G1ParCopyHelper* closure,
-                   bool process_only_dirty, int claim_value)
-  : _closure(closure), _process_only_dirty(process_only_dirty), _claim(claim_value), _count(0) {}
+  G1CLDScanClosure(G1ParCopyHelper* closure, bool process_only_dirty)
+  : _closure(closure), _process_only_dirty(process_only_dirty), _count(0) {}
   void do_cld(ClassLoaderData* cld);
 };
 
@@ -211,12 +209,12 @@
 
 class G1ConcurrentRefineOopClosure: public BasicOopIterateClosure {
   G1CollectedHeap* _g1h;
-  uint _worker_i;
+  uint _worker_id;
 
 public:
-  G1ConcurrentRefineOopClosure(G1CollectedHeap* g1h, uint worker_i) :
+  G1ConcurrentRefineOopClosure(G1CollectedHeap* g1h, uint worker_id) :
     _g1h(g1h),
-    _worker_i(worker_i) {
+    _worker_id(worker_id) {
   }
 
   virtual ReferenceIterationMode reference_iteration_mode() { return DO_FIELDS; }
--- a/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -156,7 +156,7 @@
 
   assert(to_rem_set != NULL, "Need per-region 'into' remsets.");
   if (to_rem_set->is_tracked()) {
-    to_rem_set->add_reference(p, _worker_i);
+    to_rem_set->add_reference(p, _worker_id);
   }
 }
 
--- a/src/hotspot/share/gc/g1/g1RemSet.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/g1/g1RemSet.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -830,7 +830,7 @@
 
     G1ScanCardClosure scan_cl(G1CollectedHeap::heap(), _pss);
     G1ScanRSForOptionalClosure cl(G1CollectedHeap::heap(), &scan_cl);
-    _opt_refs_scanned += opt_rem_set_list->oops_do(&cl, _pss->closures()->raw_strong_oops());
+    _opt_refs_scanned += opt_rem_set_list->oops_do(&cl, _pss->closures()->strong_oops());
     _opt_refs_memory_used += opt_rem_set_list->used_memory();
 
     event.commit(GCId::current(), _worker_id, G1GCPhaseTimes::phase_name(_scan_phase));
@@ -839,14 +839,14 @@
 public:
   G1ScanCollectionSetRegionClosure(G1RemSetScanState* scan_state,
                                    G1ParScanThreadState* pss,
-                                   uint worker_i,
+                                   uint worker_id,
                                    G1GCPhaseTimes::GCParPhases scan_phase,
                                    G1GCPhaseTimes::GCParPhases code_roots_phase) :
     _pss(pss),
     _scan_state(scan_state),
     _scan_phase(scan_phase),
     _code_roots_phase(code_roots_phase),
-    _worker_id(worker_i),
+    _worker_id(worker_id),
     _opt_refs_scanned(0),
     _opt_refs_memory_used(0),
     _strong_code_root_scan_time(),
@@ -1061,7 +1061,7 @@
       _scan_state(scan_state), _ct(g1h->card_table()), _cards_dirty(0), _cards_skipped(0)
     {}
 
-    void do_card_ptr(CardValue* card_ptr, uint worker_i) {
+    void do_card_ptr(CardValue* card_ptr, uint worker_id) {
       // The only time we care about recording cards that
       // contain references that point into the collection set
       // is during RSet updating within an evacuation pause.
@@ -1263,7 +1263,7 @@
 }
 
 void G1RemSet::refine_card_concurrently(CardValue* card_ptr,
-                                        uint worker_i) {
+                                        uint worker_id) {
   assert(!_g1h->is_gc_active(), "Only call concurrently");
 
   // Construct the region representing the card.
@@ -1375,7 +1375,7 @@
   MemRegion dirty_region(start, MIN2(scan_limit, end));
   assert(!dirty_region.is_empty(), "sanity");
 
-  G1ConcurrentRefineOopClosure conc_refine_cl(_g1h, worker_i);
+  G1ConcurrentRefineOopClosure conc_refine_cl(_g1h, worker_id);
   if (r->oops_on_memregion_seq_iterate_careful<false>(dirty_region, &conc_refine_cl) != NULL) {
     _num_conc_refined_cards++; // Unsynchronized update, only used for logging.
     return;
--- a/src/hotspot/share/gc/g1/g1RemSet.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/g1/g1RemSet.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -117,7 +117,7 @@
   // Refine the card corresponding to "card_ptr". Safe to be called concurrently
   // to the mutator.
   void refine_card_concurrently(CardValue* card_ptr,
-                                uint worker_i);
+                                uint worker_id);
 
   // Print accumulated summary info from the start of the VM.
   void print_summary_info();
--- a/src/hotspot/share/gc/g1/g1RootClosures.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/g1/g1RootClosures.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -35,20 +35,17 @@
   G1EvacuationClosures(G1CollectedHeap* g1h,
                        G1ParScanThreadState* pss,
                        bool in_young_gc) :
-      _closures(g1h, pss, in_young_gc, /* cld_claim */ ClassLoaderData::_claim_none) {}
+      _closures(g1h, pss, in_young_gc) {}
 
   OopClosure* weak_oops()   { return &_closures._oops; }
   OopClosure* strong_oops() { return &_closures._oops; }
 
   CLDClosure* weak_clds()             { return &_closures._clds; }
   CLDClosure* strong_clds()           { return &_closures._clds; }
-  CLDClosure* second_pass_weak_clds() { return NULL; }
 
   CodeBlobClosure* strong_codeblobs()      { return &_closures._codeblobs; }
   CodeBlobClosure* weak_codeblobs()        { return &_closures._codeblobs; }
 
-  OopClosure* raw_strong_oops() { return &_closures._oops; }
-
   bool trace_metadata()         { return false; }
 };
 
@@ -60,38 +57,21 @@
   G1SharedClosures<G1MarkFromRoot> _strong;
   G1SharedClosures<MarkWeak>       _weak;
 
-  // Filter method to help with returning the appropriate closures
-  // depending on the class template parameter.
-  template <G1Mark Mark, typename T>
-  T* null_if(T* t) {
-    if (Mark == MarkWeak) {
-      return NULL;
-    }
-    return t;
-  }
-
 public:
   G1InitialMarkClosures(G1CollectedHeap* g1h,
                         G1ParScanThreadState* pss) :
-      _strong(g1h, pss, /* process_only_dirty_klasses */ false, /* cld_claim */ ClassLoaderData::_claim_strong),
-      _weak(g1h, pss,   /* process_only_dirty_klasses */ false, /* cld_claim */ ClassLoaderData::_claim_strong) {}
+      _strong(g1h, pss, /* process_only_dirty_klasses */ false),
+      _weak(g1h, pss,   /* process_only_dirty_klasses */ false) {}
 
   OopClosure* weak_oops()   { return &_weak._oops; }
   OopClosure* strong_oops() { return &_strong._oops; }
 
-  // If MarkWeak is G1MarkPromotedFromRoot then the weak CLDs must be processed in a second pass.
-  CLDClosure* weak_clds()             { return null_if<G1MarkPromotedFromRoot>(&_weak._clds); }
+  CLDClosure* weak_clds()             { return &_weak._clds; }
   CLDClosure* strong_clds()           { return &_strong._clds; }
 
-  // If MarkWeak is G1MarkFromRoot then all CLDs are processed by the weak and strong variants
-  // return a NULL closure for the following specialized versions in that case.
-  CLDClosure* second_pass_weak_clds() { return null_if<G1MarkFromRoot>(&_weak._clds); }
-
   CodeBlobClosure* strong_codeblobs()      { return &_strong._codeblobs; }
   CodeBlobClosure* weak_codeblobs()        { return &_weak._codeblobs; }
 
-  OopClosure* raw_strong_oops() { return &_strong._oops; }
-
   // If we are not marking all weak roots then we are tracing
   // which metadata is alive.
   bool trace_metadata()         { return MarkWeak == G1MarkPromotedFromRoot; }
--- a/src/hotspot/share/gc/g1/g1RootClosures.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/g1/g1RootClosures.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -49,13 +49,6 @@
 
 class G1EvacuationRootClosures : public G1RootClosures {
 public:
-  // Applied to the weakly reachable CLDs when all strongly reachable
-  // CLDs are guaranteed to have been processed.
-  virtual CLDClosure* second_pass_weak_clds() = 0;
-
-  // Get a raw oop closure for processing oops, bypassing the flushing above.
-  virtual OopClosure* raw_strong_oops() = 0;
-
   // Applied to code blobs treated as weak roots.
   virtual CodeBlobClosure* weak_codeblobs() = 0;
 
--- a/src/hotspot/share/gc/g1/g1RootProcessor.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/g1/g1RootProcessor.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -45,7 +45,7 @@
 #include "services/management.hpp"
 #include "utilities/macros.hpp"
 
-void G1RootProcessor::worker_has_discovered_all_strong_classes() {
+void G1RootProcessor::worker_has_discovered_all_strong_nmethods() {
   assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
 
   uint new_value = (uint)Atomic::add(1, &_n_workers_discovered_strong_classes);
@@ -56,7 +56,7 @@
   }
 }
 
-void G1RootProcessor::wait_until_all_strong_classes_discovered() {
+void G1RootProcessor::wait_until_all_strong_nmethods_discovered() {
   assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
 
   if ((uint)_n_workers_discovered_strong_classes != n_workers()) {
@@ -71,28 +71,22 @@
     _g1h(g1h),
     _process_strong_tasks(G1RP_PS_NumElements),
     _srs(n_workers),
-    _lock(Mutex::leaf, "G1 Root Scanning barrier lock", false, Monitor::_safepoint_check_never),
+    _lock(Mutex::leaf, "G1 Root Scan barrier lock", false, Monitor::_safepoint_check_never),
     _n_workers_discovered_strong_classes(0) {}
 
-void G1RootProcessor::evacuate_roots(G1ParScanThreadState* pss, uint worker_i) {
+void G1RootProcessor::evacuate_roots(G1ParScanThreadState* pss, uint worker_id) {
   G1GCPhaseTimes* phase_times = _g1h->phase_times();
 
-  G1EvacPhaseTimesTracker timer(phase_times, pss, G1GCPhaseTimes::ExtRootScan, worker_i);
+  G1EvacPhaseTimesTracker timer(phase_times, pss, G1GCPhaseTimes::ExtRootScan, worker_id);
 
   G1EvacuationRootClosures* closures = pss->closures();
-  process_java_roots(closures, phase_times, worker_i);
+  process_java_roots(closures, phase_times, worker_id, closures->trace_metadata() /* notify_claimed_nmethods_done */);
 
-  // This is the point where this worker thread will not find more strong CLDs/nmethods.
-  // Report this so G1 can synchronize the strong and weak CLDs/nmethods processing.
-  if (closures->trace_metadata()) {
-    worker_has_discovered_all_strong_classes();
-  }
-
-  process_vm_roots(closures, phase_times, worker_i);
+  process_vm_roots(closures, phase_times, worker_id);
 
   {
     // Now the CM ref_processor roots.
-    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::CMRefRoots, worker_i);
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::CMRefRoots, worker_id);
     if (_process_strong_tasks.try_claim_task(G1RP_PS_refProcessor_oops_do)) {
       // We need to treat the discovered reference lists of the
       // concurrent mark ref processor as roots and keep entries
@@ -103,21 +97,9 @@
   }
 
   if (closures->trace_metadata()) {
-    {
-      G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::WaitForStrongCLD, worker_i);
-      // Barrier to make sure all workers passed
-      // the strong CLD and strong nmethods phases.
-      wait_until_all_strong_classes_discovered();
-    }
-
-    // Now take the complement of the strong CLDs.
-    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::WeakCLDRoots, worker_i);
-    assert(closures->second_pass_weak_clds() != NULL, "Should be non-null if we are tracing metadata.");
-    ClassLoaderDataGraph::roots_cld_do(NULL, closures->second_pass_weak_clds());
-  } else {
-    phase_times->record_time_secs(G1GCPhaseTimes::WaitForStrongCLD, worker_i, 0.0);
-    phase_times->record_time_secs(G1GCPhaseTimes::WeakCLDRoots, worker_i, 0.0);
-    assert(closures->second_pass_weak_clds() == NULL, "Should be null if not tracing metadata.");
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::WaitForStrongRoots, worker_id);
+    // Wait to make sure all workers passed the strong nmethods phase.
+    wait_until_all_strong_nmethods_discovered();
   }
 
   _process_strong_tasks.all_tasks_completed(n_workers());
@@ -189,61 +171,81 @@
 
 void G1RootProcessor::process_java_roots(G1RootClosures* closures,
                                          G1GCPhaseTimes* phase_times,
-                                         uint worker_i) {
-  // Iterating over the CLDG and the Threads are done early to allow us to
-  // first process the strong CLDs and nmethods and then, after a barrier,
-  // let the thread process the weak CLDs and nmethods.
+                                         uint worker_id,
+                                         bool notify_claimed_nmethods_done) {
+  // We need to make make sure that the "strong" nmethods are processed first
+  // using the strong closure. Only after that we process the weakly reachable
+  // nmethods.
+  // We need to strictly separate the strong and weak nmethod processing because
+  // any processing claims that nmethod, i.e. will not be iterated again.
+  // Which means if an nmethod is processed first and claimed, the strong processing
+  // will not happen, and the oops reachable by that nmethod will not be marked
+  // properly.
+  //
+  // That is why we process strong nmethods first, synchronize all threads via a
+  // barrier, and only then allow weak processing. To minimize the wait time at
+  // that barrier we do the strong nmethod processing first, and immediately after-
+  // wards indicate that that thread is done. Hopefully other root processing after
+  // nmethod processing is enough so there is no need to wait.
+  //
+  // This is only required in the concurrent start pause with class unloading enabled.
   {
-    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::CLDGRoots, worker_i);
-    if (_process_strong_tasks.try_claim_task(G1RP_PS_ClassLoaderDataGraph_oops_do)) {
-      ClassLoaderDataGraph::roots_cld_do(closures->strong_clds(), closures->weak_clds());
-    }
-  }
-
-  {
-    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::ThreadRoots, worker_i);
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::ThreadRoots, worker_id);
     bool is_par = n_workers() > 1;
     Threads::possibly_parallel_oops_do(is_par,
                                        closures->strong_oops(),
                                        closures->strong_codeblobs());
   }
+
+  // This is the point where this worker thread will not find more strong nmethods.
+  // Report this so G1 can synchronize the strong and weak CLDs/nmethods processing.
+  if (notify_claimed_nmethods_done) {
+    worker_has_discovered_all_strong_nmethods();
+  }
+
+  {
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::CLDGRoots, worker_id);
+    if (_process_strong_tasks.try_claim_task(G1RP_PS_ClassLoaderDataGraph_oops_do)) {
+      ClassLoaderDataGraph::roots_cld_do(closures->strong_clds(), closures->weak_clds());
+    }
+  }
 }
 
 void G1RootProcessor::process_vm_roots(G1RootClosures* closures,
                                        G1GCPhaseTimes* phase_times,
-                                       uint worker_i) {
+                                       uint worker_id) {
   OopClosure* strong_roots = closures->strong_oops();
 
   {
-    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::UniverseRoots, worker_i);
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::UniverseRoots, worker_id);
     if (_process_strong_tasks.try_claim_task(G1RP_PS_Universe_oops_do)) {
       Universe::oops_do(strong_roots);
     }
   }
 
   {
-    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::JNIRoots, worker_i);
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::JNIRoots, worker_id);
     if (_process_strong_tasks.try_claim_task(G1RP_PS_JNIHandles_oops_do)) {
       JNIHandles::oops_do(strong_roots);
     }
   }
 
   {
-    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::ObjectSynchronizerRoots, worker_i);
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::ObjectSynchronizerRoots, worker_id);
     if (_process_strong_tasks.try_claim_task(G1RP_PS_ObjectSynchronizer_oops_do)) {
       ObjectSynchronizer::oops_do(strong_roots);
     }
   }
 
   {
-    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::ManagementRoots, worker_i);
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::ManagementRoots, worker_id);
     if (_process_strong_tasks.try_claim_task(G1RP_PS_Management_oops_do)) {
       Management::oops_do(strong_roots);
     }
   }
 
   {
-    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::JVMTIRoots, worker_i);
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::JVMTIRoots, worker_id);
     if (_process_strong_tasks.try_claim_task(G1RP_PS_jvmti_oops_do)) {
       JvmtiExport::oops_do(strong_roots);
     }
@@ -251,7 +253,7 @@
 
 #if INCLUDE_AOT
   if (UseAOT) {
-    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::AOTCodeRoots, worker_i);
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::AOTCodeRoots, worker_id);
     if (_process_strong_tasks.try_claim_task(G1RP_PS_aot_oops_do)) {
         AOTLoader::oops_do(strong_roots);
     }
@@ -259,7 +261,7 @@
 #endif
 
   {
-    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::SystemDictionaryRoots, worker_i);
+    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::SystemDictionaryRoots, worker_id);
     if (_process_strong_tasks.try_claim_task(G1RP_PS_SystemDictionary_oops_do)) {
       SystemDictionary::oops_do(strong_roots);
     }
@@ -268,7 +270,7 @@
 
 void G1RootProcessor::process_code_cache_roots(CodeBlobClosure* code_closure,
                                                G1GCPhaseTimes* phase_times,
-                                               uint worker_i) {
+                                               uint worker_id) {
   if (_process_strong_tasks.try_claim_task(G1RP_PS_CodeCache_oops_do)) {
     CodeCache::blobs_do(code_closure);
   }
--- a/src/hotspot/share/gc/g1/g1RootProcessor.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/g1/g1RootProcessor.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -69,20 +69,21 @@
     G1RP_PS_NumElements
   };
 
-  void worker_has_discovered_all_strong_classes();
-  void wait_until_all_strong_classes_discovered();
+  void worker_has_discovered_all_strong_nmethods();
+  void wait_until_all_strong_nmethods_discovered();
 
   void process_java_roots(G1RootClosures* closures,
                           G1GCPhaseTimes* phase_times,
-                          uint worker_i);
+                          uint worker_id,
+                          bool notify_claimed_nmethods_done = false);
 
   void process_vm_roots(G1RootClosures* closures,
                         G1GCPhaseTimes* phase_times,
-                        uint worker_i);
+                        uint worker_id);
 
   void process_code_cache_roots(CodeBlobClosure* code_closure,
                                 G1GCPhaseTimes* phase_times,
-                                uint worker_i);
+                                uint worker_id);
 
 public:
   G1RootProcessor(G1CollectedHeap* g1h, uint n_workers);
--- a/src/hotspot/share/gc/g1/g1SharedClosures.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/g1/g1SharedClosures.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -39,9 +39,9 @@
   G1CLDScanClosure                _clds;
   G1CodeBlobClosure               _codeblobs;
 
-  G1SharedClosures(G1CollectedHeap* g1h, G1ParScanThreadState* pss, bool process_only_dirty, int cld_claim) :
+  G1SharedClosures(G1CollectedHeap* g1h, G1ParScanThreadState* pss, bool process_only_dirty) :
     _oops(g1h, pss),
     _oops_in_cld(g1h, pss),
-    _clds(&_oops_in_cld, process_only_dirty, cld_claim),
+    _clds(&_oops_in_cld, process_only_dirty),
     _codeblobs(&_oops) {}
 };
--- a/src/hotspot/share/gc/shared/c1/barrierSetC1.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/shared/c1/barrierSetC1.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -100,7 +100,7 @@
   BasicType type() const                 { return _type; }
   LIR_Opr resolved_addr() const          { return _resolved_addr; }
   void set_resolved_addr(LIR_Opr addr)   { _resolved_addr = addr; }
-  bool is_oop() const                    { return _type == T_ARRAY || _type == T_OBJECT; }
+  bool is_oop() const                    { return is_reference_type(_type); }
   DecoratorSet decorators() const        { return _decorators; }
   void clear_decorators(DecoratorSet ds) { _decorators &= ~ds; }
   bool is_raw() const                    { return (_decorators & AS_RAW) != 0; }
--- a/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -120,7 +120,7 @@
   Node* base() const              { return _base; }
   C2AccessValuePtr& addr() const  { return _addr; }
   BasicType type() const          { return _type; }
-  bool is_oop() const             { return _type == T_OBJECT || _type == T_ARRAY; }
+  bool is_oop() const             { return is_reference_type(_type); }
   bool is_raw() const             { return (_decorators & AS_RAW) != 0; }
   Node* raw_access() const        { return _raw_access; }
 
--- a/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -187,6 +187,6 @@
 }
 
 bool CardTableBarrierSetC2::array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, ArrayCopyPhase phase) const {
-  bool is_oop = type == T_OBJECT || type == T_ARRAY;
+  bool is_oop = is_reference_type(type);
   return is_oop && (!tightly_coupled_alloc || !use_ReduceInitialCardMarks());
 }
--- a/src/hotspot/share/gc/shared/memAllocator.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/shared/memAllocator.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -171,9 +171,8 @@
   // This is a VM policy failure, so how do we exhaustively test it?
   assert(!_thread->has_pending_exception(),
          "shouldn't be allocating with pending exception");
-  // Allocation of an oop can always invoke a safepoint,
-  // hence, the true argument.
-  _thread->check_for_valid_safepoint_state(true);
+  // Allocation of an oop can always invoke a safepoint.
+  _thread->check_for_valid_safepoint_state();
 }
 #endif
 
--- a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -461,11 +461,12 @@
 }
 
 const TypeFunc* ShenandoahBarrierSetC2::shenandoah_clone_barrier_Type() {
-  const Type **fields = TypeTuple::fields(3);
-  fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // src
-  fields[TypeFunc::Parms+1] = TypeInstPtr::NOTNULL; // dst
-  fields[TypeFunc::Parms+2] = TypeInt::INT; // length
-  const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+3, fields);
+  const Type **fields = TypeTuple::fields(4);
+  fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // src oop
+  fields[TypeFunc::Parms+1] = TypeRawPtr::NOTNULL;  // src
+  fields[TypeFunc::Parms+2] = TypeRawPtr::NOTNULL;  // dst
+  fields[TypeFunc::Parms+3] = TypeInt::INT;         // length
+  const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+4, fields);
 
   // create result type (range)
   fields = TypeTuple::fields(0);
@@ -754,7 +755,7 @@
 }
 
 bool ShenandoahBarrierSetC2::array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, ArrayCopyPhase phase) const {
-  bool is_oop = type == T_OBJECT || type == T_ARRAY;
+  bool is_oop = is_reference_type(type);
   if (!is_oop) {
     return false;
   }
@@ -787,7 +788,7 @@
         }
   } else if (src_type->isa_aryptr()) {
     BasicType src_elem  = src_type->klass()->as_array_klass()->element_type()->basic_type();
-    if (src_elem == T_OBJECT || src_elem == T_ARRAY) {
+    if (is_reference_type(src_elem)) {
       return true;
     }
   } else {
@@ -807,13 +808,16 @@
   Node* dest_offset = ac->in(ArrayCopyNode::DestPos);
   Node* length = ac->in(ArrayCopyNode::Length);
   assert (src_offset == NULL && dest_offset == NULL, "for clone offsets should be null");
+  assert (src->is_AddP(), "for clone the src should be the interior ptr");
+  assert (dest->is_AddP(), "for clone the dst should be the interior ptr");
+
   if (ShenandoahCloneBarrier && clone_needs_barrier(src, phase->igvn())) {
     Node* call = phase->make_leaf_call(ctrl, mem,
                     ShenandoahBarrierSetC2::shenandoah_clone_barrier_Type(),
                     CAST_FROM_FN_PTR(address, ShenandoahRuntime::shenandoah_clone_barrier),
                     "shenandoah_clone",
                     TypeRawPtr::BOTTOM,
-                    src, dest, length);
+                    src->in(AddPNode::Base), src, dest, length);
     call = phase->transform_later(call);
     phase->igvn().replace_node(ac, call);
   } else {
--- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -24,6 +24,7 @@
 #include "precompiled.hpp"
 #include "gc/shenandoah/shenandoahAsserts.hpp"
 #include "gc/shenandoah/shenandoahBarrierSet.hpp"
+#include "gc/shenandoah/shenandoahBarrierSetClone.inline.hpp"
 #include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
 #include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
@@ -266,10 +267,25 @@
     return NULL;
   }
 
-  if (_heap->is_evacuation_in_progress() &&
-      !_heap->complete_marking_context()->is_marked(obj)) {
-    return NULL;
+  ShenandoahMarkingContext* const marking_context = _heap->marking_context();
+
+  if (_heap->is_evacuation_in_progress()) {
+    // Normal GC
+    if (!marking_context->is_marked(obj)) {
+      return NULL;
+    }
+  } else if (_heap->is_concurrent_traversal_in_progress()) {
+    // Traversal GC
+    if (marking_context->is_complete() &&
+        !marking_context->is_marked(resolve_forwarded_not_null(obj))) {
+      return NULL;
+    }
   }
 
   return load_reference_barrier_not_null(obj);
 }
+
+void ShenandoahBarrierSet::clone_barrier_runtime(oop src) {
+  clone_barrier(src);
+}
+
--- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -71,6 +71,7 @@
   inline void arraycopy_update(oop* src, size_t count);
   inline void arraycopy_update(narrowOop* src, size_t count);
   inline void clone_barrier(oop src);
+  void clone_barrier_runtime(oop src);
 
   // We export this to make it available in cases where the static
   // type of the barrier set is known.  Note that it is non-virtual.
--- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -186,7 +186,7 @@
 template <DecoratorSet decorators, typename BarrierSetT>
 void ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::clone_in_heap(oop src, oop dst, size_t size) {
   if (ShenandoahCloneBarrier) {
-    ShenandoahBarrierSet::barrier_set()->clone_barrier(src);
+    ShenandoahBarrierSet::barrier_set()->clone_barrier_runtime(src);
   }
   Raw::clone(src, dst, size);
 }
@@ -273,67 +273,4 @@
   arraycopy_update_impl(src, count);
 }
 
-template <bool EVAC, bool ENQUEUE>
-class ShenandoahUpdateRefsForOopClosure: public BasicOopIterateClosure {
-private:
-  ShenandoahHeap* const _heap;
-  ShenandoahBarrierSet* const _bs;
-  const ShenandoahCollectionSet* const _cset;
-  Thread* const _thread;
-
-  template <class T>
-  inline void do_oop_work(T* p) {
-    T o = RawAccess<>::oop_load(p);
-    if (!CompressedOops::is_null(o)) {
-      oop obj = CompressedOops::decode_not_null(o);
-      if (_cset->is_in((HeapWord *)obj)) {
-        oop fwd = _bs->resolve_forwarded_not_null(obj);
-        if (EVAC && obj == fwd) {
-          fwd = _heap->evacuate_object(obj, _thread);
-        }
-        if (ENQUEUE) {
-          _bs->enqueue(fwd);
-        }
-        assert(obj != fwd || _heap->cancelled_gc(), "must be forwarded");
-        ShenandoahHeap::cas_oop(fwd, p, o);
-      }
-
-    }
-  }
-public:
-  ShenandoahUpdateRefsForOopClosure() :
-          _heap(ShenandoahHeap::heap()),
-          _bs(ShenandoahBarrierSet::barrier_set()),
-          _cset(_heap->collection_set()),
-          _thread(Thread::current()) {
-  }
-
-  virtual void do_oop(oop* p)       { do_oop_work(p); }
-  virtual void do_oop(narrowOop* p) { do_oop_work(p); }
-};
-
-void ShenandoahBarrierSet::clone_barrier(oop obj) {
-  assert(ShenandoahCloneBarrier, "only get here with clone barriers enabled");
-  if (!_heap->has_forwarded_objects()) return;
-
-  // This is called for cloning an object (see jvm.cpp) after the clone
-  // has been made. We are not interested in any 'previous value' because
-  // it would be NULL in any case. But we *are* interested in any oop*
-  // that potentially need to be updated.
-
-  shenandoah_assert_correct(NULL, obj);
-  if (_heap->is_evacuation_in_progress()) {
-    ShenandoahEvacOOMScope evac_scope;
-    ShenandoahUpdateRefsForOopClosure</* evac = */ true, /* enqueue */ false> cl;
-    obj->oop_iterate(&cl);
-  } else if (_heap->is_concurrent_traversal_in_progress()) {
-    ShenandoahEvacOOMScope evac_scope;
-    ShenandoahUpdateRefsForOopClosure</* evac = */ true, /* enqueue */ true> cl;
-    obj->oop_iterate(&cl);
-  } else {
-    ShenandoahUpdateRefsForOopClosure</* evac = */ false, /* enqueue */ false> cl;
-    obj->oop_iterate(&cl);
-  }
-}
-
 #endif // SHARE_GC_SHENANDOAH_SHENANDOAHBARRIERSET_INLINE_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSetClone.inline.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,98 @@
+/*
+ * 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
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHBARRIERSETCLONE_INLINE_HPP
+#define SHARE_GC_SHENANDOAH_SHENANDOAHBARRIERSETCLONE_INLINE_HPP
+
+#include "gc/shenandoah/shenandoahBarrierSet.inline.hpp"
+#include "gc/shenandoah/shenandoahCollectionSet.inline.hpp"
+#include "gc/shenandoah/shenandoahEvacOOMHandler.hpp"
+#include "gc/shenandoah/shenandoahHeap.inline.hpp"
+#include "memory/iterator.hpp"
+#include "oops/access.hpp"
+#include "oops/compressedOops.hpp"
+
+template <bool EVAC, bool ENQUEUE>
+class ShenandoahUpdateRefsForOopClosure: public BasicOopIterateClosure {
+private:
+  ShenandoahHeap* const _heap;
+  ShenandoahBarrierSet* const _bs;
+  const ShenandoahCollectionSet* const _cset;
+  Thread* const _thread;
+
+  template <class T>
+  inline void do_oop_work(T* p) {
+    T o = RawAccess<>::oop_load(p);
+    if (!CompressedOops::is_null(o)) {
+      oop obj = CompressedOops::decode_not_null(o);
+      if (_cset->is_in((HeapWord *)obj)) {
+        oop fwd = _bs->resolve_forwarded_not_null(obj);
+        if (EVAC && obj == fwd) {
+          fwd = _heap->evacuate_object(obj, _thread);
+        }
+        if (ENQUEUE) {
+          _bs->enqueue(fwd);
+        }
+        assert(obj != fwd || _heap->cancelled_gc(), "must be forwarded");
+        ShenandoahHeap::cas_oop(fwd, p, o);
+      }
+
+    }
+  }
+public:
+  ShenandoahUpdateRefsForOopClosure() :
+          _heap(ShenandoahHeap::heap()),
+          _bs(ShenandoahBarrierSet::barrier_set()),
+          _cset(_heap->collection_set()),
+          _thread(Thread::current()) {
+  }
+
+  virtual void do_oop(oop* p)       { do_oop_work(p); }
+  virtual void do_oop(narrowOop* p) { do_oop_work(p); }
+};
+
+void ShenandoahBarrierSet::clone_barrier(oop obj) {
+  assert(ShenandoahCloneBarrier, "only get here with clone barriers enabled");
+  if (!_heap->has_forwarded_objects()) return;
+
+  // This is called for cloning an object (see jvm.cpp) after the clone
+  // has been made. We are not interested in any 'previous value' because
+  // it would be NULL in any case. But we *are* interested in any oop*
+  // that potentially need to be updated.
+
+  shenandoah_assert_correct(NULL, obj);
+  if (_heap->is_evacuation_in_progress()) {
+    ShenandoahEvacOOMScope evac_scope;
+    ShenandoahUpdateRefsForOopClosure</* evac = */ true, /* enqueue */ false> cl;
+    obj->oop_iterate(&cl);
+  } else if (_heap->is_concurrent_traversal_in_progress()) {
+    ShenandoahEvacOOMScope evac_scope;
+    ShenandoahUpdateRefsForOopClosure</* evac = */ true, /* enqueue */ true> cl;
+    obj->oop_iterate(&cl);
+  } else {
+    ShenandoahUpdateRefsForOopClosure</* evac = */ false, /* enqueue */ false> cl;
+    obj->oop_iterate(&cl);
+  }
+}
+
+#endif // SHARE_GC_SHENANDOAH_SHENANDOAHBARRIERSETCLONE_INLINE_HPP
--- a/src/hotspot/share/gc/shenandoah/shenandoahRuntime.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRuntime.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -23,10 +23,12 @@
 
 #include "precompiled.hpp"
 #include "gc/shenandoah/shenandoahBarrierSet.inline.hpp"
+#include "gc/shenandoah/shenandoahBarrierSetClone.inline.hpp"
 #include "gc/shenandoah/shenandoahRuntime.hpp"
 #include "gc/shenandoah/shenandoahThreadLocalData.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "oops/oop.inline.hpp"
+#include "utilities/copy.hpp"
 
 void ShenandoahRuntime::write_ref_array_pre_oop_entry(oop* src, oop* dst, size_t length) {
   ShenandoahBarrierSet *bs = ShenandoahBarrierSet::barrier_set();
@@ -74,13 +76,13 @@
 
 // Shenandoah clone barrier: makes sure that references point to to-space
 // in cloned objects.
-JRT_LEAF(void, ShenandoahRuntime::shenandoah_clone_barrier(oopDesc* s, oopDesc* d, size_t length))
-  oop src = oop(s);
-  oop dst = oop(d);
-  shenandoah_assert_correct(NULL, src);
-  shenandoah_assert_correct(NULL, dst);
-  ShenandoahBarrierSet::barrier_set()->clone_barrier(src);
-  RawAccessBarrier<IS_NOT_NULL>::clone(src, dst, length);
+JRT_LEAF(void, ShenandoahRuntime::shenandoah_clone_barrier(oopDesc* src, void* src_ptr, void* dst_ptr, size_t length))
+  oop s = oop(src);
+  shenandoah_assert_correct(NULL, s);
+  ShenandoahBarrierSet::barrier_set()->clone_barrier(s);
+  Copy::conjoint_jlongs_atomic(reinterpret_cast<jlong*>(src_ptr),
+                               reinterpret_cast<jlong*>(dst_ptr),
+                               length);
 JRT_END
 
 JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier_native(oopDesc * src))
--- a/src/hotspot/share/gc/shenandoah/shenandoahRuntime.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRuntime.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -44,7 +44,7 @@
 
   static oopDesc* load_reference_barrier_native(oopDesc* src);
 
-  static void shenandoah_clone_barrier(oopDesc* s, oopDesc* d, size_t length);
+  static void shenandoah_clone_barrier(oopDesc* src, void* src_ptr, void* dst_ptr, size_t length);
 };
 
 #endif // SHARE_GC_SHENANDOAH_SHENANDOAHRUNTIME_HPP
--- a/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -594,11 +594,6 @@
   }
 
   if (!_heap->cancelled_gc()) {
-    fixup_roots();
-    _heap->parallel_cleaning(false);
-  }
-
-  if (!_heap->cancelled_gc()) {
     assert(_task_queues->is_empty(), "queues must be empty after traversal GC");
     TASKQUEUE_STATS_ONLY(_task_queues->print_taskqueue_stats());
     TASKQUEUE_STATS_ONLY(_task_queues->reset_taskqueue_stats());
@@ -606,6 +601,9 @@
     // No more marking expected
     _heap->mark_complete_marking_context();
 
+    fixup_roots();
+    _heap->parallel_cleaning(false);
+
     // Resize metaspace
     MetaspaceGC::compute_new_size();
 
--- a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -660,7 +660,7 @@
 }
 
 bool ZBarrierSetC2::array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, ArrayCopyPhase phase) const {
-  return type == T_OBJECT || type == T_ARRAY;
+  return is_reference_type(type);
 }
 
 bool ZBarrierSetC2::final_graph_reshaping(Compile* compile, Node* n, uint opcode) const {
@@ -1367,7 +1367,7 @@
         LoadStoreNode* lsn = n->as_LoadStore();
         if (lsn->has_barrier()) {
           BasicType bt = lsn->in(MemNode::Address)->bottom_type()->basic_type();
-          assert ((bt == T_OBJECT || bt == T_ARRAY), "Sanity test");
+          assert (is_reference_type(bt), "Sanity test");
           insert_barrier_before_unsafe(phase, lsn);
         }
       }
--- a/src/hotspot/share/gc/z/vmStructs_z.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/z/vmStructs_z.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -104,8 +104,7 @@
   declare_constant(ZAddressOffsetShift)                                                              \
   declare_constant(ZAddressOffsetBits)                                                               \
   declare_constant(ZAddressOffsetMask)                                                               \
-  declare_constant(ZAddressOffsetMax)                                                                \
-  declare_constant(ZAddressSpaceStart)
+  declare_constant(ZAddressOffsetMax)
 
 #define VM_TYPES_ZGC(declare_type, declare_toplevel_type, declare_integer_type)                      \
   declare_toplevel_type(ZGlobalsForVMStructs)                                                        \
--- a/src/hotspot/share/gc/z/zAddress.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/z/zAddress.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -32,14 +32,6 @@
 }
 
 void ZAddress::initialize() {
-  ZAddressSpaceStart = ZPlatformAddressSpaceStart();
-  ZAddressSpaceEnd = ZPlatformAddressSpaceEnd();
-  ZAddressSpaceSize = ZAddressSpaceEnd - ZAddressSpaceStart;
-
-  ZAddressReservedStart = ZPlatformAddressReservedStart();
-  ZAddressReservedEnd = ZPlatformAddressReservedEnd();
-  ZAddressReservedSize = ZAddressReservedEnd - ZAddressReservedStart;
-
   ZAddressBase = ZPlatformAddressBase();
 
   ZAddressOffsetBits = ZPlatformAddressOffsetBits();
--- a/src/hotspot/share/gc/z/zBarrierSet.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/z/zBarrierSet.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -66,7 +66,7 @@
   assert((decorators & AS_NO_KEEPALIVE) == 0, "Unexpected decorator");
   //assert((decorators & ON_UNKNOWN_OOP_REF) == 0, "Unexpected decorator");
 
-  if (type == T_OBJECT || type == T_ARRAY) {
+  if (is_reference_type(type)) {
     assert((decorators & (IN_HEAP | IN_NATIVE)) != 0, "Where is reference?");
     // Barrier needed even when IN_NATIVE, to allow concurrent scanning.
     return true;
--- a/src/hotspot/share/gc/z/zCollectedHeap.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/z/zCollectedHeap.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -23,13 +23,13 @@
 
 #include "precompiled.hpp"
 #include "gc/shared/gcHeapSummary.hpp"
-#include "gc/shared/locationPrinter.hpp"
 #include "gc/shared/suspendibleThreadSet.hpp"
 #include "gc/z/zCollectedHeap.hpp"
 #include "gc/z/zGlobals.hpp"
 #include "gc/z/zHeap.inline.hpp"
 #include "gc/z/zNMethod.hpp"
 #include "gc/z/zObjArrayAllocator.hpp"
+#include "gc/z/zOop.inline.hpp"
 #include "gc/z/zServiceability.hpp"
 #include "gc/z/zStat.hpp"
 #include "gc/z/zUtils.inline.hpp"
@@ -68,8 +68,7 @@
     return JNI_ENOMEM;
   }
 
-  Universe::calculate_verify_data((HeapWord*)ZAddressReservedStart,
-                                  (HeapWord*)ZAddressReservedEnd);
+  Universe::calculate_verify_data((HeapWord*)0, (HeapWord*)UINTPTR_MAX);
 
   return JNI_OK;
 }
@@ -116,7 +115,7 @@
 }
 
 uint32_t ZCollectedHeap::hash_oop(oop obj) const {
-  return _heap.hash_oop(obj);
+  return _heap.hash_oop(ZOop::to_address(obj));
 }
 
 HeapWord* ZCollectedHeap::allocate_new_tlab(size_t min_size, size_t requested_size, size_t* actual_size) {
@@ -285,12 +284,7 @@
 }
 
 VirtualSpaceSummary ZCollectedHeap::create_heap_space_summary() {
-  const size_t capacity_in_words = capacity() / HeapWordSize;
-  const size_t max_capacity_in_words = max_capacity() / HeapWordSize;
-  HeapWord* const heap_start = (HeapWord*)ZAddressReservedStart;
-  return VirtualSpaceSummary(heap_start,
-                             heap_start + capacity_in_words,
-                             heap_start + max_capacity_in_words);
+  return VirtualSpaceSummary((HeapWord*)0, (HeapWord*)capacity(), (HeapWord*)max_capacity());
 }
 
 void ZCollectedHeap::safepoint_synchronize_begin() {
@@ -312,10 +306,6 @@
 void ZCollectedHeap::print_on_error(outputStream* st) const {
   CollectedHeap::print_on_error(st);
 
-  st->print_cr("Address Space");
-  st->print_cr( "     Start:             " PTR_FORMAT, ZAddressSpaceStart);
-  st->print_cr( "     End:               " PTR_FORMAT, ZAddressSpaceEnd);
-  st->print_cr( "     Size:              " SIZE_FORMAT_W(-15) " (" PTR_FORMAT ")", ZAddressSpaceSize, ZAddressSpaceSize);
   st->print_cr( "Heap");
   st->print_cr( "     GlobalPhase:       %u", ZGlobalPhase);
   st->print_cr( "     GlobalSeqNum:      %u", ZGlobalSeqNum);
@@ -352,13 +342,7 @@
 }
 
 bool ZCollectedHeap::print_location(outputStream* st, void* addr) const {
-  if (LocationPrinter::is_valid_obj(addr)) {
-    st->print(INTPTR_FORMAT " is a %s oop: ", p2i(addr),
-              ZAddress::is_good(reinterpret_cast<uintptr_t>(addr)) ? "good" : "bad");
-    cast_to_oop(addr)->print_on(st);
-    return true;
-  }
-  return false;
+  return _heap.print_location(st, (uintptr_t)addr);
 }
 
 void ZCollectedHeap::verify(VerifyOption option /* ignored */) {
@@ -366,5 +350,5 @@
 }
 
 bool ZCollectedHeap::is_oop(oop object) const {
-  return CollectedHeap::is_oop(object) && _heap.is_oop(object);
+  return _heap.is_oop(ZOop::to_address(object));
 }
--- a/src/hotspot/share/gc/z/zDebug.gdb	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/z/zDebug.gdb	Wed Sep 25 22:40:41 2019 +0200
@@ -126,10 +126,6 @@
 
 # Print heap information
 define zph
-    printf "Address Space\n"
-    printf "     Start:             0x%llx\n", ZAddressSpaceStart
-    printf "     End:               0x%llx\n", ZAddressSpaceEnd
-    printf "     Size:              %-15llu (0x%llx)\n", ZAddressSpaceSize, ZAddressSpaceSize
     printf "Heap\n"
     printf "     GlobalPhase:       %u\n", ZGlobalPhase
     printf "     GlobalSeqNum:      %u\n", ZGlobalSeqNum
--- a/src/hotspot/share/gc/z/zGlobals.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/z/zGlobals.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -48,11 +48,3 @@
 uintptr_t ZAddressMetadataMarked1;
 uintptr_t ZAddressMetadataRemapped;
 uintptr_t ZAddressMetadataFinalizable;
-
-uintptr_t ZAddressSpaceStart;
-uintptr_t ZAddressSpaceEnd;
-size_t    ZAddressSpaceSize;
-
-uintptr_t ZAddressReservedStart;
-uintptr_t ZAddressReservedEnd;
-size_t    ZAddressReservedSize;
--- a/src/hotspot/share/gc/z/zGlobals.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/z/zGlobals.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -112,16 +112,6 @@
 extern uintptr_t  ZAddressMetadataRemapped;
 extern uintptr_t  ZAddressMetadataFinalizable;
 
-// Address space start/end/size
-extern uintptr_t  ZAddressSpaceStart;
-extern uintptr_t  ZAddressSpaceEnd;
-extern size_t     ZAddressSpaceSize;
-
-// Reserved space start/end
-extern uintptr_t  ZAddressReservedStart;
-extern uintptr_t  ZAddressReservedEnd;
-extern size_t     ZAddressReservedSize;
-
 // NMethod entry barrier
 const size_t      ZNMethodDisarmedOffset        = ZPlatformNMethodDisarmedOffset;
 
--- a/src/hotspot/share/gc/z/zHeap.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/z/zHeap.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -22,35 +22,26 @@
  */
 
 #include "precompiled.hpp"
-#include "gc/shared/gcArguments.hpp"
-#include "gc/shared/oopStorage.hpp"
-#include "gc/z/zAddress.hpp"
+#include "gc/shared/locationPrinter.hpp"
+#include "gc/z/zAddress.inline.hpp"
 #include "gc/z/zGlobals.hpp"
 #include "gc/z/zHeap.inline.hpp"
 #include "gc/z/zHeapIterator.hpp"
-#include "gc/z/zList.inline.hpp"
-#include "gc/z/zLock.inline.hpp"
 #include "gc/z/zMark.inline.hpp"
-#include "gc/z/zOopClosures.inline.hpp"
 #include "gc/z/zPage.inline.hpp"
 #include "gc/z/zPageTable.inline.hpp"
 #include "gc/z/zRelocationSet.inline.hpp"
+#include "gc/z/zRelocationSetSelector.hpp"
 #include "gc/z/zResurrection.hpp"
-#include "gc/z/zRootsIterator.hpp"
 #include "gc/z/zStat.hpp"
-#include "gc/z/zTask.hpp"
 #include "gc/z/zThread.hpp"
-#include "gc/z/zTracer.inline.hpp"
 #include "gc/z/zVerify.hpp"
-#include "gc/z/zVirtualMemory.inline.hpp"
 #include "gc/z/zWorkers.inline.hpp"
 #include "logging/log.hpp"
+#include "memory/iterator.hpp"
 #include "memory/resourceArea.hpp"
-#include "oops/oop.inline.hpp"
-#include "runtime/arguments.hpp"
 #include "runtime/safepoint.hpp"
 #include "runtime/thread.hpp"
-#include "utilities/align.hpp"
 #include "utilities/debug.hpp"
 
 static const ZStatSampler ZSamplerHeapUsedBeforeMark("Memory", "Heap Used Before Mark", ZStatUnitBytes);
@@ -179,7 +170,7 @@
 
 bool ZHeap::is_in(uintptr_t addr) const {
   // An address is considered to be "in the heap" if it points into
-  // the allocated part of a pages, regardless of which heap view is
+  // the allocated part of a page, regardless of which heap view is
   // used. Note that an address with the finalizable metadata bit set
   // is not pointing into a heap view, and therefore not considered
   // to be "in the heap".
@@ -512,6 +503,16 @@
   st->cr();
 }
 
+bool ZHeap::print_location(outputStream* st, uintptr_t addr) const {
+  if (LocationPrinter::is_valid_obj((void*)addr)) {
+    st->print(PTR_FORMAT " is a %s oop: ", addr, ZAddress::is_good(addr) ? "good" : "bad");
+    ZOop::from_address(addr)->print_on(st);
+    return true;
+  }
+
+  return false;
+}
+
 void ZHeap::verify() {
   // Heap verification can only be done between mark end and
   // relocate start. This is the only window where all oop are
--- a/src/hotspot/share/gc/z/zHeap.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/z/zHeap.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -24,12 +24,8 @@
 #ifndef SHARE_GC_Z_ZHEAP_HPP
 #define SHARE_GC_Z_ZHEAP_HPP
 
-#include "gc/shared/gcTimer.hpp"
 #include "gc/z/zAllocationFlags.hpp"
-#include "gc/z/zArray.hpp"
 #include "gc/z/zForwardingTable.hpp"
-#include "gc/z/zList.hpp"
-#include "gc/z/zLock.hpp"
 #include "gc/z/zMark.hpp"
 #include "gc/z/zObjectAllocator.hpp"
 #include "gc/z/zPage.hpp"
@@ -38,13 +34,10 @@
 #include "gc/z/zReferenceProcessor.hpp"
 #include "gc/z/zRelocate.hpp"
 #include "gc/z/zRelocationSet.hpp"
-#include "gc/z/zRelocationSetSelector.hpp"
-#include "gc/z/zRootsIterator.hpp"
 #include "gc/z/zWeakRootsProcessor.hpp"
 #include "gc/z/zServiceability.hpp"
 #include "gc/z/zUnload.hpp"
 #include "gc/z/zWorkers.hpp"
-#include "memory/allocation.hpp"
 
 class ZHeap {
   friend class VMStructs;
@@ -105,7 +98,7 @@
   size_t unsafe_max_tlab_alloc() const;
 
   bool is_in(uintptr_t addr) const;
-  uint32_t hash_oop(oop obj) const;
+  uint32_t hash_oop(uintptr_t addr) const;
 
   // Workers
   uint nconcurrent_worker_threads() const;
@@ -168,9 +161,10 @@
   // Printing
   void print_on(outputStream* st) const;
   void print_extended_on(outputStream* st) const;
+  bool print_location(outputStream* st, uintptr_t addr) const;
 
   // Verification
-  bool is_oop(oop object) const;
+  bool is_oop(uintptr_t addr) const;
   void verify();
 };
 
--- a/src/hotspot/share/gc/z/zHeap.inline.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/z/zHeap.inline.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -33,7 +33,6 @@
 #include "gc/z/zOop.inline.hpp"
 #include "gc/z/zPage.inline.hpp"
 #include "gc/z/zPageTable.inline.hpp"
-#include "gc/z/zUtils.inline.hpp"
 #include "utilities/debug.hpp"
 
 inline ZHeap* ZHeap::heap() {
@@ -45,8 +44,8 @@
   return &_reference_processor;
 }
 
-inline uint32_t ZHeap::hash_oop(oop obj) const {
-  const uintptr_t offset = ZAddress::offset(ZOop::to_address(obj));
+inline uint32_t ZHeap::hash_oop(uintptr_t addr) const {
+  const uintptr_t offset = ZAddress::offset(addr);
   return ZHash::address_to_uint32(offset);
 }
 
@@ -134,12 +133,8 @@
   _page_allocator.check_out_of_memory();
 }
 
-inline bool ZHeap::is_oop(oop object) const {
-  // Verify that we have a good address. Note that ZAddress::is_good()
-  // would not be a strong enough verification, since it only verifies
-  // that the metadata bits are good.
-  const uintptr_t addr = ZOop::to_address(object);
-  return ZAddress::good(addr) == addr;
+inline bool ZHeap::is_oop(uintptr_t addr) const {
+  return ZAddress::is_good(addr) && is_object_aligned(addr) && is_in(addr);
 }
 
 #endif // SHARE_GC_Z_ZHEAP_INLINE_HPP
--- a/src/hotspot/share/gc/z/zPageAllocator.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/z/zPageAllocator.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -94,7 +94,7 @@
                                size_t max_capacity,
                                size_t max_reserve) :
     _lock(),
-    _virtual(),
+    _virtual(max_capacity),
     _physical(),
     _cache(),
     _min_capacity(min_capacity),
--- a/src/hotspot/share/gc/z/zVirtualMemory.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/z/zVirtualMemory.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -27,28 +27,39 @@
 #include "logging/log.hpp"
 #include "services/memTracker.hpp"
 
-ZVirtualMemoryManager::ZVirtualMemoryManager() :
+ZVirtualMemoryManager::ZVirtualMemoryManager(size_t max_capacity) :
     _manager(),
     _initialized(false) {
 
-  log_info(gc, init)("Address Space: " PTR_FORMAT " - " PTR_FORMAT " (" SIZE_FORMAT "T)",
-                     ZAddressSpaceStart, ZAddressSpaceEnd, ZAddressSpaceSize / K / G);
+  log_info(gc, init)("Address Space: " SIZE_FORMAT "T", ZAddressOffsetMax / K / G);
 
   // Reserve address space
-  if (!reserve(ZAddressSpaceStart, ZAddressSpaceSize)) {
+  if (reserve(0, ZAddressOffsetMax) < max_capacity) {
+    log_error(gc)("Failed to reserve address space for Java heap");
     return;
   }
 
-  // Make the complete address view free
-  _manager.free(0, ZAddressOffsetMax);
-
-  // Register address space with native memory tracker
-  nmt_reserve(ZAddressSpaceStart, ZAddressSpaceSize);
-
   // Successfully initialized
   _initialized = true;
 }
 
+size_t ZVirtualMemoryManager::reserve(uintptr_t start, size_t size) {
+  if (size < ZGranuleSize) {
+    // Too small
+    return 0;
+  }
+
+  if (!reserve_platform(start, size)) {
+    const size_t half = size / 2;
+    return reserve(start, half) + reserve(start + half, half);
+  }
+
+  // Make the address range free
+  _manager.free(start, size);
+
+  return size;
+}
+
 void ZVirtualMemoryManager::nmt_reserve(uintptr_t start, size_t size) {
   MemTracker::record_virtual_memory_reserve((void*)start, size, CALLER_PC);
   MemTracker::record_virtual_memory_type((void*)start, mtJavaHeap);
--- a/src/hotspot/share/gc/z/zVirtualMemory.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/gc/z/zVirtualMemory.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -50,11 +50,12 @@
   ZMemoryManager _manager;
   bool           _initialized;
 
-  bool reserve(uintptr_t start, size_t size);
+  bool reserve_platform(uintptr_t start, size_t size);
+  size_t reserve(uintptr_t start, size_t size);
   void nmt_reserve(uintptr_t start, size_t size);
 
 public:
-  ZVirtualMemoryManager();
+  ZVirtualMemoryManager(size_t max_capacity);
 
   bool is_initialized() const;
 
--- a/src/hotspot/share/interpreter/bytecodeTracer.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/interpreter/bytecodeTracer.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -449,7 +449,7 @@
     case Bytecodes::_newarray: {
         BasicType atype = (BasicType)get_index_u1();
         const char* str = type2name(atype);
-        if (str == NULL || atype == T_OBJECT || atype == T_ARRAY) {
+        if (str == NULL || is_reference_type(atype)) {
           assert(false, "Unidentified basic type");
         }
         st->print_cr(" %s", str);
--- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -1034,7 +1034,7 @@
 
   if (jap.get_ret_type() == T_VOID) {
     return NULL;
-  } else if (jap.get_ret_type() == T_OBJECT || jap.get_ret_type() == T_ARRAY) {
+  } else if (is_reference_type(jap.get_ret_type())) {
     return JNIHandles::make_local((oop) result.get_jobject());
   } else {
     jvalue *value = (jvalue *) result.get_value_addr();
@@ -1149,8 +1149,8 @@
   return (jint) JVMCICounterSize;
 C2V_END
 
-C2V_VMENTRY_0(jboolean, setCountersSize, (JNIEnv* env, jobject, jint new_size))
-  return JavaThread::resize_all_jvmci_counters(new_size);
+C2V_VMENTRY(void, setCountersSize, (JNIEnv* env, jobject, jint new_size))
+  JavaThread::resize_all_jvmci_counters(new_size);
 C2V_END
 
 C2V_VMENTRY_0(jint, allocateCompileId, (JNIEnv* env, jobject, jobject jvmci_method, int entry_bci))
@@ -2696,7 +2696,7 @@
   {CC "readUncompressedOop",                          CC "(J)" OBJECTCONSTANT,                                                              FN_PTR(readUncompressedOop)},
   {CC "collectCounters",                              CC "()[J",                                                                            FN_PTR(collectCounters)},
   {CC "getCountersSize",                              CC "()I",                                                                             FN_PTR(getCountersSize)},
-  {CC "setCountersSize",                              CC "(I)Z",                                                                            FN_PTR(setCountersSize)},
+  {CC "setCountersSize",                              CC "(I)V",                                                                            FN_PTR(setCountersSize)},
   {CC "allocateCompileId",                            CC "(" HS_RESOLVED_METHOD "I)I",                                                      FN_PTR(allocateCompileId)},
   {CC "isMature",                                     CC "(" METASPACE_METHOD_DATA ")Z",                                                    FN_PTR(isMature)},
   {CC "hasCompiledCodeForOSR",                        CC "(" HS_RESOLVED_METHOD "II)Z",                                                     FN_PTR(hasCompiledCodeForOSR)},
--- a/src/hotspot/share/memory/dynamicArchive.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/memory/dynamicArchive.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -470,7 +470,8 @@
   void sort_methods(InstanceKlass* ik) const;
   void set_symbols_permanent();
   void relocate_buffer_to_target();
-  void write_archive(char* read_only_tables_start);
+  void write_archive(char* serialized_data_start);
+  void write_regions(FileMapInfo* dynamic_info);
 
   void init_first_dump_space(address reserved_bottom) {
     address first_space_base = reserved_bottom;
@@ -595,7 +596,7 @@
 
     verify_estimate_size(_estimated_metsapceobj_bytes, "MetaspaceObjs");
 
-    char* read_only_tables_start;
+    char* serialized_data_start;
     {
       set_symbols_permanent();
 
@@ -608,7 +609,7 @@
       SymbolTable::write_to_archive(false);
       SystemDictionaryShared::write_to_archive(false);
 
-      read_only_tables_start = ro_space->top();
+      serialized_data_start = ro_space->top();
       WriteClosure wc(ro_space);
       SymbolTable::serialize_shared_table_header(&wc, false);
       SystemDictionaryShared::serialize_dictionary_headers(&wc, false);
@@ -634,7 +635,7 @@
       relocate_buffer_to_target();
     }
 
-    write_archive(read_only_tables_start);
+    write_archive(serialized_data_start);
 
     assert(_num_dump_regions_used == _total_dump_regions, "must be");
     verify_universe("After CDS dynamic dump");
@@ -911,9 +912,7 @@
  _header->relocate_shared_path_table(table);
 }
 
-static void write_archive_info(FileMapInfo* dynamic_info, DynamicArchiveHeader *header) {
-  dynamic_info->write_header();
-  dynamic_info->align_file_position();
+void DynamicArchiveBuilder::write_regions(FileMapInfo* dynamic_info) {
   dynamic_info->write_region(MetaspaceShared::rw,
                              MetaspaceShared::read_write_dump_space()->base(),
                              MetaspaceShared::read_write_dump_space()->used(),
@@ -928,28 +927,23 @@
                              /*read_only=*/false,/*allow_exec=*/true);
 }
 
-void DynamicArchiveBuilder::write_archive(char* read_only_tables_start) {
+void DynamicArchiveBuilder::write_archive(char* serialized_data_start) {
   int num_klasses = _klasses->length();
   int num_symbols = _symbols->length();
 
-  _header->set_read_only_tables_start(to_target(read_only_tables_start));
+  _header->set_serialized_data_start(to_target(serialized_data_start));
 
   FileMapInfo* dynamic_info = FileMapInfo::dynamic_info();
   assert(dynamic_info != NULL, "Sanity");
 
-  // Populate the file offsets, region crcs, etc. No data is written out.
-  write_archive_info(dynamic_info, _header);
-
-  // the header will no longer change. Compute its crc.
-  dynamic_info->set_header_crc(dynamic_info->compute_header_crc());
-
   // Now write the archived data including the file offsets.
   const char* archive_name = Arguments::GetSharedDynamicArchivePath();
   dynamic_info->open_for_write(archive_name);
-  write_archive_info(dynamic_info, _header);
+  write_regions(dynamic_info);
+  dynamic_info->set_header_crc(dynamic_info->compute_header_crc());
+  dynamic_info->write_header();
   dynamic_info->close();
 
-
   address base = to_target(_alloc_bottom);
   address top  = address(current_dump_space()->top()) + _buffer_to_target_delta;
   size_t file_size = pointer_delta(top, base, sizeof(char));
@@ -1108,7 +1102,7 @@
     return NULL;
   }
 
-  intptr_t* buffer = (intptr_t*)_dynamic_header->read_only_tables_start();
+  intptr_t* buffer = (intptr_t*)_dynamic_header->serialized_data_start();
   ReadClosure rc(&buffer);
   SymbolTable::serialize_shared_table_header(&rc, false);
   SystemDictionaryShared::serialize_dictionary_headers(&rc, false);
--- a/src/hotspot/share/memory/filemap.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/memory/filemap.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -1033,6 +1033,11 @@
   return true;
 }
 
+void FileMapInfo::seek_to_position(size_t pos) {
+  if (lseek(_fd, (long)pos, SEEK_SET) < 0) {
+    fail_stop("Unable to seek to position " SIZE_FORMAT, pos);
+  }
+}
 
 // Read the FileMapInfo information from the file.
 bool FileMapInfo::open_for_read(const char* path) {
@@ -1088,14 +1093,26 @@
               os::strerror(errno));
   }
   _fd = fd;
-  _file_offset = 0;
   _file_open = true;
+
+  // Seek past the header. We will write the header after all regions are written
+  // and their CRCs computed.
+  size_t header_bytes = header()->header_size();
+  if (header()->magic() == CDS_DYNAMIC_ARCHIVE_MAGIC) {
+    header_bytes += strlen(Arguments::GetSharedArchivePath()) + 1;
+  }
+
+  header_bytes = align_up(header_bytes, os::vm_allocation_granularity());
+  _file_offset = header_bytes;
+  seek_to_position(_file_offset);
 }
 
 
 // Write the header to the file, seek to the next allocation boundary.
 
 void FileMapInfo::write_header() {
+  _file_offset = 0;
+  seek_to_position(_file_offset);
   char* base_archive_name = NULL;
   if (header()->magic() == CDS_DYNAMIC_ARCHIVE_MAGIC) {
     base_archive_name = (char*)Arguments::GetSharedArchivePath();
@@ -1108,7 +1125,6 @@
   if (base_archive_name != NULL) {
     write_bytes(base_archive_name, header()->base_archive_name_size());
   }
-  align_file_position();
 }
 
 void FileMapRegion::init(bool is_heap_region, char* base, size_t size, bool read_only,
@@ -1132,9 +1148,6 @@
   _crc = crc;
 }
 
-// Dump region to file.
-// This is called twice for each region during archiving, once before
-// the archive file is open (_file_open is false) and once after.
 void FileMapInfo::write_region(int region, char* base, size_t size,
                                bool read_only, bool allow_exec) {
   assert(DumpSharedSpaces || DynamicDumpSharedSpaces, "Dump time only");
@@ -1146,14 +1159,10 @@
     target_base = DynamicArchive::buffer_to_target(base);
   }
 
-  if (_file_open) {
-    guarantee(si->file_offset() == _file_offset, "file offset mismatch.");
-    log_info(cds)("Shared file region %d: " SIZE_FORMAT_HEX_W(08)
-                  " bytes, addr " INTPTR_FORMAT " file offset " SIZE_FORMAT_HEX_W(08),
-                  region, size, p2i(target_base), _file_offset);
-  } else {
-    si->set_file_offset(_file_offset);
-  }
+  si->set_file_offset(_file_offset);
+  log_info(cds)("Shared file region %d: " SIZE_FORMAT_HEX_W(08)
+                " bytes, addr " INTPTR_FORMAT " file offset " SIZE_FORMAT_HEX_W(08),
+                region, size, p2i(target_base), _file_offset);
 
   int crc = ClassLoader::crc32(0, base, (jint)size);
   si->init(HeapShared::is_heap_region(region), target_base, size, read_only, allow_exec, crc);
@@ -1196,8 +1205,7 @@
 //             +-- gap
 size_t FileMapInfo::write_archive_heap_regions(GrowableArray<MemRegion> *heap_mem,
                                                GrowableArray<ArchiveHeapOopmapInfo> *oopmaps,
-                                               int first_region_id, int max_num_regions,
-                                               bool print_log) {
+                                               int first_region_id, int max_num_regions) {
   assert(max_num_regions <= 2, "Only support maximum 2 memory regions");
 
   int arr_len = heap_mem == NULL ? 0 : heap_mem->length();
@@ -1221,10 +1229,8 @@
       total_size += size;
     }
 
-    if (print_log) {
-      log_info(cds)("Archive heap region %d " INTPTR_FORMAT " - " INTPTR_FORMAT " = " SIZE_FORMAT_W(8) " bytes",
-                    i, p2i(start), p2i(start + size), size);
-    }
+    log_info(cds)("Archive heap region %d " INTPTR_FORMAT " - " INTPTR_FORMAT " = " SIZE_FORMAT_W(8) " bytes",
+                  i, p2i(start), p2i(start + size), size);
     write_region(i, start, size, false, false);
     if (size > 0) {
       space_at(i)->init_oopmap(oopmaps->at(arr_idx)._oopmap,
@@ -1237,14 +1243,13 @@
 // Dump bytes to file -- at the current file position.
 
 void FileMapInfo::write_bytes(const void* buffer, size_t nbytes) {
-  if (_file_open) {
-    size_t n = os::write(_fd, buffer, (unsigned int)nbytes);
-    if (n != nbytes) {
-      // If the shared archive is corrupted, close it and remove it.
-      close();
-      remove(_full_path);
-      fail_stop("Unable to write to shared archive file.");
-    }
+  assert(_file_open, "must be");
+  size_t n = os::write(_fd, buffer, (unsigned int)nbytes);
+  if (n != nbytes) {
+    // If the shared archive is corrupted, close it and remove it.
+    close();
+    remove(_full_path);
+    fail_stop("Unable to write to shared archive file.");
   }
   _file_offset += nbytes;
 }
@@ -1257,20 +1262,17 @@
 // Align file position to an allocation unit boundary.
 
 void FileMapInfo::align_file_position() {
+  assert(_file_open, "must be");
   size_t new_file_offset = align_up(_file_offset,
-                                         os::vm_allocation_granularity());
+                                    os::vm_allocation_granularity());
   if (new_file_offset != _file_offset) {
     _file_offset = new_file_offset;
-    if (_file_open) {
-      // Seek one byte back from the target and write a byte to insure
-      // that the written file is the correct length.
-      _file_offset -= 1;
-      if (lseek(_fd, (long)_file_offset, SEEK_SET) < 0) {
-        fail_stop("Unable to seek.");
-      }
-      char zero = 0;
-      write_bytes(&zero, 1);
-    }
+    // Seek one byte back from the target and write a byte to insure
+    // that the written file is the correct length.
+    _file_offset -= 1;
+    seek_to_position(_file_offset);
+    char zero = 0;
+    write_bytes(&zero, 1);
   }
 }
 
--- a/src/hotspot/share/memory/filemap.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/memory/filemap.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -179,10 +179,8 @@
   CompressedOops::Mode _narrow_oop_mode; // compressed oop encoding mode
   int     _narrow_klass_shift;      // save narrow klass base and shift
   address _narrow_klass_base;
-
-
   char*   _misc_data_patching_start;
-  char*   _read_only_tables_start;
+  char*   _serialized_data_start;  // Data accessed using {ReadClosure,WriteClosure}::serialize()
   address _i2i_entry_code_buffers;
   size_t  _i2i_entry_code_buffers_size;
   size_t  _core_spaces_size;        // number of bytes allocated by the core spaces
@@ -238,7 +236,7 @@
   int narrow_klass_shift()                 const { return _narrow_klass_shift; }
   address narrow_klass_base()              const { return _narrow_klass_base; }
   char* misc_data_patching_start()         const { return _misc_data_patching_start; }
-  char* read_only_tables_start()           const { return _read_only_tables_start; }
+  char* serialized_data_start()            const { return _serialized_data_start; }
   address i2i_entry_code_buffers()         const { return _i2i_entry_code_buffers; }
   size_t i2i_entry_code_buffers_size()     const { return _i2i_entry_code_buffers_size; }
   size_t core_spaces_size()                const { return _core_spaces_size; }
@@ -259,7 +257,7 @@
   void set_core_spaces_size(size_t s)            { _core_spaces_size = s; }
   void set_has_platform_or_app_classes(bool v)   { _has_platform_or_app_classes = v; }
   void set_misc_data_patching_start(char* p)     { _misc_data_patching_start = p; }
-  void set_read_only_tables_start(char* p)       { _read_only_tables_start   = p; }
+  void set_serialized_data_start(char* p)        { _serialized_data_start   = p; }
   void set_base_archive_name_size(size_t s)      { _base_archive_name_size = s; }
   void set_base_archive_is_default(bool b)       { _base_archive_is_default = b; }
   void set_header_size(size_t s)                 { _header_size = s; }
@@ -360,8 +358,8 @@
 
   char* misc_data_patching_start()            const { return header()->misc_data_patching_start(); }
   void  set_misc_data_patching_start(char* p) const { header()->set_misc_data_patching_start(p); }
-  char* read_only_tables_start()              const { return header()->read_only_tables_start(); }
-  void  set_read_only_tables_start(char* p)   const { header()->set_read_only_tables_start(p); }
+  char* serialized_data_start()               const { return header()->serialized_data_start(); }
+  void  set_serialized_data_start(char* p)    const { header()->set_serialized_data_start(p); }
 
   bool  is_file_position_aligned() const;
   void  align_file_position();
@@ -412,8 +410,7 @@
                      bool read_only, bool allow_exec);
   size_t write_archive_heap_regions(GrowableArray<MemRegion> *heap_mem,
                                     GrowableArray<ArchiveHeapOopmapInfo> *oopmaps,
-                                    int first_region_id, int max_num_regions,
-                                    bool print_log);
+                                    int first_region_id, int max_num_regions);
   void  write_bytes(const void* buffer, size_t count);
   void  write_bytes_aligned(const void* buffer, size_t count);
   size_t  read_bytes(void* buffer, size_t count);
@@ -479,6 +476,7 @@
   char* region_addr(int idx);
 
  private:
+  void  seek_to_position(size_t pos);
   char* skip_first_path_entry(const char* path) NOT_CDS_RETURN_(NULL);
   int   num_paths(const char* path) NOT_CDS_RETURN_(0);
   GrowableArray<const char*>* create_path_array(const char* path) NOT_CDS_RETURN_(NULL);
--- a/src/hotspot/share/memory/heapShared.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/memory/heapShared.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -583,7 +583,7 @@
   for (JavaFieldStream fs(k); !fs.done(); fs.next()) {
     if (!fs.access_flags().is_static()) {
       BasicType ft = fs.field_descriptor().field_type();
-      if (!fs.access_flags().is_final() && (ft == T_ARRAY || ft == T_OBJECT)) {
+      if (!fs.access_flags().is_final() && is_reference_type(ft)) {
         ResourceMark rm(THREAD);
         log_warning(cds, heap)(
           "Please check reference field in %s instance in closed archive heap region: %s %s",
@@ -871,7 +871,7 @@
   virtual void do_field(fieldDescriptor* fd) {
     if (fd->name() == _field_name) {
       assert(!_found, "fields cannot be overloaded");
-      assert(fd->field_type() == T_OBJECT || fd->field_type() == T_ARRAY, "can archive only obj or array fields");
+      assert(is_reference_type(fd->field_type()), "can archive only fields that are references");
       _found = true;
       _offset = fd->offset();
     }
--- a/src/hotspot/share/memory/metaspaceShared.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/memory/metaspaceShared.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -1137,7 +1137,9 @@
 
   VMOp_Type type() const { return VMOp_PopulateDumpSharedSpace; }
   void doit();   // outline because gdb sucks
-  static void write_region(FileMapInfo* mapinfo, int region, DumpRegion* space, bool read_only,  bool allow_exec);
+  static void write_region(FileMapInfo* mapinfo, int region_idx, DumpRegion* dump_region, bool read_only,  bool allow_exec) {
+    mapinfo->write_region(region_idx, dump_region->base(), dump_region->used(), read_only, allow_exec);
+  }
   bool allow_nested_vm_operations() const { return true; }
 }; // class VM_PopulateDumpSharedSpace
 
@@ -1406,11 +1408,6 @@
 SortedSymbolClosure* ArchiveCompactor::_ssc;
 ArchiveCompactor::RelocationTable* ArchiveCompactor::_new_loc_table;
 
-void VM_PopulateDumpSharedSpace::write_region(FileMapInfo* mapinfo, int region_idx,
-                                              DumpRegion* dump_region, bool read_only,  bool allow_exec) {
-  mapinfo->write_region(region_idx, dump_region->base(), dump_region->used(), read_only, allow_exec);
-}
-
 void VM_PopulateDumpSharedSpace::dump_symbols() {
   tty->print_cr("Dumping symbol table ...");
 
@@ -1430,12 +1427,11 @@
 
   SystemDictionaryShared::write_to_archive();
 
-  char* start = _ro_region.top();
-
   size_t vtptrs_bytes = _num_cloned_vtable_kinds * sizeof(intptr_t*);
   _cloned_cpp_vtptrs = (intptr_t**)_ro_region.allocate(vtptrs_bytes, sizeof(intptr_t*));
 
   // Write the other data to the output array.
+  char* start = _ro_region.top();
   WriteClosure wc(&_ro_region);
   MetaspaceShared::serialize(&wc);
 
@@ -1518,7 +1514,7 @@
 
   ArchiveCompactor::relocate_well_known_klasses();
 
-  char* read_only_tables_start = dump_read_only_tables();
+  char* serialized_data_start = dump_read_only_tables();
   _ro_region.pack(&_md_region);
 
   char* vtbl_list = _md_region.top();
@@ -1543,47 +1539,33 @@
 
   FileMapInfo* mapinfo = new FileMapInfo(true);
   mapinfo->populate_header(os::vm_allocation_granularity());
-  mapinfo->set_read_only_tables_start(read_only_tables_start);
+  mapinfo->set_serialized_data_start(serialized_data_start);
   mapinfo->set_misc_data_patching_start(vtbl_list);
   mapinfo->set_i2i_entry_code_buffers(MetaspaceShared::i2i_entry_code_buffers(),
-                                          MetaspaceShared::i2i_entry_code_buffers_size());
+                                      MetaspaceShared::i2i_entry_code_buffers_size());
   mapinfo->set_core_spaces_size(core_spaces_size);
+  mapinfo->open_for_write();
 
-  for (int pass=1; pass<=2; pass++) {
-    bool print_archive_log = (pass==1);
-    if (pass == 1) {
-      // The first pass doesn't actually write the data to disk. All it
-      // does is to update the fields in the mapinfo->_header.
-    } else {
-      // After the first pass, the contents of mapinfo->_header are finalized,
-      // so we can compute the header's CRC, and write the contents of the header
-      // and the regions into disk.
-      mapinfo->open_for_write();
-      mapinfo->set_header_crc(mapinfo->compute_header_crc());
-    }
-    mapinfo->write_header();
+  // NOTE: md contains the trampoline code for method entries, which are patched at run time,
+  // so it needs to be read/write.
+  write_region(mapinfo, MetaspaceShared::mc, &_mc_region, /*read_only=*/false,/*allow_exec=*/true);
+  write_region(mapinfo, MetaspaceShared::rw, &_rw_region, /*read_only=*/false,/*allow_exec=*/false);
+  write_region(mapinfo, MetaspaceShared::ro, &_ro_region, /*read_only=*/true, /*allow_exec=*/false);
+  write_region(mapinfo, MetaspaceShared::md, &_md_region, /*read_only=*/false,/*allow_exec=*/false);
 
-    // NOTE: md contains the trampoline code for method entries, which are patched at run time,
-    // so it needs to be read/write.
-    write_region(mapinfo, MetaspaceShared::mc, &_mc_region, /*read_only=*/false,/*allow_exec=*/true);
-    write_region(mapinfo, MetaspaceShared::rw, &_rw_region, /*read_only=*/false,/*allow_exec=*/false);
-    write_region(mapinfo, MetaspaceShared::ro, &_ro_region, /*read_only=*/true, /*allow_exec=*/false);
-    write_region(mapinfo, MetaspaceShared::md, &_md_region, /*read_only=*/false,/*allow_exec=*/false);
-
-    _total_closed_archive_region_size = mapinfo->write_archive_heap_regions(
+  _total_closed_archive_region_size = mapinfo->write_archive_heap_regions(
                                         _closed_archive_heap_regions,
                                         _closed_archive_heap_oopmaps,
                                         MetaspaceShared::first_closed_archive_heap_region,
-                                        MetaspaceShared::max_closed_archive_heap_region,
-                                        print_archive_log);
-    _total_open_archive_region_size = mapinfo->write_archive_heap_regions(
+                                        MetaspaceShared::max_closed_archive_heap_region);
+  _total_open_archive_region_size = mapinfo->write_archive_heap_regions(
                                         _open_archive_heap_regions,
                                         _open_archive_heap_oopmaps,
                                         MetaspaceShared::first_open_archive_heap_region,
-                                        MetaspaceShared::max_open_archive_heap_region,
-                                        print_archive_log);
-  }
+                                        MetaspaceShared::max_open_archive_heap_region);
 
+  mapinfo->set_header_crc(mapinfo->compute_header_crc());
+  mapinfo->write_header();
   mapinfo->close();
 
   // Restore the vtable in case we invoke any virtual methods.
@@ -2050,14 +2032,9 @@
   char* buffer = mapinfo->misc_data_patching_start();
   clone_cpp_vtables((intptr_t*)buffer);
 
-  // The rest of the data is now stored in the RW region
-  buffer = mapinfo->read_only_tables_start();
-
-  // Skip over _cloned_cpp_vtptrs;
-  buffer += _num_cloned_vtable_kinds * sizeof(intptr_t*);
-
   // Verify various attributes of the archive, plus initialize the
   // shared string/symbol tables
+  buffer = mapinfo->serialized_data_start();
   intptr_t* array = (intptr_t*)buffer;
   ReadClosure rc(&array);
   serialize(&rc);
--- a/src/hotspot/share/oops/constantPool.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/oops/constantPool.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -556,7 +556,8 @@
     Handle h_loader (thread, loader);
     Klass* k = SystemDictionary::find(name, h_loader, h_prot, thread);
 
-    if (k != NULL) {
+    // Avoid constant pool verification at a safepoint, which takes the Module_lock.
+    if (k != NULL && !SafepointSynchronize::is_at_safepoint()) {
       // Make sure that resolving is legal
       EXCEPTION_MARK;
       // return NULL if verification fails
--- a/src/hotspot/share/oops/klass.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/oops/klass.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -524,6 +524,18 @@
   virtual void remove_java_mirror();
   virtual void restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, TRAPS);
 
+  bool is_unshareable_info_restored() const {
+    assert(is_shared(), "use this for shared classes only");
+    if (has_raw_archived_mirror()) {
+      // _java_mirror is not a valid OopHandle but rather an encoded reference in the shared heap
+      return false;
+    } else if (_java_mirror.ptr_raw() == NULL) {
+      return false;
+    } else {
+      return true;
+    }
+  }
+
  public:
   // subclass accessor (here for convenience; undefined for non-klass objects)
   virtual bool is_leaf_class() const { fatal("not a class"); return false; }
--- a/src/hotspot/share/oops/method.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/oops/method.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -603,7 +603,7 @@
   void compute_size_of_parameters(Thread *thread); // word size of parameters (receiver if any + arguments)
   Symbol* klass_name() const;                    // returns the name of the method holder
   BasicType result_type() const;                 // type of the method result
-  bool is_returning_oop() const                  { BasicType r = result_type(); return (r == T_OBJECT || r == T_ARRAY); }
+  bool is_returning_oop() const                  { BasicType r = result_type(); return is_reference_type(r); }
   bool is_returning_fp() const                   { BasicType r = result_type(); return (r == T_FLOAT || r == T_DOUBLE); }
 
   // Checked exceptions thrown by this method (resolved to mirrors)
--- a/src/hotspot/share/oops/methodData.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/oops/methodData.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -216,7 +216,7 @@
     args_cell = TypeStackSlotEntries::compute_cell_count(inv.signature(), false, TypeProfileArgsLimit);
   }
   int ret_cell = 0;
-  if (MethodData::profile_return_for_invoke(m, bci) && (inv.result_type() == T_OBJECT || inv.result_type() == T_ARRAY)) {
+  if (MethodData::profile_return_for_invoke(m, bci) && is_reference_type(inv.result_type())) {
     ret_cell = ReturnTypeEntry::static_cell_count();
   }
   int header_cell = 0;
@@ -289,7 +289,7 @@
   }
 
   if (has_return()) {
-    assert(inv.result_type() == T_OBJECT || inv.result_type() == T_ARRAY, "room for a ret type but doesn't return obj?");
+    assert(is_reference_type(inv.result_type()), "room for a ret type but doesn't return obj?");
     _ret.post_initialize();
   }
 }
@@ -310,7 +310,7 @@
   }
 
   if (has_return()) {
-    assert(inv.result_type() == T_OBJECT || inv.result_type() == T_ARRAY, "room for a ret type but doesn't return obj?");
+    assert(is_reference_type(inv.result_type()), "room for a ret type but doesn't return obj?");
     _ret.post_initialize();
   }
 }
--- a/src/hotspot/share/opto/arraycopynode.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/opto/arraycopynode.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -268,8 +268,8 @@
 
     BasicType src_elem  = ary_src->klass()->as_array_klass()->element_type()->basic_type();
     BasicType dest_elem = ary_dest->klass()->as_array_klass()->element_type()->basic_type();
-    if (src_elem  == T_ARRAY)  src_elem  = T_OBJECT;
-    if (dest_elem == T_ARRAY)  dest_elem = T_OBJECT;
+    if (is_reference_type(src_elem))   src_elem  = T_OBJECT;
+    if (is_reference_type(dest_elem))  dest_elem = T_OBJECT;
 
     if (src_elem != dest_elem || dest_elem == T_VOID) {
       // We don't know if arguments are arrays of the same type
@@ -328,7 +328,7 @@
 
     assert(phase->type(src->in(AddPNode::Offset))->is_intptr_t()->get_con() == phase->type(dest->in(AddPNode::Offset))->is_intptr_t()->get_con(), "same start offset?");
     BasicType elem = ary_src->klass()->as_array_klass()->element_type()->basic_type();
-    if (elem == T_ARRAY)  elem = T_OBJECT;
+    if (is_reference_type(elem))  elem = T_OBJECT;
 
     BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
     if (bs->array_copy_requires_gc_barriers(true, elem, true, BarrierSetC2::Optimization)) {
--- a/src/hotspot/share/opto/doCall.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/opto/doCall.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -702,8 +702,8 @@
         } else if (rt == T_INT || is_subword_type(rt)) {
           // Nothing.  These cases are handled in lambda form bytecode.
           assert(ct == T_INT || is_subword_type(ct), "must match: rt=%s, ct=%s", type2name(rt), type2name(ct));
-        } else if (rt == T_OBJECT || rt == T_ARRAY) {
-          assert(ct == T_OBJECT || ct == T_ARRAY, "rt=%s, ct=%s", type2name(rt), type2name(ct));
+        } else if (is_reference_type(rt)) {
+          assert(is_reference_type(ct), "rt=%s, ct=%s", type2name(rt), type2name(ct));
           if (ctype->is_loaded()) {
             const TypeOopPtr* arg_type = TypeOopPtr::make_from_klass(rtype->as_klass());
             const Type*       sig_type = TypeOopPtr::make_from_klass(ctype->as_klass());
@@ -750,7 +750,7 @@
       set_bci(iter().cur_bci()); // put it back
     }
     BasicType ct = ctype->basic_type();
-    if (ct == T_OBJECT || ct == T_ARRAY) {
+    if (is_reference_type(ct)) {
       record_profiled_return_for_speculation();
     }
   }
--- a/src/hotspot/share/opto/escape.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/opto/escape.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -2113,7 +2113,8 @@
       }
     }
   }
-  return (bt == T_OBJECT || bt == T_NARROWOOP || bt == T_ARRAY);
+  // Note: T_NARROWOOP is not classed as a real reference type
+  return (is_reference_type(bt) || bt == T_NARROWOOP);
 }
 
 // Returns unique pointed java object or NULL.
--- a/src/hotspot/share/opto/graphKit.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/opto/graphKit.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -2276,7 +2276,7 @@
   int skip = Bytecodes::has_receiver(bc) ? 1 : 0;
   for (int j = skip, i = 0; j < nargs && i < TypeProfileArgsLimit; j++) {
     const Type *targ = tf->domain()->field_at(j + TypeFunc::Parms);
-    if (targ->basic_type() == T_OBJECT || targ->basic_type() == T_ARRAY) {
+    if (is_reference_type(targ->basic_type())) {
       ProfilePtrKind ptr_kind = ProfileMaybeNull;
       ciKlass* better_type = NULL;
       if (method()->argument_profiled_type(bci(), i, better_type, ptr_kind)) {
--- a/src/hotspot/share/opto/library_call.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/opto/library_call.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -2382,7 +2382,7 @@
   guarantee( is_store || kind != Release, "Release accesses can be produced only for stores");
   assert(type != T_OBJECT || !unaligned, "unaligned access not supported with object type");
 
-  if (type == T_OBJECT || type == T_ARRAY) {
+  if (is_reference_type(type)) {
     decorators |= ON_UNKNOWN_OOP_REF;
   }
 
@@ -2730,7 +2730,7 @@
   Compile::AliasType* alias_type = C->alias_type(adr_type);
   BasicType bt = alias_type->basic_type();
   if (bt != T_ILLEGAL &&
-      ((bt == T_OBJECT || bt == T_ARRAY) != (type == T_OBJECT))) {
+      (is_reference_type(bt) != (type == T_OBJECT))) {
     // Don't intrinsify mismatched object accesses.
     return false;
   }
@@ -2767,7 +2767,7 @@
 
   int alias_idx = C->get_alias_index(adr_type);
 
-  if (type == T_OBJECT || type == T_ARRAY) {
+  if (is_reference_type(type)) {
     decorators |= IN_HEAP | ON_UNKNOWN_OOP_REF;
 
     // Transformation of a value which could be NULL pointer (CastPP #NULL)
@@ -4817,8 +4817,8 @@
   if (has_src && has_dest && can_emit_guards) {
     BasicType src_elem  = top_src->klass()->as_array_klass()->element_type()->basic_type();
     BasicType dest_elem = top_dest->klass()->as_array_klass()->element_type()->basic_type();
-    if (src_elem  == T_ARRAY)  src_elem  = T_OBJECT;
-    if (dest_elem == T_ARRAY)  dest_elem = T_OBJECT;
+    if (is_reference_type(src_elem))   src_elem  = T_OBJECT;
+    if (is_reference_type(dest_elem))  dest_elem = T_OBJECT;
 
     if (src_elem == dest_elem && src_elem == T_OBJECT) {
       // If both arrays are object arrays then having the exact types
--- a/src/hotspot/share/opto/loopopts.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/opto/loopopts.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -1443,6 +1443,20 @@
               // Such nodes should only have ProjNodes as outs, e.g. IfNode
               // should only have IfTrueNode and IfFalseNode (4985384).
               x_ctrl = find_non_split_ctrl(x_ctrl);
+
+              IdealLoopTree* x_loop = get_loop(x_ctrl);
+              Node* x_head = x_loop->_head;
+              if (x_head->is_Loop() && (x_head->is_OuterStripMinedLoop() || x_head->as_Loop()->is_strip_mined()) && is_dominator(n_ctrl, x_head)) {
+                // Anti dependence analysis is sometimes too
+                // conservative: a store in the outer strip mined loop
+                // can prevent a load from floating out of the outer
+                // strip mined loop but the load may not be referenced
+                // from the safepoint: loop strip mining verification
+                // code reports a problem in that case. Make sure the
+                // load is not moved in the outer strip mined loop in
+                // that case.
+                x_ctrl = x_head->as_Loop()->skip_strip_mined()->in(LoopNode::EntryControl);
+              }
               assert(dom_depth(n_ctrl) <= dom_depth(x_ctrl), "n is later than its clone");
 
               x->set_req(0, x_ctrl);
@@ -1718,7 +1732,7 @@
 #ifdef ASSERT
     if (loop->_head->as_Loop()->is_strip_mined() && outer_loop->is_member(use_loop) && !loop->is_member(use_loop) && old_new[use->_idx] == NULL) {
       Node* sfpt = loop->_head->as_CountedLoop()->outer_safepoint();
-      assert(mode == ControlAroundStripMined && use == sfpt, "missed a node");
+      assert(mode == ControlAroundStripMined && (use == sfpt || !use->is_reachable_from_root()), "missed a node");
     }
 #endif
     if (!loop->is_member(use_loop) && !outer_loop->is_member(use_loop) && (!old->is_CFG() || !use->is_CFG())) {
--- a/src/hotspot/share/opto/macro.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/opto/macro.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -357,19 +357,38 @@
     if (ac->modifies(offset, offset, &_igvn, true)) {
       assert(ac->in(ArrayCopyNode::Dest) == alloc->result_cast(), "arraycopy destination should be allocation's result");
       uint shift = exact_log2(type2aelembytes(bt));
-      Node* diff = _igvn.transform(new SubINode(ac->in(ArrayCopyNode::SrcPos), ac->in(ArrayCopyNode::DestPos)));
-#ifdef _LP64
-      diff = _igvn.transform(new ConvI2LNode(diff));
-#endif
-      diff = _igvn.transform(new LShiftXNode(diff, intcon(shift)));
+      Node* src_pos = ac->in(ArrayCopyNode::SrcPos);
+      Node* dest_pos = ac->in(ArrayCopyNode::DestPos);
+      const TypeInt* src_pos_t = _igvn.type(src_pos)->is_int();
+      const TypeInt* dest_pos_t = _igvn.type(dest_pos)->is_int();
 
-      Node* off = _igvn.transform(new AddXNode(MakeConX(offset), diff));
-      Node* base = ac->in(ArrayCopyNode::Src);
-      Node* adr = _igvn.transform(new AddPNode(base, base, off));
-      const TypePtr* adr_type = _igvn.type(base)->is_ptr()->add_offset(offset);
-      if (ac->in(ArrayCopyNode::Src) == ac->in(ArrayCopyNode::Dest)) {
-        // Don't emit a new load from src if src == dst but try to get the value from memory instead
-        return value_from_mem(ac->in(TypeFunc::Memory), ctl, ft, ftype, adr_type->isa_oopptr(), alloc);
+      Node* adr = NULL;
+      const TypePtr* adr_type = NULL;
+      if (src_pos_t->is_con() && dest_pos_t->is_con()) {
+        intptr_t off = ((src_pos_t->get_con() - dest_pos_t->get_con()) << shift) + offset;
+        Node* base = ac->in(ArrayCopyNode::Src);
+        adr = _igvn.transform(new AddPNode(base, base, MakeConX(off)));
+        adr_type = _igvn.type(base)->is_ptr()->add_offset(off);
+        if (ac->in(ArrayCopyNode::Src) == ac->in(ArrayCopyNode::Dest)) {
+          // Don't emit a new load from src if src == dst but try to get the value from memory instead
+          return value_from_mem(ac->in(TypeFunc::Memory), ctl, ft, ftype, adr_type->isa_oopptr(), alloc);
+        }
+      } else {
+        Node* diff = _igvn.transform(new SubINode(ac->in(ArrayCopyNode::SrcPos), ac->in(ArrayCopyNode::DestPos)));
+#ifdef _LP64
+        diff = _igvn.transform(new ConvI2LNode(diff));
+#endif
+        diff = _igvn.transform(new LShiftXNode(diff, intcon(shift)));
+
+        Node* off = _igvn.transform(new AddXNode(MakeConX(offset), diff));
+        Node* base = ac->in(ArrayCopyNode::Src);
+        adr = _igvn.transform(new AddPNode(base, base, off));
+        adr_type = _igvn.type(base)->is_ptr()->add_offset(Type::OffsetBot);
+        if (ac->in(ArrayCopyNode::Src) == ac->in(ArrayCopyNode::Dest)) {
+          // Non constant offset in the array: we can't statically
+          // determine the value
+          return NULL;
+        }
       }
       res = LoadNode::make(_igvn, ctl, mem, adr, adr_type, type, bt, MemNode::unordered, LoadNode::UnknownControl);
     }
@@ -791,7 +810,7 @@
 
       const Type *field_type;
       // The next code is taken from Parse::do_get_xxx().
-      if (basic_elem_type == T_OBJECT || basic_elem_type == T_ARRAY) {
+      if (is_reference_type(basic_elem_type)) {
         if (!elem_type->is_loaded()) {
           field_type = TypeInstPtr::BOTTOM;
         } else if (field != NULL && field->is_static_constant()) {
--- a/src/hotspot/share/opto/macroArrayCopy.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/opto/macroArrayCopy.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, 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
@@ -1149,8 +1149,8 @@
   if (top_src != NULL && top_src->klass() != NULL) {
     src_elem = top_src->klass()->as_array_klass()->element_type()->basic_type();
   }
-  if (src_elem  == T_ARRAY)  src_elem  = T_OBJECT;
-  if (dest_elem == T_ARRAY)  dest_elem = T_OBJECT;
+  if (is_reference_type(src_elem))  src_elem  = T_OBJECT;
+  if (is_reference_type(dest_elem)) dest_elem = T_OBJECT;
 
   if (ac->is_arraycopy_validated() &&
       dest_elem != T_CONFLICT &&
--- a/src/hotspot/share/opto/node.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/opto/node.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -704,9 +704,26 @@
   dump();
   return true;
 }
+
+bool Node::is_reachable_from_root() const {
+  ResourceMark rm;
+  Unique_Node_List wq;
+  wq.push((Node*)this);
+  RootNode* root = Compile::current()->root();
+  for (uint i = 0; i < wq.size(); i++) {
+    Node* m = wq.at(i);
+    if (m == root) {
+      return true;
+    }
+    for (DUIterator_Fast jmax, j = m->fast_outs(jmax); j < jmax; j++) {
+      Node* u = m->fast_out(j);
+      wq.push(u);
+    }
+  }
+  return false;
+}
 #endif
 
-
 //------------------------------is_unreachable---------------------------------
 bool Node::is_unreachable(PhaseIterGVN &igvn) const {
   assert(!is_Mach(), "doesn't work with MachNodes");
--- a/src/hotspot/share/opto/node.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/opto/node.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -394,6 +394,7 @@
 #ifdef ASSERT
   bool is_dead() const;
 #define is_not_dead(n) ((n) == NULL || !VerifyIterativeGVN || !((n)->is_dead()))
+  bool is_reachable_from_root() const;
 #endif
   // Check whether node has become unreachable
   bool is_unreachable(PhaseIterGVN &igvn) const;
--- a/src/hotspot/share/opto/parse3.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/opto/parse3.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -139,7 +139,7 @@
   DecoratorSet decorators = IN_HEAP;
   decorators |= is_vol ? MO_SEQ_CST : MO_UNORDERED;
 
-  bool is_obj = bt == T_OBJECT || bt == T_ARRAY;
+  bool is_obj = is_reference_type(bt);
 
   if (is_obj) {
     if (!field->type()->is_loaded()) {
@@ -210,7 +210,7 @@
   DecoratorSet decorators = IN_HEAP;
   decorators |= is_vol ? MO_SEQ_CST : MO_UNORDERED;
 
-  bool is_obj = bt == T_OBJECT || bt == T_ARRAY;
+  bool is_obj = is_reference_type(bt);
 
   // Store the value.
   const Type* field_type;
--- a/src/hotspot/share/opto/type.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/opto/type.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -3004,15 +3004,13 @@
           ciField* field = k->get_field_by_offset(_offset, true);
           assert(field != NULL, "missing field");
           BasicType basic_elem_type = field->layout_type();
-          _is_ptr_to_narrowoop = UseCompressedOops && (basic_elem_type == T_OBJECT ||
-                                                       basic_elem_type == T_ARRAY);
+          _is_ptr_to_narrowoop = UseCompressedOops && is_reference_type(basic_elem_type);
         } else {
           // Instance fields which contains a compressed oop references.
           field = ik->get_field_by_offset(_offset, false);
           if (field != NULL) {
             BasicType basic_elem_type = field->layout_type();
-            _is_ptr_to_narrowoop = UseCompressedOops && (basic_elem_type == T_OBJECT ||
-                                                         basic_elem_type == T_ARRAY);
+            _is_ptr_to_narrowoop = UseCompressedOops && is_reference_type(basic_elem_type);
           } else if (klass()->equals(ciEnv::current()->Object_klass())) {
             // Compile::find_alias_type() cast exactness on all types to verify
             // that it does not affect alias type.
--- a/src/hotspot/share/prims/jni.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/prims/jni.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -1104,7 +1104,7 @@
   JavaCalls::call(result, method, &java_args, CHECK);
 
   // Convert result
-  if (result->get_type() == T_OBJECT || result->get_type() == T_ARRAY) {
+  if (is_reference_type(result->get_type())) {
     result->set_jobject(JNIHandles::make_local(env, (oop) result->get_jobject()));
   }
 }
@@ -1167,7 +1167,7 @@
   JavaCalls::call(result, method, &java_args, CHECK);
 
   // Convert result
-  if (result->get_type() == T_OBJECT || result->get_type() == T_ARRAY) {
+  if (is_reference_type(result->get_type())) {
     result->set_jobject(JNIHandles::make_local(env, (oop) result->get_jobject()));
   }
 }
--- a/src/hotspot/share/prims/jvm.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/prims/jvm.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -773,7 +773,7 @@
   JVMWrapper("JVM_FindPrimitiveClass");
   oop mirror = NULL;
   BasicType t = name2type(utf);
-  if (t != T_ILLEGAL && t != T_OBJECT && t != T_ARRAY) {
+  if (t != T_ILLEGAL && !is_reference_type(t)) {
     mirror = Universe::java_mirror(t);
   }
   if (mirror == NULL) {
--- a/src/hotspot/share/prims/jvmtiExport.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/prims/jvmtiExport.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -1589,7 +1589,7 @@
     if (!exception_exit) {
       oop oop_result;
       BasicType type = current_frame.interpreter_frame_result(&oop_result, &value);
-      if (type == T_OBJECT || type == T_ARRAY) {
+      if (is_reference_type(type)) {
         result = Handle(thread, oop_result);
       }
     }
--- a/src/hotspot/share/prims/methodHandles.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/prims/methodHandles.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -573,7 +573,7 @@
     if (is_subword_type(bt)) {
       bsig = vmSymbols::int_signature();
     } else {
-      assert(bt == T_OBJECT || bt == T_ARRAY, "is_basic_type_signature was false");
+      assert(is_reference_type(bt), "is_basic_type_signature was false");
       bsig = vmSymbols::object_signature();
     }
   } else {
@@ -592,7 +592,7 @@
       if (arg_pos == keep_arg_pos) {
         buffer.write((char*) ss.raw_bytes(),
                      (int)   ss.raw_length());
-      } else if (bt == T_OBJECT || bt == T_ARRAY) {
+      } else if (is_reference_type(bt)) {
         buffer.write(OBJ_SIG, OBJ_SIG_LEN);
       } else {
         if (is_subword_type(bt))
--- a/src/hotspot/share/prims/unsafe.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/prims/unsafe.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -669,7 +669,7 @@
     ClassLoader::unsafe_defineClassCallCounter()->inc();
   }
 
-  body = NEW_C_HEAP_ARRAY(jbyte, length, mtInternal);
+  body = NEW_C_HEAP_ARRAY_RETURN_NULL(jbyte, length, mtInternal);
   if (body == NULL) {
     throw_new(env, "java/lang/OutOfMemoryError");
     return 0;
@@ -685,7 +685,7 @@
     int unicode_len = env->GetStringLength(name);
 
     if (len >= sizeof(buf)) {
-      utfName = NEW_C_HEAP_ARRAY(char, len + 1, mtInternal);
+      utfName = NEW_C_HEAP_ARRAY_RETURN_NULL(char, len + 1, mtInternal);
       if (utfName == NULL) {
         throw_new(env, "java/lang/OutOfMemoryError");
         goto free_body;
@@ -790,7 +790,7 @@
 
   int class_bytes_length = (int) length;
 
-  u1* class_bytes = NEW_C_HEAP_ARRAY(u1, length, mtInternal);
+  u1* class_bytes = NEW_C_HEAP_ARRAY_RETURN_NULL(u1, length, mtInternal);
   if (class_bytes == NULL) {
     THROW_0(vmSymbols::java_lang_OutOfMemoryError());
   }
--- a/src/hotspot/share/runtime/arguments.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/runtime/arguments.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -82,7 +82,6 @@
 bool   Arguments::_xdebug_mode                  = false;
 const char*  Arguments::_java_vendor_url_bug    = DEFAULT_VENDOR_URL_BUG;
 const char*  Arguments::_sun_java_launcher      = DEFAULT_JAVA_LAUNCHER;
-int    Arguments::_sun_java_launcher_pid        = -1;
 bool   Arguments::_sun_java_launcher_is_altjvm  = false;
 
 // These parameters are reset in method parse_vm_init_args()
@@ -361,8 +360,7 @@
 
 // Process java launcher properties.
 void Arguments::process_sun_java_launcher_properties(JavaVMInitArgs* args) {
-  // See if sun.java.launcher, sun.java.launcher.is_altjvm or
-  // sun.java.launcher.pid is defined.
+  // See if sun.java.launcher or sun.java.launcher.is_altjvm is defined.
   // Must do this before setting up other system properties,
   // as some of them may depend on launcher type.
   for (int index = 0; index < args->nOptions; index++) {
@@ -379,10 +377,6 @@
       }
       continue;
     }
-    if (match_option(option, "-Dsun.java.launcher.pid=", &tail)) {
-      _sun_java_launcher_pid = atoi(tail);
-      continue;
-    }
   }
 }
 
@@ -1411,10 +1405,9 @@
   if (strcmp(key, "java.compiler") == 0) {
     process_java_compiler_argument(value);
     // Record value in Arguments, but let it get passed to Java.
-  } else if (strcmp(key, "sun.java.launcher.is_altjvm") == 0 ||
-             strcmp(key, "sun.java.launcher.pid") == 0) {
-    // sun.java.launcher.is_altjvm and sun.java.launcher.pid property are
-    // private and are processed in process_sun_java_launcher_properties();
+  } else if (strcmp(key, "sun.java.launcher.is_altjvm") == 0) {
+    // sun.java.launcher.is_altjvm property is
+    // private and is processed in process_sun_java_launcher_properties();
     // the sun.java.launcher property is passed on to the java application
   } else if (strcmp(key, "sun.boot.library.path") == 0) {
     // append is true, writable is true, internal is false
@@ -3479,10 +3472,8 @@
   size_t file_sep_len = strlen(os::file_separator());
   const size_t len = jvm_path_len + file_sep_len + 20;
   default_archive_path = NEW_C_HEAP_ARRAY(char, len, mtArguments);
-  if (default_archive_path != NULL) {
-    jio_snprintf(default_archive_path, len, "%s%sclasses.jsa",
-      jvm_path, os::file_separator());
-  }
+  jio_snprintf(default_archive_path, len, "%s%sclasses.jsa",
+               jvm_path, os::file_separator());
   return default_archive_path;
 }
 
--- a/src/hotspot/share/runtime/arguments.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/runtime/arguments.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -322,9 +322,6 @@
   // java launcher
   static const char* _sun_java_launcher;
 
-  // sun.java.launcher.pid, private property
-  static int    _sun_java_launcher_pid;
-
   // was this VM created via the -XXaltjvm=<path> option
   static bool   _sun_java_launcher_is_altjvm;
 
@@ -548,8 +545,6 @@
   static bool created_by_java_launcher();
   // -Dsun.java.launcher.is_altjvm
   static bool sun_java_launcher_is_altjvm();
-  // -Dsun.java.launcher.pid
-  static int sun_java_launcher_pid()        { return _sun_java_launcher_pid; }
 
   // -Xrun
   static AgentLibrary* libraries()          { return _libraryList.first(); }
--- a/src/hotspot/share/runtime/fieldDescriptor.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/runtime/fieldDescriptor.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -212,7 +212,7 @@
   // Print a hint as to the underlying integer representation. This can be wrong for
   // pointers on an LP64 machine
 #ifdef _LP64
-  if ((ft == T_OBJECT || ft == T_ARRAY) && UseCompressedOops) {
+  if (is_reference_type(ft) && UseCompressedOops) {
     st->print(" (%x)", obj->int_field(offset()));
   }
   else // <- intended
--- a/src/hotspot/share/runtime/frame.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/runtime/frame.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -723,7 +723,7 @@
 
   void set(int size, BasicType type) {
     _offset -= size;
-    if (type == T_OBJECT || type == T_ARRAY) oop_offset_do();
+    if (is_reference_type(type)) oop_offset_do();
   }
 
   void oop_offset_do() {
@@ -776,7 +776,7 @@
 
   void set(int size, BasicType type) {
     assert (_offset >= 0, "illegal offset");
-    if (type == T_OBJECT || type == T_ARRAY) oop_at_offset_do(_offset);
+    if (is_reference_type(type)) oop_at_offset_do(_offset);
     _offset -= size;
   }
 
@@ -927,7 +927,7 @@
   VMRegPair*      _regs;        // VMReg list of arguments
 
   void set(int size, BasicType type) {
-    if (type == T_OBJECT || type == T_ARRAY) handle_oop_offset();
+    if (is_reference_type(type)) handle_oop_offset();
     _offset += size;
   }
 
--- a/src/hotspot/share/runtime/javaCalls.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/runtime/javaCalls.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -390,7 +390,7 @@
   // Figure out if the result value is an oop or not (Note: This is a different value
   // than result_type. result_type will be T_INT of oops. (it is about size)
   BasicType result_type = runtime_type_from(result);
-  bool oop_result_flag = (result->get_type() == T_OBJECT || result->get_type() == T_ARRAY);
+  bool oop_result_flag = is_reference_type(result->get_type());
 
   // Find receiver
   Handle receiver = (!method->is_static()) ? args->receiver() : Handle();
@@ -619,7 +619,7 @@
   guarantee(method->size_of_parameters() == size_of_parameters(), "wrong no. of arguments pushed");
 
   // Treat T_OBJECT and T_ARRAY as the same
-  if (return_type == T_ARRAY) return_type = T_OBJECT;
+  if (is_reference_type(return_type)) return_type = T_OBJECT;
 
   // Check that oop information is correct
   Symbol* signature = method->signature();
--- a/src/hotspot/share/runtime/mutex.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/runtime/mutex.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -33,24 +33,46 @@
 #include "utilities/macros.hpp"
 
 #ifdef ASSERT
-void Mutex::check_safepoint_state(Thread* thread, bool do_safepoint_check) {
+void Mutex::check_block_state(Thread* thread) {
+  if (!_allow_vm_block && thread->is_VM_thread()) {
+    // JavaThreads are checked to make sure that they do not hold _allow_vm_block locks during operations
+    // that could safepoint.  Make sure the vm thread never uses locks with _allow_vm_block == false.
+    fatal("VM thread could block on lock that may be held by a JavaThread during safepoint: %s", name());
+  }
+
+  assert(!os::ThreadCrashProtection::is_crash_protected(thread),
+         "locking not allowed when crash protection is set");
+}
+
+void Mutex::check_safepoint_state(Thread* thread) {
+  check_block_state(thread);
+
   // If the JavaThread checks for safepoint, verify that the lock wasn't created with safepoint_check_never.
-  SafepointCheckRequired not_allowed = do_safepoint_check ?  Mutex::_safepoint_check_never :
-                                                             Mutex::_safepoint_check_always;
-  assert(!thread->is_active_Java_thread() || _safepoint_check_required != not_allowed,
+  if (thread->is_active_Java_thread()) {
+    assert(_safepoint_check_required != _safepoint_check_never,
+           "This lock should %s have a safepoint check for Java threads: %s",
+           _safepoint_check_required ? "always" : "never", name());
+
+    // Also check NoSafepointVerifier, and thread state is _thread_in_vm
+    thread->check_for_valid_safepoint_state();
+  } else {
+    // If initialized with safepoint_check_never, a NonJavaThread should never ask to safepoint check either.
+    assert(_safepoint_check_required != _safepoint_check_never,
+           "NonJavaThread should not check for safepoint");
+  }
+}
+
+void Mutex::check_no_safepoint_state(Thread* thread) {
+  check_block_state(thread);
+  assert(!thread->is_active_Java_thread() || _safepoint_check_required != _safepoint_check_always,
          "This lock should %s have a safepoint check for Java threads: %s",
          _safepoint_check_required ? "always" : "never", name());
-
-  // If defined with safepoint_check_never, a NonJavaThread should never ask to safepoint check either.
-  assert(thread->is_Java_thread() || !do_safepoint_check || _safepoint_check_required != Mutex::_safepoint_check_never,
-         "NonJavaThread should not check for safepoint");
 }
 #endif // ASSERT
 
-void Mutex::lock(Thread * self) {
-  check_safepoint_state(self, true);
+void Mutex::lock(Thread* self) {
+  check_safepoint_state(self);
 
-  DEBUG_ONLY(check_prelock_state(self, true));
   assert(_owner != self, "invariant");
 
   Mutex* in_flight_mutex = NULL;
@@ -60,7 +82,6 @@
     // The lock is contended
 
   #ifdef ASSERT
-    check_block_state(self);
     if (retry_cnt++ > 3) {
       log_trace(vmmutex)("JavaThread " INTPTR_FORMAT " on %d attempt trying to acquire vmmutex %s", p2i(self), retry_cnt, _name);
     }
@@ -98,7 +119,7 @@
 // in the wrong way this can lead to a deadlock with the safepoint code.
 
 void Mutex::lock_without_safepoint_check(Thread * self) {
-  check_safepoint_state(self, false);
+  check_no_safepoint_state(self);
   assert(_owner != self, "invariant");
   _lock.lock();
   assert_owner(NULL);
@@ -114,8 +135,9 @@
 
 bool Mutex::try_lock() {
   Thread * const self = Thread::current();
-  DEBUG_ONLY(check_prelock_state(self, false);)
-
+  // Some safepoint_check_always locks use try_lock, so cannot check
+  // safepoint state, but can check blocking state.
+  check_block_state(self);
   if (_lock.try_lock()) {
     assert_owner(NULL);
     set_owner(self);
@@ -160,7 +182,6 @@
 
 bool Monitor::wait_without_safepoint_check(long timeout) {
   Thread* const self = Thread::current();
-  check_safepoint_state(self, false);
 
   // timeout is in milliseconds - with zero meaning never timeout
   assert(timeout >= 0, "negative timeout");
@@ -171,6 +192,9 @@
   // conceptually set the owner to NULL in anticipation of
   // abdicating the lock in wait
   set_owner(NULL);
+  // Check safepoint state after resetting owner and possible NSV.
+  check_no_safepoint_state(self);
+
   int wait_status = _lock.wait(timeout);
   set_owner(self);
   return wait_status != 0;          // return true IFF timeout
@@ -178,7 +202,6 @@
 
 bool Monitor::wait(long timeout, bool as_suspend_equivalent) {
   Thread* const self = Thread::current();
-  check_safepoint_state(self, true);
 
   // timeout is in milliseconds - with zero meaning never timeout
   assert(timeout >= 0, "negative timeout");
@@ -193,6 +216,8 @@
   // conceptually set the owner to NULL in anticipation of
   // abdicating the lock in wait
   set_owner(NULL);
+  // Check safepoint state after resetting owner and possible NSV.
+  check_safepoint_state(self);
   JavaThread *jt = (JavaThread *)self;
   Mutex* in_flight_mutex = NULL;
 
@@ -255,7 +280,7 @@
   _rank            = Rank;
   _safepoint_check_required = safepoint_check_required;
 
-  assert(_safepoint_check_required != Mutex::_safepoint_check_sometimes || is_sometimes_ok(name),
+  assert(_safepoint_check_required != _safepoint_check_sometimes || is_sometimes_ok(name),
          "Lock has _safepoint_check_sometimes %s", name);
 #endif
 }
@@ -278,15 +303,27 @@
 // Non-product code
 
 #ifndef PRODUCT
+const char* print_safepoint_check(Mutex::SafepointCheckRequired safepoint_check) {
+  switch (safepoint_check) {
+  case Mutex::_safepoint_check_never:     return "safepoint_check_never";
+  case Mutex::_safepoint_check_sometimes: return "safepoint_check_sometimes";
+  case Mutex::_safepoint_check_always:    return "safepoint_check_always";
+  default: return "";
+  }
+}
+
 void Mutex::print_on(outputStream* st) const {
-  st->print_cr("Mutex: [" PTR_FORMAT "] %s - owner: " PTR_FORMAT,
-               p2i(this), _name, p2i(_owner));
+  st->print("Mutex: [" PTR_FORMAT "] %s - owner: " PTR_FORMAT,
+            p2i(this), _name, p2i(_owner));
+  if (_allow_vm_block) {
+    st->print("%s", " allow_vm_block");
+  }
+  st->print(" %s", print_safepoint_check(_safepoint_check_required));
+  st->cr();
 }
 #endif
 
-#ifndef PRODUCT
 #ifdef ASSERT
-
 void Mutex::assert_owner(Thread * expected) {
   const char* msg = "invalid owner";
   if (expected == NULL) {
@@ -340,7 +377,6 @@
   return res;
 }
 
-
 bool Mutex::contains(Mutex* locks, Mutex* lock) {
   for (; locks != NULL; locks = locks->next()) {
     if (locks == lock) {
@@ -349,7 +385,27 @@
   }
   return false;
 }
-#endif
+
+// NSV implied with locking allow_vm_block or !safepoint_check locks.
+void Mutex::no_safepoint_verifier(Thread* thread, bool enable) {
+  // Threads_lock is special, since the safepoint synchronization will not start before this is
+  // acquired. Hence, a JavaThread cannot be holding it at a safepoint. So is VMOperationRequest_lock,
+  // since it is used to transfer control between JavaThreads and the VMThread
+  // Do not *exclude* any locks unless you are absolutely sure it is correct. Ask someone else first!
+  if ((_allow_vm_block &&
+       this != Threads_lock &&
+       this != Compile_lock &&           // Temporary: should not be necessary when we get separate compilation
+       this != tty_lock &&               // The tty_lock is released for the safepoint.
+       this != VMOperationRequest_lock &&
+       this != VMOperationQueue_lock) ||
+       rank() == Mutex::special) {
+    if (enable) {
+      thread->_no_safepoint_count++;
+    } else {
+      thread->_no_safepoint_count--;
+    }
+  }
+}
 
 // Called immediately after lock acquisition or release as a diagnostic
 // to track the lock-set of the thread and test for rank violations that
@@ -376,7 +432,6 @@
 
     // link "this" into the owned locks list
 
-#ifdef ASSERT  // Thread::_owned_locks is under the same ifdef
     Mutex* locks = get_least_ranked_lock(new_owner->owned_locks());
     // Mutex::set_owner_implementation is a friend of Thread
 
@@ -401,20 +456,21 @@
 
     this->_next = new_owner->_owned_locks;
     new_owner->_owned_locks = this;
-#endif
+
+    // NSV implied with locking allow_vm_block flag.
+    no_safepoint_verifier(new_owner, true);
 
   } else {
     // the thread is releasing this lock
 
     Thread* old_owner = _owner;
-    DEBUG_ONLY(_last_owner = old_owner;)
+    _last_owner = old_owner;
 
     assert(old_owner != NULL, "removing the owner thread of an unowned mutex");
     assert(old_owner == Thread::current(), "removing the owner thread of an unowned mutex");
 
     _owner = NULL; // set the owner
 
-#ifdef ASSERT
     Mutex* locks = old_owner->owned_locks();
 
     // remove "this" from the owned locks list
@@ -434,33 +490,9 @@
       prev->_next = _next;
     }
     _next = NULL;
-#endif
+
+    // ~NSV implied with locking allow_vm_block flag.
+    no_safepoint_verifier(old_owner, false);
   }
 }
-
-
-// Factored out common sanity checks for locking mutex'es. Used by lock() and try_lock()
-void Mutex::check_prelock_state(Thread *thread, bool safepoint_check) {
-  if (safepoint_check) {
-    assert((!thread->is_active_Java_thread() || ((JavaThread *)thread)->thread_state() == _thread_in_vm)
-           || rank() == Mutex::special, "wrong thread state for using locks");
-    if (thread->is_VM_thread() && !allow_vm_block()) {
-      fatal("VM thread using lock %s (not allowed to block on)", name());
-    }
-    DEBUG_ONLY(if (rank() != Mutex::special) \
-               thread->check_for_valid_safepoint_state(false);)
-  }
-  assert(!os::ThreadCrashProtection::is_crash_protected(thread),
-         "locking not allowed when crash protection is set");
-}
-
-void Mutex::check_block_state(Thread *thread) {
-  if (!_allow_vm_block && thread->is_VM_thread()) {
-    warning("VM thread blocked on lock");
-    print();
-    BREAKPOINT;
-  }
-  assert(_owner != thread, "deadlock: blocking on mutex owned by current thread");
-}
-
-#endif // PRODUCT
+#endif // ASSERT
--- a/src/hotspot/share/runtime/mutex.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/runtime/mutex.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -81,21 +81,22 @@
   char _name[MUTEX_NAME_LEN];            // Name of mutex/monitor
 
   // Debugging fields for naming, deadlock detection, etc. (some only used in debug mode)
-#ifndef PRODUCT
-  bool      _allow_vm_block;
-  DEBUG_ONLY(int _rank;)                 // rank (to avoid/detect potential deadlocks)
-  DEBUG_ONLY(Mutex* _next;)              // Used by a Thread to link up owned locks
-  DEBUG_ONLY(Thread* _last_owner;)       // the last thread to own the lock
-  DEBUG_ONLY(static bool contains(Mutex* locks, Mutex* lock);)
-  DEBUG_ONLY(static Mutex* get_least_ranked_lock(Mutex* locks);)
-  DEBUG_ONLY(Mutex* get_least_ranked_lock_besides_this(Mutex* locks);)
-#endif
+#ifdef ASSERT
+  bool    _allow_vm_block;
+  int     _rank;                 // rank (to avoid/detect potential deadlocks)
+  Mutex*  _next;                 // Used by a Thread to link up owned locks
+  Thread* _last_owner;           // the last thread to own the lock
+  static bool contains(Mutex* locks, Mutex* lock);
+  static Mutex* get_least_ranked_lock(Mutex* locks);
+  Mutex* get_least_ranked_lock_besides_this(Mutex* locks);
+#endif  // ASSERT
 
-  void set_owner_implementation(Thread* owner)                        PRODUCT_RETURN;
-  void check_prelock_state     (Thread* thread, bool safepoint_check) PRODUCT_RETURN;
-  void check_block_state       (Thread* thread)                       PRODUCT_RETURN;
-  void check_safepoint_state   (Thread* thread, bool safepoint_check) NOT_DEBUG_RETURN;
+  void set_owner_implementation(Thread* owner)                        NOT_DEBUG({ _owner = owner;});
+  void check_block_state       (Thread* thread)                       NOT_DEBUG_RETURN;
+  void check_safepoint_state   (Thread* thread)                       NOT_DEBUG_RETURN;
+  void check_no_safepoint_state(Thread* thread)                       NOT_DEBUG_RETURN;
   void assert_owner            (Thread* expected)                     NOT_DEBUG_RETURN;
+  void no_safepoint_verifier   (Thread* thread, bool enable)          NOT_DEBUG_RETURN;
 
  public:
   enum {
@@ -171,21 +172,16 @@
   #ifndef PRODUCT
     void print_on(outputStream* st) const;
     void print() const                      { print_on(::tty); }
-    DEBUG_ONLY(int    rank() const          { return _rank; })
-    bool   allow_vm_block()                 { return _allow_vm_block; }
-
-    DEBUG_ONLY(Mutex *next()  const         { return _next; })
-    DEBUG_ONLY(void   set_next(Mutex *next) { _next = next; })
   #endif
+  #ifdef ASSERT
+    int    rank() const          { return _rank; }
+    bool   allow_vm_block()      { return _allow_vm_block; }
 
-  void set_owner(Thread* owner) {
-  #ifndef PRODUCT
-    set_owner_implementation(owner);
-    DEBUG_ONLY(void verify_mutex(Thread* thr);)
-  #else
-    _owner = owner;
-  #endif
-  }
+    Mutex *next()  const         { return _next; }
+    void   set_next(Mutex *next) { _next = next; }
+  #endif // ASSERT
+
+  void set_owner(Thread* owner)             { set_owner_implementation(owner); }
 };
 
 class Monitor : public Mutex {
--- a/src/hotspot/share/runtime/mutexLocker.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/runtime/mutexLocker.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -135,6 +135,7 @@
 Mutex*   MetaspaceExpand_lock         = NULL;
 Mutex*   ClassLoaderDataGraph_lock    = NULL;
 Monitor* ThreadsSMRDelete_lock        = NULL;
+Mutex*   ThreadIdTableCreate_lock     = NULL;
 Mutex*   SharedDecoder_lock           = NULL;
 Mutex*   DCmdFactory_lock             = NULL;
 #if INCLUDE_NMT
@@ -230,7 +231,7 @@
   def(OopMapCacheAlloc_lock        , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_always); // used for oop_map_cache allocation.
 
   def(MetaspaceExpand_lock         , PaddedMutex  , leaf-1,      true,  Monitor::_safepoint_check_never);
-  def(ClassLoaderDataGraph_lock    , PaddedMutex  , nonleaf,     true,  Monitor::_safepoint_check_always);
+  def(ClassLoaderDataGraph_lock    , PaddedMutex  , nonleaf,     false, Monitor::_safepoint_check_always);
 
   def(Patching_lock                , PaddedMutex  , special,     true,  Monitor::_safepoint_check_never);      // used for safepointing and code patching.
   def(CompiledMethod_lock          , PaddedMutex  , special-1,   true,  Monitor::_safepoint_check_never);
@@ -240,7 +241,7 @@
   def(SystemDictionary_lock        , PaddedMonitor, leaf,        true,  Monitor::_safepoint_check_always);
   def(ProtectionDomainSet_lock     , PaddedMutex  , leaf-1,      true,  Monitor::_safepoint_check_never);
   def(SharedDictionary_lock        , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_always);
-  def(Module_lock                  , PaddedMutex  , leaf+2,      true,  Monitor::_safepoint_check_always);
+  def(Module_lock                  , PaddedMutex  , leaf+2,      false, Monitor::_safepoint_check_always);
   def(InlineCacheBuffer_lock       , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_never);
   def(VMStatistic_lock             , PaddedMutex  , leaf,        false, Monitor::_safepoint_check_always);
   def(ExpandHeap_lock              , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_always); // Used during compilation by VM thread
@@ -291,7 +292,7 @@
   def(MethodData_lock              , PaddedMutex  , nonleaf+3,   false, Monitor::_safepoint_check_always);
   def(TouchedMethodLog_lock        , PaddedMutex  , nonleaf+3,   false, Monitor::_safepoint_check_always);
 
-  def(MethodCompileQueue_lock      , PaddedMonitor, nonleaf+4,   true,  Monitor::_safepoint_check_always);
+  def(MethodCompileQueue_lock      , PaddedMonitor, nonleaf+4,   false, Monitor::_safepoint_check_always);
   def(Debug2_lock                  , PaddedMutex  , nonleaf+4,   true,  Monitor::_safepoint_check_never);
   def(Debug3_lock                  , PaddedMutex  , nonleaf+4,   true,  Monitor::_safepoint_check_never);
   def(CompileThread_lock           , PaddedMonitor, nonleaf+5,   false, Monitor::_safepoint_check_always);
@@ -316,7 +317,8 @@
 
   def(CodeHeapStateAnalytics_lock  , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_never);
   def(NMethodSweeperStats_lock     , PaddedMutex  , special,     true,  Monitor::_safepoint_check_never);
-  def(ThreadsSMRDelete_lock        , PaddedMonitor, special,     false, Monitor::_safepoint_check_never);
+  def(ThreadsSMRDelete_lock        , PaddedMonitor, special,     true,  Monitor::_safepoint_check_never);
+  def(ThreadIdTableCreate_lock     , PaddedMutex  , leaf,        false, Monitor::_safepoint_check_always);
   def(SharedDecoder_lock           , PaddedMutex  , native,      false, Monitor::_safepoint_check_never);
   def(DCmdFactory_lock             , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_never);
 #if INCLUDE_NMT
--- a/src/hotspot/share/runtime/mutexLocker.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/runtime/mutexLocker.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -115,6 +115,7 @@
 extern Monitor* PeriodicTask_lock;               // protects the periodic task structure
 extern Monitor* RedefineClasses_lock;            // locks classes from parallel redefinition
 extern Monitor* ThreadsSMRDelete_lock;           // Used by ThreadsSMRSupport to take pressure off the Threads_lock
+extern Mutex*   ThreadIdTableCreate_lock;        // Used by ThreadIdTable to lazily create the thread id table
 extern Mutex*   SharedDecoder_lock;              // serializes access to the decoder during normal (not error reporting) use
 extern Mutex*   DCmdFactory_lock;                // serialize access to DCmdFactory information
 #if INCLUDE_NMT
@@ -149,6 +150,8 @@
 extern Monitor* JVMCI_lock;                      // Monitor to control initialization of JVMCI
 #endif
 
+extern Mutex* tty_lock;                          // lock to synchronize output.
+
 // A MutexLocker provides mutual exclusion with respect to a given mutex
 // for the scope which contains the locker.  The lock is an OS lock, not
 // an object lock, and the two do not interoperate.  Do not use Mutex-based
--- a/src/hotspot/share/runtime/os.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/runtime/os.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -1224,9 +1224,6 @@
     }
 
     char* formatted_path = NEW_C_HEAP_ARRAY(char, formatted_path_len + 1, mtInternal);
-    if (formatted_path == NULL) {
-        return NULL;
-    }
 
     // Create boot classpath from format, substituting separator chars and
     // java home directory.
@@ -1330,9 +1327,6 @@
   }
   const char psepchar = *os::path_separator();
   char* inpath = NEW_C_HEAP_ARRAY(char, strlen(path) + 1, mtInternal);
-  if (inpath == NULL) {
-    return NULL;
-  }
   strcpy(inpath, path);
   size_t count = 1;
   char* p = strchr(inpath, psepchar);
@@ -1357,13 +1351,7 @@
                                     "sun.boot.library.path, to identify potential sources for this path.");
     }
     // allocate the string and add terminator storage
-    char* s  = NEW_C_HEAP_ARRAY_RETURN_NULL(char, len + 1, mtInternal);
-
-    if (s == NULL) {
-      // release allocated storage before returning null
-      free_array_of_char_arrays(opath, i++);
-      return NULL;
-    }
+    char* s = NEW_C_HEAP_ARRAY(char, len + 1, mtInternal);
     strncpy(s, p, len);
     s[len] = '\0';
     opath[i] = s;
--- a/src/hotspot/share/runtime/reflection.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/runtime/reflection.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -92,7 +92,7 @@
   if (type == T_VOID) {
     return NULL;
   }
-  if (type == T_OBJECT || type == T_ARRAY) {
+  if (is_reference_type(type)) {
     // regular objects are not boxed
     return (oop) value->l;
   }
@@ -756,7 +756,7 @@
                                      TRAPS) {
 
 
-  if (T_OBJECT == ss->type() || T_ARRAY == ss->type()) {
+  if (is_reference_type(ss->type())) {
     Symbol* name = ss->as_symbol();
     oop loader = method->method_holder()->class_loader();
     oop protection_domain = method->method_holder()->protection_domain();
--- a/src/hotspot/share/runtime/synchronizer.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/runtime/synchronizer.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -419,7 +419,7 @@
 ObjectLocker::ObjectLocker(Handle obj, Thread* thread, bool do_lock) {
   _dolock = do_lock;
   _thread = thread;
-  _thread->check_for_valid_safepoint_state(false);
+  _thread->check_for_valid_safepoint_state();
   _obj = obj;
 
   if (_dolock) {
--- a/src/hotspot/share/runtime/thread.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/runtime/thread.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -973,6 +973,7 @@
   if (!is_Java_thread()) return;
 
   if (_no_safepoint_count > 0) {
+    print_owned_locks();
     fatal("Possible safepoint reached by thread that does not allow it");
   }
 #ifdef CHECK_UNHANDLED_OOPS
@@ -981,37 +982,18 @@
 #endif // CHECK_UNHANDLED_OOPS
 }
 
-// The flag: potential_vm_operation notifies if this particular safepoint state could potentially
-// invoke the vm-thread (e.g., an oop allocation). In that case, we also have to make sure that
-// no locks which allow_vm_block's are held
-void Thread::check_for_valid_safepoint_state(bool potential_vm_operation) {
+void Thread::check_for_valid_safepoint_state() {
   if (!is_Java_thread()) return;
 
+  // Check NoSafepointVerifier, which is implied by locks taken that can be
+  // shared with the VM thread.  This makes sure that no locks with allow_vm_block
+  // are held.
   check_possible_safepoint();
 
   if (((JavaThread*)this)->thread_state() != _thread_in_vm) {
     fatal("LEAF method calling lock?");
   }
 
-  if (potential_vm_operation && !Universe::is_bootstrapping()) {
-    // Make sure we do not hold any locks that the VM thread also uses.
-    // This could potentially lead to deadlocks
-    for (Mutex* cur = _owned_locks; cur; cur = cur->next()) {
-      // Threads_lock is special, since the safepoint synchronization will not start before this is
-      // acquired. Hence, a JavaThread cannot be holding it at a safepoint. So is VMOperationRequest_lock,
-      // since it is used to transfer control between JavaThreads and the VMThread
-      // Do not *exclude* any locks unless you are absolutely sure it is correct. Ask someone else first!
-      if ((cur->allow_vm_block() &&
-           cur != Threads_lock &&
-           cur != Compile_lock &&               // Temporary: should not be necessary when we get separate compilation
-           cur != VMOperationRequest_lock &&
-           cur != VMOperationQueue_lock) ||
-           cur->rank() == Mutex::special) {
-        fatal("Thread holding lock at safepoint that vm can block on: %s", cur->name());
-      }
-    }
-  }
-
   if (GCALotAtAllSafepoints) {
     // We could enter a safepoint here and thus have a gc
     InterfaceSupport::check_gc_alot();
@@ -1553,9 +1535,6 @@
 // Attempt to enlarge the array for per thread counters.
 jlong* resize_counters_array(jlong* old_counters, int current_size, int new_size) {
   jlong* new_counters = NEW_C_HEAP_ARRAY(jlong, new_size, mtJVMCI);
-  if (new_counters == NULL) {
-    return NULL;
-  }
   if (old_counters == NULL) {
     old_counters = new_counters;
     memset(old_counters, 0, sizeof(jlong) * new_size);
@@ -1572,54 +1551,34 @@
 }
 
 // Attempt to enlarge the array for per thread counters.
-bool JavaThread::resize_counters(int current_size, int new_size) {
-  jlong* new_counters = resize_counters_array(_jvmci_counters, current_size, new_size);
-  if (new_counters == NULL) {
-    return false;
-  } else {
-    _jvmci_counters = new_counters;
-    return true;
-  }
+void JavaThread::resize_counters(int current_size, int new_size) {
+  _jvmci_counters = resize_counters_array(_jvmci_counters, current_size, new_size);
 }
 
 class VM_JVMCIResizeCounters : public VM_Operation {
  private:
   int _new_size;
-  bool _failed;
 
  public:
-  VM_JVMCIResizeCounters(int new_size) : _new_size(new_size), _failed(false) { }
+  VM_JVMCIResizeCounters(int new_size) : _new_size(new_size) { }
   VMOp_Type type()                  const        { return VMOp_JVMCIResizeCounters; }
   bool allow_nested_vm_operations() const        { return true; }
   void doit() {
     // Resize the old thread counters array
     jlong* new_counters = resize_counters_array(JavaThread::_jvmci_old_thread_counters, JVMCICounterSize, _new_size);
-    if (new_counters == NULL) {
-      _failed = true;
-      return;
-    } else {
-      JavaThread::_jvmci_old_thread_counters = new_counters;
-    }
+    JavaThread::_jvmci_old_thread_counters = new_counters;
 
     // Now resize each threads array
     for (JavaThreadIteratorWithHandle jtiwh; JavaThread *tp = jtiwh.next(); ) {
-      if (!tp->resize_counters(JVMCICounterSize, _new_size)) {
-        _failed = true;
-        break;
-      }
+      tp->resize_counters(JVMCICounterSize, _new_size);
     }
-    if (!_failed) {
-      JVMCICounterSize = _new_size;
-    }
-  }
-
-  bool failed() { return _failed; }
+    JVMCICounterSize = _new_size;
+  }
 };
 
-bool JavaThread::resize_all_jvmci_counters(int new_size) {
+void JavaThread::resize_all_jvmci_counters(int new_size) {
   VM_JVMCIResizeCounters op(new_size);
   VMThread::execute(&op);
-  return !op.failed();
 }
 
 #endif // INCLUDE_JVMCI
@@ -1803,7 +1762,10 @@
 void JavaThread::block_if_vm_exited() {
   if (_terminated == _vm_exited) {
     // _vm_exited is set at safepoint, and Threads_lock is never released
-    // we will block here forever
+    // we will block here forever.
+    // Here we can be doing a jump from a safe state to an unsafe state without
+    // proper transition, but it happens after the final safepoint has begun.
+    set_thread_state(_thread_in_vm);
     Threads_lock->lock();
     ShouldNotReachHere();
   }
--- a/src/hotspot/share/runtime/thread.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/runtime/thread.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -753,7 +753,7 @@
 
   // These functions check conditions on a JavaThread before possibly going to a safepoint,
   // including NoSafepointVerifier.
-  void check_for_valid_safepoint_state(bool potential_vm_operation) NOT_DEBUG_RETURN;
+  void check_for_valid_safepoint_state() NOT_DEBUG_RETURN;
   void check_possible_safepoint() NOT_DEBUG_RETURN;
 
  private:
@@ -1143,10 +1143,8 @@
  public:
   static jlong* _jvmci_old_thread_counters;
   static void collect_counters(jlong* array, int length);
-
-  bool resize_counters(int current_size, int new_size);
-
-  static bool resize_all_jvmci_counters(int new_size);
+  void resize_counters(int current_size, int new_size);
+  static void resize_all_jvmci_counters(int new_size);
 
  private:
 #endif // INCLUDE_JVMCI
--- a/src/hotspot/share/runtime/threadSMR.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/runtime/threadSMR.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -26,9 +26,11 @@
 #include "logging/logStream.hpp"
 #include "memory/allocation.inline.hpp"
 #include "runtime/jniHandles.inline.hpp"
+#include "runtime/sharedRuntime.hpp"
 #include "runtime/thread.inline.hpp"
 #include "runtime/threadSMR.inline.hpp"
 #include "runtime/vmOperations.hpp"
+#include "services/threadIdTable.hpp"
 #include "services/threadService.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/globalDefinitions.hpp"
@@ -129,7 +131,6 @@
 // Impl note: See _to_delete_list_cnt note.
 uint                  ThreadsSMRSupport::_to_delete_list_max = 0;
 
-
 // 'inline' functions first so the definitions are before first use:
 
 inline void ThreadsSMRSupport::add_deleted_thread_times(uint add_value) {
@@ -608,16 +609,28 @@
 }
 
 JavaThread* ThreadsList::find_JavaThread_from_java_tid(jlong java_tid) const {
-  for (uint i = 0; i < length(); i++) {
-    JavaThread* thread = thread_at(i);
-    oop tobj = thread->threadObj();
-    // Ignore the thread if it hasn't run yet, has exited
-    // or is starting to exit.
-    if (tobj != NULL && !thread->is_exiting() &&
-        java_tid == java_lang_Thread::thread_id(tobj)) {
-      // found a match
-      return thread;
+  ThreadIdTable::lazy_initialize(this);
+  JavaThread* thread = ThreadIdTable::find_thread_by_tid(java_tid);
+  if (thread == NULL) {
+    // If the thread is not found in the table find it
+    // with a linear search and add to the table.
+    for (uint i = 0; i < length(); i++) {
+      thread = thread_at(i);
+      oop tobj = thread->threadObj();
+      // Ignore the thread if it hasn't run yet, has exited
+      // or is starting to exit.
+      if (tobj != NULL && java_tid == java_lang_Thread::thread_id(tobj)) {
+        MutexLocker ml(Threads_lock);
+        // Must be inside the lock to ensure that we don't add a thread to the table
+        // that has just passed the removal point in ThreadsSMRSupport::remove_thread()
+        if (!thread->is_exiting()) {
+          ThreadIdTable::add_thread(java_tid, thread);
+          return thread;
+        }
+      }
     }
+  } else if (!thread->is_exiting()) {
+    return thread;
   }
   return NULL;
 }
@@ -742,6 +755,10 @@
 
   ThreadsList *old_list = xchg_java_thread_list(new_list);
   free_list(old_list);
+  if (ThreadIdTable::is_initialized()) {
+    jlong tid = SharedRuntime::get_java_tid(thread);
+    ThreadIdTable::add_thread(tid, thread);
+  }
 }
 
 // set_delete_notify() and clear_delete_notify() are called
@@ -909,6 +926,10 @@
 }
 
 void ThreadsSMRSupport::remove_thread(JavaThread *thread) {
+  if (ThreadIdTable::is_initialized()) {
+    jlong tid = SharedRuntime::get_java_tid(thread);
+    ThreadIdTable::remove_thread(tid);
+  }
   ThreadsList *new_list = ThreadsList::remove_thread(ThreadsSMRSupport::get_java_thread_list(), thread);
   if (EnableThreadSMRStatistics) {
     ThreadsSMRSupport::inc_java_thread_list_alloc_cnt();
--- a/src/hotspot/share/runtime/vmThread.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/runtime/vmThread.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -669,7 +669,7 @@
     bool concurrent = op->evaluate_concurrently();
     // only blocking VM operations need to verify the caller's safepoint state:
     if (!concurrent) {
-      t->check_for_valid_safepoint_state(true);
+      t->check_for_valid_safepoint_state();
     }
 
     // New request from Java thread, evaluate prologue
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/services/threadIdTable.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,238 @@
+
+/*
+* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* This code is free software; you can redistribute it and/or modify it
+* under the terms of the GNU General Public License version 2 only, as
+* published by the Free Software Foundation.
+*
+* This code is distributed in the hope that it will be useful, but WITHOUT
+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+* version 2 for more details (a copy is included in the LICENSE file that
+* accompanied this code).
+*
+* You should have received a copy of the GNU General Public License version
+* 2 along with this work; if not, write to the Free Software Foundation,
+* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+*
+* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+* or visit www.oracle.com if you need additional information or have any
+* questions.
+*
+*/
+
+#include "precompiled.hpp"
+#include "runtime/interfaceSupport.inline.hpp"
+#include "runtime/thread.hpp"
+#include "runtime/threadSMR.hpp"
+#include "runtime/timerTrace.hpp"
+#include "services/threadIdTable.hpp"
+#include "utilities/concurrentHashTable.inline.hpp"
+#include "utilities/concurrentHashTableTasks.inline.hpp"
+
+
+typedef ConcurrentHashTable<ThreadIdTableConfig, mtInternal> ThreadIdTableHash;
+
+// 2^24 is max size
+static const size_t END_SIZE = 24;
+// Default initial size 256
+static const size_t DEFAULT_TABLE_SIZE_LOG = 8;
+// Prefer short chains of avg 2
+static const double PREF_AVG_LIST_LEN = 2.0;
+static ThreadIdTableHash* volatile _local_table = NULL;
+static volatile size_t _current_size = 0;
+static volatile size_t _items_count = 0;
+
+volatile bool ThreadIdTable::_is_initialized = false;
+
+class ThreadIdTableEntry : public CHeapObj<mtInternal> {
+private:
+  jlong _tid;
+  JavaThread* _java_thread;
+public:
+  ThreadIdTableEntry(jlong tid, JavaThread* java_thread) :
+    _tid(tid), _java_thread(java_thread) {}
+
+  jlong tid() const { return _tid; }
+  JavaThread* thread() const { return _java_thread; }
+};
+
+class ThreadIdTableConfig : public AllStatic {
+  public:
+    typedef ThreadIdTableEntry* Value;
+
+    static uintx get_hash(Value const& value, bool* is_dead) {
+      jlong tid = value->tid();
+      return primitive_hash(tid);
+    }
+    static void* allocate_node(size_t size, Value const& value) {
+      ThreadIdTable::item_added();
+      return AllocateHeap(size, mtInternal);
+    }
+    static void free_node(void* memory, Value const& value) {
+      delete value;
+      FreeHeap(memory);
+      ThreadIdTable::item_removed();
+    }
+};
+
+static size_t ceil_log2(size_t val) {
+  size_t ret;
+  for (ret = 1; ((size_t)1 << ret) < val; ++ret);
+  return ret;
+}
+
+// Lazily creates the table and populates it with the given
+// thread list
+void ThreadIdTable::lazy_initialize(const ThreadsList *threads) {
+  if (!_is_initialized) {
+    {
+      // There is no obvious benefits in allowing the thread table
+      // to be concurently populated during the initalization.
+      MutexLocker ml(ThreadIdTableCreate_lock);
+      if (_is_initialized) {
+        return;
+      }
+      create_table(threads->length());
+      _is_initialized = true;
+    }
+    for (uint i = 0; i < threads->length(); i++) {
+      JavaThread* thread = threads->thread_at(i);
+      oop tobj = thread->threadObj();
+      if (tobj != NULL) {
+        jlong java_tid = java_lang_Thread::thread_id(tobj);
+        MutexLocker ml(Threads_lock);
+        if (!thread->is_exiting()) {
+          // Must be inside the lock to ensure that we don't add a thread to the table
+          // that has just passed the removal point in ThreadsSMRSupport::remove_thread()
+          add_thread(java_tid, thread);
+        }
+      }
+    }
+  }
+}
+
+void ThreadIdTable::create_table(size_t size) {
+  assert(_local_table == NULL, "Thread table is already created");
+  size_t size_log = ceil_log2(size);
+  size_t start_size_log =
+      size_log > DEFAULT_TABLE_SIZE_LOG ? size_log : DEFAULT_TABLE_SIZE_LOG;
+  _current_size = (size_t)1 << start_size_log;
+  _local_table = new ThreadIdTableHash(start_size_log, END_SIZE);
+}
+
+void ThreadIdTable::item_added() {
+  Atomic::inc(&_items_count);
+  log_trace(thread, table) ("Thread entry added");
+}
+
+void ThreadIdTable::item_removed() {
+  Atomic::dec(&_items_count);
+  log_trace(thread, table) ("Thread entry removed");
+}
+
+double ThreadIdTable::get_load_factor() {
+  return ((double)_items_count) / _current_size;
+}
+
+size_t ThreadIdTable::table_size() {
+  return (size_t)1 << _local_table->get_size_log2(Thread::current());
+}
+
+void ThreadIdTable::grow(JavaThread* jt) {
+  ThreadIdTableHash::GrowTask gt(_local_table);
+  if (!gt.prepare(jt)) {
+    return;
+  }
+  log_trace(thread, table)("Started to grow");
+  TraceTime timer("Grow", TRACETIME_LOG(Debug, membername, table, perf));
+  while (gt.do_task(jt)) {
+    gt.pause(jt);
+    {
+      ThreadBlockInVM tbivm(jt);
+    }
+    gt.cont(jt);
+  }
+  gt.done(jt);
+  _current_size = table_size();
+  log_info(thread, table)("Grown to size:" SIZE_FORMAT, _current_size);
+}
+
+class ThreadIdTableLookup : public StackObj {
+private:
+  jlong _tid;
+  uintx _hash;
+public:
+  ThreadIdTableLookup(jlong tid)
+    : _tid(tid), _hash(primitive_hash(tid)) {}
+  uintx get_hash() const {
+    return _hash;
+  }
+  bool equals(ThreadIdTableEntry** value, bool* is_dead) {
+    bool equals = primitive_equals(_tid, (*value)->tid());
+    if (!equals) {
+      return false;
+    }
+    return true;
+  }
+};
+
+class ThreadGet : public StackObj {
+private:
+  JavaThread* _return;
+public:
+  ThreadGet(): _return(NULL) {}
+  void operator()(ThreadIdTableEntry** val) {
+    _return = (*val)->thread();
+  }
+  JavaThread* get_res_thread() {
+    return _return;
+  }
+};
+
+void ThreadIdTable::grow_if_required() {
+  assert(Thread::current()->is_Java_thread(),"Must be Java thread");
+  assert(_is_initialized, "Thread table is not initialized");
+  double load_factor = get_load_factor();
+  log_debug(thread, table)("Concurrent work, load factor: %g", load_factor);
+  if (load_factor > PREF_AVG_LIST_LEN && !_local_table->is_max_size_reached()) {
+    grow(JavaThread::current());
+  }
+}
+
+JavaThread* ThreadIdTable::add_thread(jlong tid, JavaThread* java_thread) {
+  assert(_is_initialized, "Thread table is not initialized");
+  Thread* thread = Thread::current();
+  ThreadIdTableLookup lookup(tid);
+  ThreadGet tg;
+  while (true) {
+    if (_local_table->get(thread, lookup, tg)) {
+      return tg.get_res_thread();
+    }
+    ThreadIdTableEntry* entry = new ThreadIdTableEntry(tid, java_thread);
+    // The hash table takes ownership of the ThreadTableEntry,
+    // even if it's not inserted.
+    if (_local_table->insert(thread, lookup, entry)) {
+      grow_if_required();
+      return java_thread;
+    }
+  }
+}
+
+JavaThread* ThreadIdTable::find_thread_by_tid(jlong tid) {
+  assert(_is_initialized, "Thread table is not initialized");
+  Thread* thread = Thread::current();
+  ThreadIdTableLookup lookup(tid);
+  ThreadGet tg;
+  _local_table->get(thread, lookup, tg);
+  return tg.get_res_thread();
+}
+
+bool ThreadIdTable::remove_thread(jlong tid) {
+  assert(_is_initialized, "Thread table is not initialized");
+  Thread* thread = Thread::current();
+  ThreadIdTableLookup lookup(tid);
+  return _local_table->remove(thread, lookup);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/services/threadIdTable.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,62 @@
+
+/*
+* 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.
+*
+*/
+
+#ifndef SHARE_SERVICES_THREADIDTABLE_HPP
+#define SHARE_SERVICES_THREADIDTABLE_HPP
+
+#include "memory/allocation.hpp"
+
+class JavaThread;
+class ThreadsList;
+class ThreadIdTableConfig;
+
+class ThreadIdTable : public AllStatic {
+  friend class ThreadIdTableConfig;
+
+  static volatile bool _is_initialized;
+
+public:
+  // Initialization
+  static void lazy_initialize(const ThreadsList* threads);
+  static bool is_initialized() { return _is_initialized; }
+
+  // Lookup and list management
+  static JavaThread* find_thread_by_tid(jlong tid);
+  static JavaThread* add_thread(jlong tid, JavaThread* thread);
+  static bool remove_thread(jlong tid);
+
+private:
+  static void create_table(size_t size);
+
+  static size_t table_size();
+  static double get_load_factor();
+  static void grow_if_required();
+  static void grow(JavaThread* jt);
+
+  static void item_added();
+  static void item_removed();
+};
+
+#endif // SHARE_SERVICES_THREADIDTABLE_HPP
--- a/src/hotspot/share/utilities/concurrentHashTable.inline.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/utilities/concurrentHashTable.inline.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -999,8 +999,8 @@
 {
   _stats_rate = TableRateStatistics();
   _resize_lock =
-    new Mutex(Mutex::leaf, "ConcurrentHashTable", false,
-              Monitor::_safepoint_check_never);
+    new Mutex(Mutex::leaf, "ConcurrentHashTable", true,
+              Mutex::_safepoint_check_never);
   _table = new InternalTable(log2size);
   assert(log2size_limit >= log2size, "bad ergo");
   _size_limit_reached = _table->_log2_size == _log2_size_limit;
--- a/src/hotspot/share/utilities/events.hpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/hotspot/share/utilities/events.hpp	Wed Sep 25 22:40:41 2019 +0200
@@ -100,7 +100,7 @@
 
  public:
   EventLogBase<T>(const char* name, const char* handle, int length = LogEventsBufferEntries):
-    _mutex(Mutex::event, name, false, Monitor::_safepoint_check_never),
+    _mutex(Mutex::event, name, true, Mutex::_safepoint_check_never),
     _name(name),
     _handle(handle),
     _length(length),
--- a/src/java.base/macosx/classes/sun/nio/ch/KQueueSelectorProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/macosx/classes/sun/nio/ch/KQueueSelectorProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -27,6 +27,7 @@
 
 import java.io.IOException;
 import java.nio.channels.spi.AbstractSelector;
+import java.nio.channels.*;
 
 public class KQueueSelectorProvider
     extends SelectorProviderImpl
@@ -34,4 +35,8 @@
     public AbstractSelector openSelector() throws IOException {
         return new KQueueSelectorImpl(this);
     }
+
+    public Channel inheritedChannel() throws IOException {
+        return InheritedChannel.getChannel();
+    }
 }
--- a/src/java.base/macosx/native/libjli/java_md_macosx.m	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/macosx/native/libjli/java_md_macosx.m	Wed Sep 25 22:40:41 2019 +0200
@@ -757,10 +757,6 @@
     return rslt;
 }
 
-void SetJavaLauncherPlatformProps() {
-   /* Linux only */
-}
-
 static JavaVM* jvmInstance = NULL;
 static jboolean sameThread = JNI_FALSE; /* start VM in current thread */
 
--- a/src/java.base/share/classes/java/io/BufferedInputStream.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/BufferedInputStream.java	Wed Sep 25 22:40:41 2019 +0200
@@ -29,20 +29,20 @@
 import jdk.internal.util.ArraysSupport;
 
 /**
- * A <code>BufferedInputStream</code> adds
+ * A {@code BufferedInputStream} adds
  * functionality to another input stream-namely,
  * the ability to buffer the input and to
- * support the <code>mark</code> and <code>reset</code>
- * methods. When  the <code>BufferedInputStream</code>
+ * support the {@code mark} and {@code reset}
+ * methods. When  the {@code BufferedInputStream}
  * is created, an internal buffer array is
  * created. As bytes  from the stream are read
  * or skipped, the internal buffer is refilled
  * as necessary  from the contained input stream,
- * many bytes at a time. The <code>mark</code>
+ * many bytes at a time. The {@code mark}
  * operation  remembers a point in the input
- * stream and the <code>reset</code> operation
+ * stream and the {@code reset} operation
  * causes all the  bytes read since the most
- * recent <code>mark</code> operation to be
+ * recent {@code mark} operation to be
  * reread before new bytes are  taken from
  * the contained input stream.
  *
@@ -81,23 +81,23 @@
      * The index one greater than the index of the last valid byte in
      * the buffer.
      * This value is always
-     * in the range <code>0</code> through <code>buf.length</code>;
-     * elements <code>buf[0]</code>  through <code>buf[count-1]
-     * </code>contain buffered input data obtained
+     * in the range {@code 0} through {@code buf.length};
+     * elements {@code buf[0]} through {@code buf[count-1]}
+     * contain buffered input data obtained
      * from the underlying  input stream.
      */
     protected int count;
 
     /**
      * The current position in the buffer. This is the index of the next
-     * character to be read from the <code>buf</code> array.
+     * character to be read from the {@code buf} array.
      * <p>
-     * This value is always in the range <code>0</code>
-     * through <code>count</code>. If it is less
-     * than <code>count</code>, then  <code>buf[pos]</code>
+     * This value is always in the range {@code 0}
+     * through {@code count}. If it is less
+     * than {@code count}, then  {@code buf[pos]}
      * is the next byte to be supplied as input;
-     * if it is equal to <code>count</code>, then
-     * the  next <code>read</code> or <code>skip</code>
+     * if it is equal to {@code count}, then
+     * the  next {@code read} or {@code skip}
      * operation will require more bytes to be
      * read from the contained  input stream.
      *
@@ -106,28 +106,28 @@
     protected int pos;
 
     /**
-     * The value of the <code>pos</code> field at the time the last
-     * <code>mark</code> method was called.
+     * The value of the {@code pos} field at the time the last
+     * {@code mark} method was called.
      * <p>
      * This value is always
-     * in the range <code>-1</code> through <code>pos</code>.
+     * in the range {@code -1} through {@code pos}.
      * If there is no marked position in  the input
-     * stream, this field is <code>-1</code>. If
+     * stream, this field is {@code -1}. If
      * there is a marked position in the input
-     * stream,  then <code>buf[markpos]</code>
+     * stream,  then {@code buf[markpos]}
      * is the first byte to be supplied as input
-     * after a <code>reset</code> operation. If
-     * <code>markpos</code> is not <code>-1</code>,
-     * then all bytes from positions <code>buf[markpos]</code>
-     * through  <code>buf[pos-1]</code> must remain
+     * after a {@code reset} operation. If
+     * {@code markpos} is not {@code -1},
+     * then all bytes from positions {@code buf[markpos]}
+     * through  {@code buf[pos-1]} must remain
      * in the buffer array (though they may be
      * moved to  another place in the buffer array,
      * with suitable adjustments to the values
-     * of <code>count</code>,  <code>pos</code>,
-     * and <code>markpos</code>); they may not
+     * of {@code count},  {@code pos},
+     * and {@code markpos}); they may not
      * be discarded unless and until the difference
-     * between <code>pos</code> and <code>markpos</code>
-     * exceeds <code>marklimit</code>.
+     * between {@code pos} and {@code markpos}
+     * exceeds {@code marklimit}.
      *
      * @see     java.io.BufferedInputStream#mark(int)
      * @see     java.io.BufferedInputStream#pos
@@ -136,12 +136,12 @@
 
     /**
      * The maximum read ahead allowed after a call to the
-     * <code>mark</code> method before subsequent calls to the
-     * <code>reset</code> method fail.
-     * Whenever the difference between <code>pos</code>
-     * and <code>markpos</code> exceeds <code>marklimit</code>,
+     * {@code mark} method before subsequent calls to the
+     * {@code reset} method fail.
+     * Whenever the difference between {@code pos}
+     * and {@code markpos} exceeds {@code marklimit},
      * then the  mark may be dropped by setting
-     * <code>markpos</code> to <code>-1</code>.
+     * {@code markpos} to {@code -1}.
      *
      * @see     java.io.BufferedInputStream#mark(int)
      * @see     java.io.BufferedInputStream#reset()
@@ -171,10 +171,10 @@
     }
 
     /**
-     * Creates a <code>BufferedInputStream</code>
+     * Creates a {@code BufferedInputStream}
      * and saves its  argument, the input stream
-     * <code>in</code>, for later use. An internal
-     * buffer array is created and  stored in <code>buf</code>.
+     * {@code in}, for later use. An internal
+     * buffer array is created and  stored in {@code buf}.
      *
      * @param   in   the underlying input stream.
      */
@@ -183,12 +183,12 @@
     }
 
     /**
-     * Creates a <code>BufferedInputStream</code>
+     * Creates a {@code BufferedInputStream}
      * with the specified buffer size,
      * and saves its  argument, the input stream
-     * <code>in</code>, for later use.  An internal
-     * buffer array of length  <code>size</code>
-     * is created and stored in <code>buf</code>.
+     * {@code in}, for later use.  An internal
+     * buffer array of length  {@code size}
+     * is created and stored in {@code buf}.
      *
      * @param   in     the underlying input stream.
      * @param   size   the buffer size.
@@ -249,10 +249,10 @@
 
     /**
      * See
-     * the general contract of the <code>read</code>
-     * method of <code>InputStream</code>.
+     * the general contract of the {@code read}
+     * method of {@code InputStream}.
      *
-     * @return     the next byte of data, or <code>-1</code> if the end of the
+     * @return     the next byte of data, or {@code -1} if the end of the
      *             stream is reached.
      * @throws     IOException  if this input stream has been closed by
      *                          invoking its {@link #close()} method,
@@ -300,21 +300,21 @@
      * <code>{@link InputStream#read(byte[], int, int) read}</code> method of
      * the <code>{@link InputStream}</code> class.  As an additional
      * convenience, it attempts to read as many bytes as possible by repeatedly
-     * invoking the <code>read</code> method of the underlying stream.  This
-     * iterated <code>read</code> continues until one of the following
+     * invoking the {@code read} method of the underlying stream.  This
+     * iterated {@code read} continues until one of the following
      * conditions becomes true: <ul>
      *
      *   <li> The specified number of bytes have been read,
      *
-     *   <li> The <code>read</code> method of the underlying stream returns
-     *   <code>-1</code>, indicating end-of-file, or
+     *   <li> The {@code read} method of the underlying stream returns
+     *   {@code -1}, indicating end-of-file, or
      *
-     *   <li> The <code>available</code> method of the underlying stream
+     *   <li> The {@code available} method of the underlying stream
      *   returns zero, indicating that further input requests would block.
      *
-     * </ul> If the first <code>read</code> on the underlying stream returns
-     * <code>-1</code> to indicate end-of-file then this method returns
-     * <code>-1</code>.  Otherwise this method returns the number of bytes
+     * </ul> If the first {@code read} on the underlying stream returns
+     * {@code -1} to indicate end-of-file then this method returns
+     * {@code -1}.  Otherwise this method returns the number of bytes
      * actually read.
      *
      * <p> Subclasses of this class are encouraged, but not required, to
@@ -323,7 +323,7 @@
      * @param      b     destination buffer.
      * @param      off   offset at which to start storing bytes.
      * @param      len   maximum number of bytes to read.
-     * @return     the number of bytes read, or <code>-1</code> if the end of
+     * @return     the number of bytes read, or {@code -1} if the end of
      *             the stream has been reached.
      * @throws     IOException  if this input stream has been closed by
      *                          invoking its {@link #close()} method,
@@ -355,8 +355,8 @@
     }
 
     /**
-     * See the general contract of the <code>skip</code>
-     * method of <code>InputStream</code>.
+     * See the general contract of the {@code skip}
+     * method of {@code InputStream}.
      *
      * @throws IOException  if this input stream has been closed by
      *                      invoking its {@link #close()} method,
@@ -413,8 +413,8 @@
     }
 
     /**
-     * See the general contract of the <code>mark</code>
-     * method of <code>InputStream</code>.
+     * See the general contract of the {@code mark}
+     * method of {@code InputStream}.
      *
      * @param   readlimit   the maximum limit of bytes that can be read before
      *                      the mark position becomes invalid.
@@ -426,14 +426,14 @@
     }
 
     /**
-     * See the general contract of the <code>reset</code>
-     * method of <code>InputStream</code>.
+     * See the general contract of the {@code reset}
+     * method of {@code InputStream}.
      * <p>
-     * If <code>markpos</code> is <code>-1</code>
+     * If {@code markpos} is {@code -1}
      * (no mark has been set or the mark has been
-     * invalidated), an <code>IOException</code>
-     * is thrown. Otherwise, <code>pos</code> is
-     * set equal to <code>markpos</code>.
+     * invalidated), an {@code IOException}
+     * is thrown. Otherwise, {@code pos} is
+     * set equal to {@code markpos}.
      *
      * @throws     IOException  if this stream has not been marked or,
      *                  if the mark has been invalidated, or the stream
@@ -449,13 +449,13 @@
     }
 
     /**
-     * Tests if this input stream supports the <code>mark</code>
-     * and <code>reset</code> methods. The <code>markSupported</code>
-     * method of <code>BufferedInputStream</code> returns
-     * <code>true</code>.
+     * Tests if this input stream supports the {@code mark}
+     * and {@code reset} methods. The {@code markSupported}
+     * method of {@code BufferedInputStream} returns
+     * {@code true}.
      *
-     * @return  a <code>boolean</code> indicating if this stream type supports
-     *          the <code>mark</code> and <code>reset</code> methods.
+     * @return  a {@code boolean} indicating if this stream type supports
+     *          the {@code mark} and {@code reset} methods.
      * @see     java.io.InputStream#mark(int)
      * @see     java.io.InputStream#reset()
      */
--- a/src/java.base/share/classes/java/io/BufferedOutputStream.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/BufferedOutputStream.java	Wed Sep 25 22:40:41 2019 +0200
@@ -98,15 +98,15 @@
     }
 
     /**
-     * Writes <code>len</code> bytes from the specified byte array
-     * starting at offset <code>off</code> to this buffered output stream.
+     * Writes {@code len} bytes from the specified byte array
+     * starting at offset {@code off} to this buffered output stream.
      *
      * <p> Ordinarily this method stores bytes from the given array into this
      * stream's buffer, flushing the buffer to the underlying output stream as
      * needed.  If the requested length is at least as large as this stream's
      * buffer, however, then this method will flush the buffer and write the
      * bytes directly to the underlying output stream.  Thus redundant
-     * <code>BufferedOutputStream</code>s will not copy data unnecessarily.
+     * {@code BufferedOutputStream}s will not copy data unnecessarily.
      *
      * @param      b     the data.
      * @param      off   the start offset in the data.
--- a/src/java.base/share/classes/java/io/BufferedReader.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/BufferedReader.java	Wed Sep 25 22:40:41 2019 +0200
@@ -235,22 +235,22 @@
      * <code>{@link Reader#read(char[], int, int) read}</code> method of the
      * <code>{@link Reader}</code> class.  As an additional convenience, it
      * attempts to read as many characters as possible by repeatedly invoking
-     * the <code>read</code> method of the underlying stream.  This iterated
-     * <code>read</code> continues until one of the following conditions becomes
+     * the {@code read} method of the underlying stream.  This iterated
+     * {@code read} continues until one of the following conditions becomes
      * true: <ul>
      *
      *   <li> The specified number of characters have been read,
      *
-     *   <li> The <code>read</code> method of the underlying stream returns
-     *   <code>-1</code>, indicating end-of-file, or
+     *   <li> The {@code read} method of the underlying stream returns
+     *   {@code -1}, indicating end-of-file, or
      *
-     *   <li> The <code>ready</code> method of the underlying stream
-     *   returns <code>false</code>, indicating that further input requests
+     *   <li> The {@code ready} method of the underlying stream
+     *   returns {@code false}, indicating that further input requests
      *   would block.
      *
-     * </ul> If the first <code>read</code> on the underlying stream returns
-     * <code>-1</code> to indicate end-of-file then this method returns
-     * <code>-1</code>.  Otherwise this method returns the number of characters
+     * </ul> If the first {@code read} on the underlying stream returns
+     * {@code -1} to indicate end-of-file then this method returns
+     * {@code -1}.  Otherwise this method returns the number of characters
      * actually read.
      *
      * <p> Subclasses of this class are encouraged, but not required, to
@@ -261,7 +261,7 @@
      * however, the buffer is empty, the mark is not valid, and the requested
      * length is at least as large as the buffer, then this method will read
      * characters directly from the underlying stream into the given array.
-     * Thus redundant <code>BufferedReader</code>s will not copy data
+     * Thus redundant {@code BufferedReader}s will not copy data
      * unnecessarily.
      *
      * @param      cbuf  Destination buffer
@@ -403,7 +403,7 @@
      *
      * @return    The number of characters actually skipped
      *
-     * @throws     IllegalArgumentException  If <code>n</code> is negative.
+     * @throws     IllegalArgumentException  If {@code n} is negative.
      * @throws     IOException  If an I/O error occurs
      */
     public long skip(long n) throws IOException {
--- a/src/java.base/share/classes/java/io/CharArrayReader.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/CharArrayReader.java	Wed Sep 25 22:40:41 2019 +0200
@@ -148,10 +148,10 @@
     /**
      * Skips characters.  Returns the number of characters that were skipped.
      *
-     * <p>The <code>n</code> parameter may be negative, even though the
-     * <code>skip</code> method of the {@link Reader} superclass throws
-     * an exception in this case. If <code>n</code> is negative, then
-     * this method does nothing and returns <code>0</code>.
+     * <p>The {@code n} parameter may be negative, even though the
+     * {@code skip} method of the {@link Reader} superclass throws
+     * an exception in this case. If {@code n} is negative, then
+     * this method does nothing and returns {@code 0}.
      *
      * @param      n The number of characters to skip
      * @return     The number of characters actually skipped
--- a/src/java.base/share/classes/java/io/DataInputStream.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/DataInputStream.java	Wed Sep 25 22:40:41 2019 +0200
@@ -60,34 +60,34 @@
 
     /**
      * Reads some number of bytes from the contained input stream and
-     * stores them into the buffer array <code>b</code>. The number of
+     * stores them into the buffer array {@code b}. The number of
      * bytes actually read is returned as an integer. This method blocks
      * until input data is available, end of file is detected, or an
      * exception is thrown.
      *
-     * <p>If <code>b</code> is null, a <code>NullPointerException</code> is
-     * thrown. If the length of <code>b</code> is zero, then no bytes are
-     * read and <code>0</code> is returned; otherwise, there is an attempt
+     * <p>If {@code b} is null, a {@code NullPointerException} is
+     * thrown. If the length of {@code b} is zero, then no bytes are
+     * read and {@code 0} is returned; otherwise, there is an attempt
      * to read at least one byte. If no byte is available because the
-     * stream is at end of file, the value <code>-1</code> is returned;
-     * otherwise, at least one byte is read and stored into <code>b</code>.
+     * stream is at end of file, the value {@code -1} is returned;
+     * otherwise, at least one byte is read and stored into {@code b}.
      *
-     * <p>The first byte read is stored into element <code>b[0]</code>, the
-     * next one into <code>b[1]</code>, and so on. The number of bytes read
-     * is, at most, equal to the length of <code>b</code>. Let <code>k</code>
+     * <p>The first byte read is stored into element {@code b[0]}, the
+     * next one into {@code b[1]}, and so on. The number of bytes read
+     * is, at most, equal to the length of {@code b}. Let {@code k}
      * be the number of bytes actually read; these bytes will be stored in
-     * elements <code>b[0]</code> through <code>b[k-1]</code>, leaving
-     * elements <code>b[k]</code> through <code>b[b.length-1]</code>
+     * elements {@code b[0]} through {@code b[k-1]}, leaving
+     * elements {@code b[k]} through {@code b[b.length-1]}
      * unaffected.
      *
-     * <p>The <code>read(b)</code> method has the same effect as:
+     * <p>The {@code read(b)} method has the same effect as:
      * <blockquote><pre>
      * read(b, 0, b.length)
      * </pre></blockquote>
      *
      * @param      b   the buffer into which the data is read.
      * @return     the total number of bytes read into the buffer, or
-     *             <code>-1</code> if there is no more data because the end
+     *             {@code -1} if there is no more data because the end
      *             of the stream has been reached.
      * @throws     IOException if the first byte cannot be read for any reason
      *             other than end of file, the stream has been closed and the underlying
@@ -101,43 +101,43 @@
     }
 
     /**
-     * Reads up to <code>len</code> bytes of data from the contained
+     * Reads up to {@code len} bytes of data from the contained
      * input stream into an array of bytes.  An attempt is made to read
-     * as many as <code>len</code> bytes, but a smaller number may be read,
+     * as many as {@code len} bytes, but a smaller number may be read,
      * possibly zero. The number of bytes actually read is returned as an
      * integer.
      *
      * <p> This method blocks until input data is available, end of file is
      * detected, or an exception is thrown.
      *
-     * <p> If <code>len</code> is zero, then no bytes are read and
-     * <code>0</code> is returned; otherwise, there is an attempt to read at
+     * <p> If {@code len} is zero, then no bytes are read and
+     * {@code 0} is returned; otherwise, there is an attempt to read at
      * least one byte. If no byte is available because the stream is at end of
-     * file, the value <code>-1</code> is returned; otherwise, at least one
-     * byte is read and stored into <code>b</code>.
+     * file, the value {@code -1} is returned; otherwise, at least one
+     * byte is read and stored into {@code b}.
      *
-     * <p> The first byte read is stored into element <code>b[off]</code>, the
-     * next one into <code>b[off+1]</code>, and so on. The number of bytes read
-     * is, at most, equal to <code>len</code>. Let <i>k</i> be the number of
+     * <p> The first byte read is stored into element {@code b[off]}, the
+     * next one into {@code b[off+1]}, and so on. The number of bytes read
+     * is, at most, equal to {@code len}. Let <i>k</i> be the number of
      * bytes actually read; these bytes will be stored in elements
-     * <code>b[off]</code> through <code>b[off+</code><i>k</i><code>-1]</code>,
-     * leaving elements <code>b[off+</code><i>k</i><code>]</code> through
-     * <code>b[off+len-1]</code> unaffected.
+     * {@code b[off]} through {@code b[off+}<i>k</i>{@code -1]},
+     * leaving elements {@code b[off+}<i>k</i>{@code ]} through
+     * {@code b[off+len-1]} unaffected.
      *
-     * <p> In every case, elements <code>b[0]</code> through
-     * <code>b[off]</code> and elements <code>b[off+len]</code> through
-     * <code>b[b.length-1]</code> are unaffected.
+     * <p> In every case, elements {@code b[0]} through
+     * {@code b[off]} and elements {@code b[off+len]} through
+     * {@code b[b.length-1]} are unaffected.
      *
      * @param      b     the buffer into which the data is read.
-     * @param      off the start offset in the destination array <code>b</code>
+     * @param      off the start offset in the destination array {@code b}
      * @param      len   the maximum number of bytes read.
      * @return     the total number of bytes read into the buffer, or
-     *             <code>-1</code> if there is no more data because the end
+     *             {@code -1} if there is no more data because the end
      *             of the stream has been reached.
-     * @throws     NullPointerException If <code>b</code> is <code>null</code>.
-     * @throws     IndexOutOfBoundsException If <code>off</code> is negative,
-     *             <code>len</code> is negative, or <code>len</code> is greater than
-     *             <code>b.length - off</code>
+     * @throws     NullPointerException If {@code b} is {@code null}.
+     * @throws     IndexOutOfBoundsException If {@code off} is negative,
+     *             {@code len} is negative, or {@code len} is greater than
+     *             {@code b.length - off}
      * @throws     IOException if the first byte cannot be read for any reason
      *             other than end of file, the stream has been closed and the underlying
      *             input stream does not support reading after close, or another I/O
@@ -205,8 +205,8 @@
     }
 
     /**
-     * See the general contract of the <code>skipBytes</code>
-     * method of <code>DataInput</code>.
+     * See the general contract of the {@code skipBytes}
+     * method of {@code DataInput}.
      * <p>
      * Bytes for this operation are read from the contained
      * input stream.
@@ -230,13 +230,13 @@
     }
 
     /**
-     * See the general contract of the <code>readBoolean</code>
-     * method of <code>DataInput</code>.
+     * See the general contract of the {@code readBoolean}
+     * method of {@code DataInput}.
      * <p>
      * Bytes for this operation are read from the contained
      * input stream.
      *
-     * @return     the <code>boolean</code> value read.
+     * @return     the {@code boolean} value read.
      * @throws     EOFException  if this input stream has reached the end.
      * @throws     IOException   the stream has been closed and the contained
      *             input stream does not support reading after close, or
@@ -251,15 +251,15 @@
     }
 
     /**
-     * See the general contract of the <code>readByte</code>
-     * method of <code>DataInput</code>.
+     * See the general contract of the {@code readByte}
+     * method of {@code DataInput}.
      * <p>
      * Bytes
      * for this operation are read from the contained
      * input stream.
      *
      * @return     the next byte of this input stream as a signed 8-bit
-     *             <code>byte</code>.
+     *             {@code byte}.
      * @throws     EOFException  if this input stream has reached the end.
      * @throws     IOException   the stream has been closed and the contained
      *             input stream does not support reading after close, or
@@ -274,8 +274,8 @@
     }
 
     /**
-     * See the general contract of the <code>readUnsignedByte</code>
-     * method of <code>DataInput</code>.
+     * See the general contract of the {@code readUnsignedByte}
+     * method of {@code DataInput}.
      * <p>
      * Bytes
      * for this operation are read from the contained
@@ -297,8 +297,8 @@
     }
 
     /**
-     * See the general contract of the <code>readShort</code>
-     * method of <code>DataInput</code>.
+     * See the general contract of the {@code readShort}
+     * method of {@code DataInput}.
      * <p>
      * Bytes
      * for this operation are read from the contained
@@ -322,8 +322,8 @@
     }
 
     /**
-     * See the general contract of the <code>readUnsignedShort</code>
-     * method of <code>DataInput</code>.
+     * See the general contract of the {@code readUnsignedShort}
+     * method of {@code DataInput}.
      * <p>
      * Bytes
      * for this operation are read from the contained
@@ -347,15 +347,15 @@
     }
 
     /**
-     * See the general contract of the <code>readChar</code>
-     * method of <code>DataInput</code>.
+     * See the general contract of the {@code readChar}
+     * method of {@code DataInput}.
      * <p>
      * Bytes
      * for this operation are read from the contained
      * input stream.
      *
      * @return     the next two bytes of this input stream, interpreted as a
-     *             <code>char</code>.
+     *             {@code char}.
      * @throws     EOFException  if this input stream reaches the end before
      *               reading two bytes.
      * @throws     IOException   the stream has been closed and the contained
@@ -372,15 +372,15 @@
     }
 
     /**
-     * See the general contract of the <code>readInt</code>
-     * method of <code>DataInput</code>.
+     * See the general contract of the {@code readInt}
+     * method of {@code DataInput}.
      * <p>
      * Bytes
      * for this operation are read from the contained
      * input stream.
      *
      * @return     the next four bytes of this input stream, interpreted as an
-     *             <code>int</code>.
+     *             {@code int}.
      * @throws     EOFException  if this input stream reaches the end before
      *               reading four bytes.
      * @throws     IOException   the stream has been closed and the contained
@@ -401,15 +401,15 @@
     private byte readBuffer[] = new byte[8];
 
     /**
-     * See the general contract of the <code>readLong</code>
-     * method of <code>DataInput</code>.
+     * See the general contract of the {@code readLong}
+     * method of {@code DataInput}.
      * <p>
      * Bytes
      * for this operation are read from the contained
      * input stream.
      *
      * @return     the next eight bytes of this input stream, interpreted as a
-     *             <code>long</code>.
+     *             {@code long}.
      * @throws     EOFException  if this input stream reaches the end before
      *               reading eight bytes.
      * @throws     IOException   the stream has been closed and the contained
@@ -430,15 +430,15 @@
     }
 
     /**
-     * See the general contract of the <code>readFloat</code>
-     * method of <code>DataInput</code>.
+     * See the general contract of the {@code readFloat}
+     * method of {@code DataInput}.
      * <p>
      * Bytes
      * for this operation are read from the contained
      * input stream.
      *
      * @return     the next four bytes of this input stream, interpreted as a
-     *             <code>float</code>.
+     *             {@code float}.
      * @throws     EOFException  if this input stream reaches the end before
      *               reading four bytes.
      * @throws     IOException   the stream has been closed and the contained
@@ -452,15 +452,15 @@
     }
 
     /**
-     * See the general contract of the <code>readDouble</code>
-     * method of <code>DataInput</code>.
+     * See the general contract of the {@code readDouble}
+     * method of {@code DataInput}.
      * <p>
      * Bytes
      * for this operation are read from the contained
      * input stream.
      *
      * @return     the next eight bytes of this input stream, interpreted as a
-     *             <code>double</code>.
+     *             {@code double}.
      * @throws     EOFException  if this input stream reaches the end before
      *               reading eight bytes.
      * @throws     IOException   the stream has been closed and the contained
@@ -476,8 +476,8 @@
     private char lineBuffer[];
 
     /**
-     * See the general contract of the <code>readLine</code>
-     * method of <code>DataInput</code>.
+     * See the general contract of the {@code readLine}
+     * method of {@code DataInput}.
      * <p>
      * Bytes
      * for this operation are read from the contained
@@ -485,9 +485,9 @@
      *
      * @deprecated This method does not properly convert bytes to characters.
      * As of JDK&nbsp;1.1, the preferred way to read lines of text is via the
-     * <code>BufferedReader.readLine()</code> method.  Programs that use the
-     * <code>DataInputStream</code> class to read lines can be converted to use
-     * the <code>BufferedReader</code> class by replacing code of the form:
+     * {@code BufferedReader.readLine()} method.  Programs that use the
+     * {@code DataInputStream} class to read lines can be converted to use
+     * the {@code BufferedReader} class by replacing code of the form:
      * <blockquote><pre>
      *     DataInputStream d =&nbsp;new&nbsp;DataInputStream(in);
      * </pre></blockquote>
@@ -548,8 +548,8 @@
     }
 
     /**
-     * See the general contract of the <code>readUTF</code>
-     * method of <code>DataInput</code>.
+     * See the general contract of the {@code readUTF}
+     * method of {@code DataInput}.
      * <p>
      * Bytes
      * for this operation are read from the contained
@@ -571,13 +571,13 @@
 
     /**
      * Reads from the
-     * stream <code>in</code> a representation
+     * stream {@code in} a representation
      * of a Unicode  character string encoded in
      * <a href="DataInput.html#modified-utf-8">modified UTF-8</a> format;
-     * this string of characters is then returned as a <code>String</code>.
+     * this string of characters is then returned as a {@code String}.
      * The details of the modified UTF-8 representation
-     * are  exactly the same as for the <code>readUTF</code>
-     * method of <code>DataInput</code>.
+     * are  exactly the same as for the {@code readUTF}
+     * method of {@code DataInput}.
      *
      * @param      in   a data input stream.
      * @return     a Unicode string.
--- a/src/java.base/share/classes/java/io/DataOutput.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/DataOutput.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,12 +26,12 @@
 package java.io;
 
 /**
- * The <code>DataOutput</code> interface provides
+ * The {@code DataOutput} interface provides
  * for converting data from any of the Java
  * primitive types to a series of bytes and
  * writing these bytes to a binary stream.
  * There is  also a facility for converting
- * a <code>String</code> into
+ * a {@code String} into
  * <a href="DataInput.html#modified-utf-8">modified UTF-8</a>
  * format and writing the resulting series
  * of bytes.
@@ -39,7 +39,7 @@
  * For all the methods in this interface that
  * write bytes, it is generally true that if
  * a byte cannot be written for any reason,
- * an <code>IOException</code> is thrown.
+ * an {@code IOException} is thrown.
  *
  * @author  Frank Yellin
  * @see     java.io.DataInput
@@ -50,8 +50,8 @@
 interface DataOutput {
     /**
      * Writes to the output stream the eight
-     * low-order bits of the argument <code>b</code>.
-     * The 24 high-order  bits of <code>b</code>
+     * low-order bits of the argument {@code b}.
+     * The 24 high-order  bits of {@code b}
      * are ignored.
      *
      * @param      b   the byte to be written.
@@ -60,14 +60,14 @@
     void write(int b) throws IOException;
 
     /**
-     * Writes to the output stream all the bytes in array <code>b</code>.
-     * If <code>b</code> is <code>null</code>,
-     * a <code>NullPointerException</code> is thrown.
-     * If <code>b.length</code> is zero, then
+     * Writes to the output stream all the bytes in array {@code b}.
+     * If {@code b} is {@code null},
+     * a {@code NullPointerException} is thrown.
+     * If {@code b.length} is zero, then
      * no bytes are written. Otherwise, the byte
-     * <code>b[0]</code> is written first, then
-     * <code>b[1]</code>, and so on; the last byte
-     * written is <code>b[b.length-1]</code>.
+     * {@code b[0]} is written first, then
+     * {@code b[1]}, and so on; the last byte
+     * written is {@code b[b.length-1]}.
      *
      * @param      b   the data.
      * @throws     IOException  if an I/O error occurs.
@@ -75,19 +75,19 @@
     void write(byte b[]) throws IOException;
 
     /**
-     * Writes <code>len</code> bytes from array
-     * <code>b</code>, in order,  to
-     * the output stream.  If <code>b</code>
-     * is <code>null</code>, a <code>NullPointerException</code>
-     * is thrown.  If <code>off</code> is negative,
-     * or <code>len</code> is negative, or <code>off+len</code>
+     * Writes {@code len} bytes from array
+     * {@code b}, in order,  to
+     * the output stream.  If {@code b}
+     * is {@code null}, a {@code NullPointerException}
+     * is thrown.  If {@code off} is negative,
+     * or {@code len} is negative, or {@code off+len}
      * is greater than the length of the array
-     * <code>b</code>, then an <code>IndexOutOfBoundsException</code>
-     * is thrown.  If <code>len</code> is zero,
+     * {@code b}, then an {@code IndexOutOfBoundsException}
+     * is thrown.  If {@code len} is zero,
      * then no bytes are written. Otherwise, the
-     * byte <code>b[off]</code> is written first,
-     * then <code>b[off+1]</code>, and so on; the
-     * last byte written is <code>b[off+len-1]</code>.
+     * byte {@code b[off]} is written first,
+     * then {@code b[off+1]}, and so on; the
+     * last byte written is {@code b[off+len-1]}.
      *
      * @param      b     the data.
      * @param      off   the start offset in the data.
@@ -97,16 +97,16 @@
     void write(byte b[], int off, int len) throws IOException;
 
     /**
-     * Writes a <code>boolean</code> value to this output stream.
-     * If the argument <code>v</code>
-     * is <code>true</code>, the value <code>(byte)1</code>
-     * is written; if <code>v</code> is <code>false</code>,
-     * the  value <code>(byte)0</code> is written.
+     * Writes a {@code boolean} value to this output stream.
+     * If the argument {@code v}
+     * is {@code true}, the value {@code (byte)1}
+     * is written; if {@code v} is {@code false},
+     * the  value {@code (byte)0} is written.
      * The byte written by this method may
-     * be read by the <code>readBoolean</code>
-     * method of interface <code>DataInput</code>,
-     * which will then return a <code>boolean</code>
-     * equal to <code>v</code>.
+     * be read by the {@code readBoolean}
+     * method of interface {@code DataInput},
+     * which will then return a {@code boolean}
+     * equal to {@code v}.
      *
      * @param      v   the boolean to be written.
      * @throws     IOException  if an I/O error occurs.
@@ -115,15 +115,15 @@
 
     /**
      * Writes to the output stream the eight low-
-     * order bits of the argument <code>v</code>.
-     * The 24 high-order bits of <code>v</code>
-     * are ignored. (This means  that <code>writeByte</code>
-     * does exactly the same thing as <code>write</code>
+     * order bits of the argument {@code v}.
+     * The 24 high-order bits of {@code v}
+     * are ignored. (This means  that {@code writeByte}
+     * does exactly the same thing as {@code write}
      * for an integer argument.) The byte written
-     * by this method may be read by the <code>readByte</code>
-     * method of interface <code>DataInput</code>,
-     * which will then return a <code>byte</code>
-     * equal to <code>(byte)v</code>.
+     * by this method may be read by the {@code readByte}
+     * method of interface {@code DataInput},
+     * which will then return a {@code byte}
+     * equal to {@code (byte)v}.
      *
      * @param      v   the byte value to be written.
      * @throws     IOException  if an I/O error occurs.
@@ -140,18 +140,18 @@
      * (byte)(0xff & v)
      * }</pre> <p>
      * The bytes written by this method may be
-     * read by the <code>readShort</code> method
-     * of interface <code>DataInput</code> , which
-     * will then return a <code>short</code> equal
-     * to <code>(short)v</code>.
+     * read by the {@code readShort} method
+     * of interface {@code DataInput} , which
+     * will then return a {@code short} equal
+     * to {@code (short)v}.
      *
-     * @param      v   the <code>short</code> value to be written.
+     * @param      v   the {@code short} value to be written.
      * @throws     IOException  if an I/O error occurs.
      */
     void writeShort(int v) throws IOException;
 
     /**
-     * Writes a <code>char</code> value, which
+     * Writes a {@code char} value, which
      * is comprised of two bytes, to the
      * output stream.
      * The byte values to be written, in the  order
@@ -161,18 +161,18 @@
      * (byte)(0xff & v)
      * }</pre><p>
      * The bytes written by this method may be
-     * read by the <code>readChar</code> method
-     * of interface <code>DataInput</code> , which
-     * will then return a <code>char</code> equal
-     * to <code>(char)v</code>.
+     * read by the {@code readChar} method
+     * of interface {@code DataInput} , which
+     * will then return a {@code char} equal
+     * to {@code (char)v}.
      *
-     * @param      v   the <code>char</code> value to be written.
+     * @param      v   the {@code char} value to be written.
      * @throws     IOException  if an I/O error occurs.
      */
     void writeChar(int v) throws IOException;
 
     /**
-     * Writes an <code>int</code> value, which is
+     * Writes an {@code int} value, which is
      * comprised of four bytes, to the output stream.
      * The byte values to be written, in the  order
      * shown, are:
@@ -183,17 +183,17 @@
      * (byte)(0xff & v)
      * }</pre><p>
      * The bytes written by this method may be read
-     * by the <code>readInt</code> method of interface
-     * <code>DataInput</code> , which will then
-     * return an <code>int</code> equal to <code>v</code>.
+     * by the {@code readInt} method of interface
+     * {@code DataInput} , which will then
+     * return an {@code int} equal to {@code v}.
      *
-     * @param      v   the <code>int</code> value to be written.
+     * @param      v   the {@code int} value to be written.
      * @throws     IOException  if an I/O error occurs.
      */
     void writeInt(int v) throws IOException;
 
     /**
-     * Writes a <code>long</code> value, which is
+     * Writes a {@code long} value, which is
      * comprised of eight bytes, to the output stream.
      * The byte values to be written, in the  order
      * shown, are:
@@ -208,50 +208,50 @@
      * (byte)(0xff & v)
      * }</pre><p>
      * The bytes written by this method may be
-     * read by the <code>readLong</code> method
-     * of interface <code>DataInput</code> , which
-     * will then return a <code>long</code> equal
-     * to <code>v</code>.
+     * read by the {@code readLong} method
+     * of interface {@code DataInput} , which
+     * will then return a {@code long} equal
+     * to {@code v}.
      *
-     * @param      v   the <code>long</code> value to be written.
+     * @param      v   the {@code long} value to be written.
      * @throws     IOException  if an I/O error occurs.
      */
     void writeLong(long v) throws IOException;
 
     /**
-     * Writes a <code>float</code> value,
+     * Writes a {@code float} value,
      * which is comprised of four bytes, to the output stream.
      * It does this as if it first converts this
-     * <code>float</code> value to an <code>int</code>
-     * in exactly the manner of the <code>Float.floatToIntBits</code>
-     * method  and then writes the <code>int</code>
-     * value in exactly the manner of the  <code>writeInt</code>
+     * {@code float} value to an {@code int}
+     * in exactly the manner of the {@code Float.floatToIntBits}
+     * method  and then writes the {@code int}
+     * value in exactly the manner of the  {@code writeInt}
      * method.  The bytes written by this method
-     * may be read by the <code>readFloat</code>
-     * method of interface <code>DataInput</code>,
-     * which will then return a <code>float</code>
-     * equal to <code>v</code>.
+     * may be read by the {@code readFloat}
+     * method of interface {@code DataInput},
+     * which will then return a {@code float}
+     * equal to {@code v}.
      *
-     * @param      v   the <code>float</code> value to be written.
+     * @param      v   the {@code float} value to be written.
      * @throws     IOException  if an I/O error occurs.
      */
     void writeFloat(float v) throws IOException;
 
     /**
-     * Writes a <code>double</code> value,
+     * Writes a {@code double} value,
      * which is comprised of eight bytes, to the output stream.
      * It does this as if it first converts this
-     * <code>double</code> value to a <code>long</code>
-     * in exactly the manner of the <code>Double.doubleToLongBits</code>
-     * method  and then writes the <code>long</code>
-     * value in exactly the manner of the  <code>writeLong</code>
+     * {@code double} value to a {@code long}
+     * in exactly the manner of the {@code Double.doubleToLongBits}
+     * method  and then writes the {@code long}
+     * value in exactly the manner of the  {@code writeLong}
      * method. The bytes written by this method
-     * may be read by the <code>readDouble</code>
-     * method of interface <code>DataInput</code>,
-     * which will then return a <code>double</code>
-     * equal to <code>v</code>.
+     * may be read by the {@code readDouble}
+     * method of interface {@code DataInput},
+     * which will then return a {@code double}
+     * equal to {@code v}.
      *
-     * @param      v   the <code>double</code> value to be written.
+     * @param      v   the {@code double} value to be written.
      * @throws     IOException  if an I/O error occurs.
      */
     void writeDouble(double v) throws IOException;
@@ -259,17 +259,17 @@
     /**
      * Writes a string to the output stream.
      * For every character in the string
-     * <code>s</code>,  taken in order, one byte
+     * {@code s},  taken in order, one byte
      * is written to the output stream.  If
-     * <code>s</code> is <code>null</code>, a <code>NullPointerException</code>
-     * is thrown.<p>  If <code>s.length</code>
+     * {@code s} is {@code null}, a {@code NullPointerException}
+     * is thrown.<p>  If {@code s.length}
      * is zero, then no bytes are written. Otherwise,
-     * the character <code>s[0]</code> is written
-     * first, then <code>s[1]</code>, and so on;
-     * the last character written is <code>s[s.length-1]</code>.
+     * the character {@code s[0]} is written
+     * first, then {@code s[1]}, and so on;
+     * the last character written is {@code s[s.length-1]}.
      * For each character, one byte is written,
      * the low-order byte, in exactly the manner
-     * of the <code>writeByte</code> method . The
+     * of the {@code writeByte} method . The
      * high-order eight bits of each character
      * in the string are ignored.
      *
@@ -279,19 +279,19 @@
     void writeBytes(String s) throws IOException;
 
     /**
-     * Writes every character in the string <code>s</code>,
+     * Writes every character in the string {@code s},
      * to the output stream, in order,
-     * two bytes per character. If <code>s</code>
-     * is <code>null</code>, a <code>NullPointerException</code>
-     * is thrown.  If <code>s.length</code>
+     * two bytes per character. If {@code s}
+     * is {@code null}, a {@code NullPointerException}
+     * is thrown.  If {@code s.length}
      * is zero, then no characters are written.
-     * Otherwise, the character <code>s[0]</code>
-     * is written first, then <code>s[1]</code>,
+     * Otherwise, the character {@code s[0]}
+     * is written first, then {@code s[1]},
      * and so on; the last character written is
-     * <code>s[s.length-1]</code>. For each character,
+     * {@code s[s.length-1]}. For each character,
      * two bytes are actually written, high-order
      * byte first, in exactly the manner of the
-     * <code>writeChar</code> method.
+     * {@code writeChar} method.
      *
      * @param      s   the string value to be written.
      * @throws     IOException  if an I/O error occurs.
@@ -304,19 +304,19 @@
      * by the
      * <a href="DataInput.html#modified-utf-8">modified UTF-8</a>
      * representation
-     * of  every character in the string <code>s</code>.
-     * If <code>s</code> is <code>null</code>,
-     * a <code>NullPointerException</code> is thrown.
-     * Each character in the string <code>s</code>
+     * of  every character in the string {@code s}.
+     * If {@code s} is {@code null},
+     * a {@code NullPointerException} is thrown.
+     * Each character in the string {@code s}
      * is converted to a group of one, two, or
      * three bytes, depending on the value of the
      * character.<p>
-     * If a character <code>c</code>
+     * If a character {@code c}
      * is in the range <code>&#92;u0001</code> through
      * <code>&#92;u007f</code>, it is represented
      * by one byte:
      * <pre>(byte)c </pre>  <p>
-     * If a character <code>c</code> is <code>&#92;u0000</code>
+     * If a character {@code c} is <code>&#92;u0000</code>
      * or is in the range <code>&#92;u0080</code>
      * through <code>&#92;u07ff</code>, then it is
      * represented by two bytes, to be written
@@ -324,8 +324,8 @@
      * (byte)(0xc0 | (0x1f & (c >> 6)))
      * (byte)(0x80 | (0x3f & c))
      * }</pre> <p> If a character
-     * <code>c</code> is in the range <code>&#92;u0800</code>
-     * through <code>uffff</code>, then it is
+     * {@code c} is in the range <code>&#92;u0800</code>
+     * through {@code uffff}, then it is
      * represented by three bytes, to be written
      * in the order shown: <pre>{@code
      * (byte)(0xe0 | (0x0f & (c >> 12)))
@@ -333,19 +333,19 @@
      * (byte)(0x80 | (0x3f & c))
      * }</pre>  <p> First,
      * the total number of bytes needed to represent
-     * all the characters of <code>s</code> is
+     * all the characters of {@code s} is
      * calculated. If this number is larger than
-     * <code>65535</code>, then a <code>UTFDataFormatException</code>
+     * {@code 65535}, then a {@code UTFDataFormatException}
      * is thrown. Otherwise, this length is written
      * to the output stream in exactly the manner
-     * of the <code>writeShort</code> method;
+     * of the {@code writeShort} method;
      * after this, the one-, two-, or three-byte
      * representation of each character in the
-     * string <code>s</code> is written.<p>  The
+     * string {@code s} is written.<p>  The
      * bytes written by this method may be read
-     * by the <code>readUTF</code> method of interface
-     * <code>DataInput</code> , which will then
-     * return a <code>String</code> equal to <code>s</code>.
+     * by the {@code readUTF} method of interface
+     * {@code DataInput} , which will then
+     * return a {@code String} equal to {@code s}.
      *
      * @param      s   the string value to be written.
      * @throws     IOException  if an I/O error occurs.
--- a/src/java.base/share/classes/java/io/DataOutputStream.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/DataOutputStream.java	Wed Sep 25 22:40:41 2019 +0200
@@ -49,7 +49,7 @@
 
     /**
      * Creates a new data output stream to write data to the specified
-     * underlying output stream. The counter <code>written</code> is
+     * underlying output stream. The counter {@code written} is
      * set to zero.
      *
      * @param   out   the underlying output stream, to be saved for later
@@ -74,13 +74,13 @@
 
     /**
      * Writes the specified byte (the low eight bits of the argument
-     * <code>b</code>) to the underlying output stream. If no exception
-     * is thrown, the counter <code>written</code> is incremented by
-     * <code>1</code>.
+     * {@code b}) to the underlying output stream. If no exception
+     * is thrown, the counter {@code written} is incremented by
+     * {@code 1}.
      * <p>
-     * Implements the <code>write</code> method of <code>OutputStream</code>.
+     * Implements the {@code write} method of {@code OutputStream}.
      *
-     * @param      b   the <code>byte</code> to be written.
+     * @param      b   the {@code byte} to be written.
      * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#out
      */
@@ -90,10 +90,10 @@
     }
 
     /**
-     * Writes <code>len</code> bytes from the specified byte array
-     * starting at offset <code>off</code> to the underlying output stream.
-     * If no exception is thrown, the counter <code>written</code> is
-     * incremented by <code>len</code>.
+     * Writes {@code len} bytes from the specified byte array
+     * starting at offset {@code off} to the underlying output stream.
+     * If no exception is thrown, the counter {@code written} is
+     * incremented by {@code len}.
      *
      * @param      b     the data.
      * @param      off   the start offset in the data.
@@ -112,8 +112,8 @@
      * Flushes this data output stream. This forces any buffered output
      * bytes to be written out to the stream.
      * <p>
-     * The <code>flush</code> method of <code>DataOutputStream</code>
-     * calls the <code>flush</code> method of its underlying output stream.
+     * The {@code flush} method of {@code DataOutputStream}
+     * calls the {@code flush} method of its underlying output stream.
      *
      * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#out
@@ -124,14 +124,14 @@
     }
 
     /**
-     * Writes a <code>boolean</code> to the underlying output stream as
-     * a 1-byte value. The value <code>true</code> is written out as the
-     * value <code>(byte)1</code>; the value <code>false</code> is
-     * written out as the value <code>(byte)0</code>. If no exception is
-     * thrown, the counter <code>written</code> is incremented by
-     * <code>1</code>.
+     * Writes a {@code boolean} to the underlying output stream as
+     * a 1-byte value. The value {@code true} is written out as the
+     * value {@code (byte)1}; the value {@code false} is
+     * written out as the value {@code (byte)0}. If no exception is
+     * thrown, the counter {@code written} is incremented by
+     * {@code 1}.
      *
-     * @param      v   a <code>boolean</code> value to be written.
+     * @param      v   a {@code boolean} value to be written.
      * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#out
      */
@@ -141,11 +141,11 @@
     }
 
     /**
-     * Writes out a <code>byte</code> to the underlying output stream as
+     * Writes out a {@code byte} to the underlying output stream as
      * a 1-byte value. If no exception is thrown, the counter
-     * <code>written</code> is incremented by <code>1</code>.
+     * {@code written} is incremented by {@code 1}.
      *
-     * @param      v   a <code>byte</code> value to be written.
+     * @param      v   a {@code byte} value to be written.
      * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#out
      */
@@ -155,11 +155,11 @@
     }
 
     /**
-     * Writes a <code>short</code> to the underlying output stream as two
+     * Writes a {@code short} to the underlying output stream as two
      * bytes, high byte first. If no exception is thrown, the counter
-     * <code>written</code> is incremented by <code>2</code>.
+     * {@code written} is incremented by {@code 2}.
      *
-     * @param      v   a <code>short</code> to be written.
+     * @param      v   a {@code short} to be written.
      * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#out
      */
@@ -170,11 +170,11 @@
     }
 
     /**
-     * Writes a <code>char</code> to the underlying output stream as a
+     * Writes a {@code char} to the underlying output stream as a
      * 2-byte value, high byte first. If no exception is thrown, the
-     * counter <code>written</code> is incremented by <code>2</code>.
+     * counter {@code written} is incremented by {@code 2}.
      *
-     * @param      v   a <code>char</code> value to be written.
+     * @param      v   a {@code char} value to be written.
      * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#out
      */
@@ -185,11 +185,11 @@
     }
 
     /**
-     * Writes an <code>int</code> to the underlying output stream as four
+     * Writes an {@code int} to the underlying output stream as four
      * bytes, high byte first. If no exception is thrown, the counter
-     * <code>written</code> is incremented by <code>4</code>.
+     * {@code written} is incremented by {@code 4}.
      *
-     * @param      v   an <code>int</code> to be written.
+     * @param      v   an {@code int} to be written.
      * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#out
      */
@@ -204,11 +204,11 @@
     private byte writeBuffer[] = new byte[8];
 
     /**
-     * Writes a <code>long</code> to the underlying output stream as eight
+     * Writes a {@code long} to the underlying output stream as eight
      * bytes, high byte first. In no exception is thrown, the counter
-     * <code>written</code> is incremented by <code>8</code>.
+     * {@code written} is incremented by {@code 8}.
      *
-     * @param      v   a <code>long</code> to be written.
+     * @param      v   a {@code long} to be written.
      * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#out
      */
@@ -226,14 +226,14 @@
     }
 
     /**
-     * Converts the float argument to an <code>int</code> using the
-     * <code>floatToIntBits</code> method in class <code>Float</code>,
-     * and then writes that <code>int</code> value to the underlying
+     * Converts the float argument to an {@code int} using the
+     * {@code floatToIntBits} method in class {@code Float},
+     * and then writes that {@code int} value to the underlying
      * output stream as a 4-byte quantity, high byte first. If no
-     * exception is thrown, the counter <code>written</code> is
-     * incremented by <code>4</code>.
+     * exception is thrown, the counter {@code written} is
+     * incremented by {@code 4}.
      *
-     * @param      v   a <code>float</code> value to be written.
+     * @param      v   a {@code float} value to be written.
      * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#out
      * @see        java.lang.Float#floatToIntBits(float)
@@ -243,14 +243,14 @@
     }
 
     /**
-     * Converts the double argument to a <code>long</code> using the
-     * <code>doubleToLongBits</code> method in class <code>Double</code>,
-     * and then writes that <code>long</code> value to the underlying
+     * Converts the double argument to a {@code long} using the
+     * {@code doubleToLongBits} method in class {@code Double},
+     * and then writes that {@code long} value to the underlying
      * output stream as an 8-byte quantity, high byte first. If no
-     * exception is thrown, the counter <code>written</code> is
-     * incremented by <code>8</code>.
+     * exception is thrown, the counter {@code written} is
+     * incremented by {@code 8}.
      *
-     * @param      v   a <code>double</code> value to be written.
+     * @param      v   a {@code double} value to be written.
      * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#out
      * @see        java.lang.Double#doubleToLongBits(double)
@@ -263,8 +263,8 @@
      * Writes out the string to the underlying output stream as a
      * sequence of bytes. Each character in the string is written out, in
      * sequence, by discarding its high eight bits. If no exception is
-     * thrown, the counter <code>written</code> is incremented by the
-     * length of <code>s</code>.
+     * thrown, the counter {@code written} is incremented by the
+     * length of {@code s}.
      *
      * @param      s   a string of bytes to be written.
      * @throws     IOException  if an I/O error occurs.
@@ -281,11 +281,11 @@
     /**
      * Writes a string to the underlying output stream as a sequence of
      * characters. Each character is written to the data output stream as
-     * if by the <code>writeChar</code> method. If no exception is
-     * thrown, the counter <code>written</code> is incremented by twice
-     * the length of <code>s</code>.
+     * if by the {@code writeChar} method. If no exception is
+     * thrown, the counter {@code written} is incremented by twice
+     * the length of {@code s}.
      *
-     * @param      s   a <code>String</code> value to be written.
+     * @param      s   a {@code String} value to be written.
      * @throws     IOException  if an I/O error occurs.
      * @see        java.io.DataOutputStream#writeChar(int)
      * @see        java.io.FilterOutputStream#out
@@ -306,15 +306,15 @@
      * encoding in a machine-independent manner.
      * <p>
      * First, two bytes are written to the output stream as if by the
-     * <code>writeShort</code> method giving the number of bytes to
+     * {@code writeShort} method giving the number of bytes to
      * follow. This value is the number of bytes actually written out,
      * not the length of the string. Following the length, each character
      * of the string is output, in sequence, using the modified UTF-8 encoding
      * for the character. If no exception is thrown, the counter
-     * <code>written</code> is incremented by the total number of
+     * {@code written} is incremented by the total number of
      * bytes written to the output stream. This will be at least two
-     * plus the length of <code>str</code>, and at most two plus
-     * thrice the length of <code>str</code>.
+     * plus the length of {@code str}, and at most two plus
+     * thrice the length of {@code str}.
      *
      * @param      str   a string to be written.
      * @throws     UTFDataFormatException  if the modified UTF-8 encoding of
@@ -331,15 +331,15 @@
      * <a href="DataInput.html#modified-utf-8">modified UTF-8</a>
      * encoding in a machine-independent manner.
      * <p>
-     * First, two bytes are written to out as if by the <code>writeShort</code>
+     * First, two bytes are written to out as if by the {@code writeShort}
      * method giving the number of bytes to follow. This value is the number of
      * bytes actually written out, not the length of the string. Following the
      * length, each character of the string is output, in sequence, using the
      * modified UTF-8 encoding for the character. If no exception is thrown, the
-     * counter <code>written</code> is incremented by the total number of
+     * counter {@code written} is incremented by the total number of
      * bytes written to the output stream. This will be at least two
-     * plus the length of <code>str</code>, and at most two plus
-     * thrice the length of <code>str</code>.
+     * plus the length of {@code str}, and at most two plus
+     * thrice the length of {@code str}.
      *
      * @param      str   a string to be written.
      * @param      out   destination to write to
@@ -410,11 +410,11 @@
     }
 
     /**
-     * Returns the current value of the counter <code>written</code>,
+     * Returns the current value of the counter {@code written},
      * the number of bytes written to this data output stream so far.
      * If the counter overflows, it will be wrapped to Integer.MAX_VALUE.
      *
-     * @return  the value of the <code>written</code> field.
+     * @return  the value of the {@code written} field.
      * @see     java.io.DataOutputStream#written
      */
     public final int size() {
--- a/src/java.base/share/classes/java/io/EOFException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/EOFException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -44,7 +44,7 @@
     private static final long serialVersionUID = 6433858223774886977L;
 
     /**
-     * Constructs an <code>EOFException</code> with <code>null</code>
+     * Constructs an {@code EOFException} with {@code null}
      * as its error detail message.
      */
     public EOFException() {
@@ -52,10 +52,10 @@
     }
 
     /**
-     * Constructs an <code>EOFException</code> with the specified detail
-     * message. The string <code>s</code> may later be retrieved by the
+     * Constructs an {@code EOFException} with the specified detail
+     * message. The string {@code s} may later be retrieved by the
      * <code>{@link java.lang.Throwable#getMessage}</code> method of class
-     * <code>java.lang.Throwable</code>.
+     * {@code java.lang.Throwable}.
      *
      * @param   s   the detail message.
      */
--- a/src/java.base/share/classes/java/io/File.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/File.java	Wed Sep 25 22:40:41 2019 +0200
@@ -46,8 +46,8 @@
  *
  * <ol>
  * <li> An optional system-dependent <em>prefix</em> string,
- *      such as a disk-drive specifier, <code>"/"</code>&nbsp;for the UNIX root
- *      directory, or <code>"\\\\"</code>&nbsp;for a Microsoft Windows UNC pathname, and
+ *      such as a disk-drive specifier, {@code "/"}&nbsp;for the UNIX root
+ *      directory, or {@code "\\\\"}&nbsp;for a Microsoft Windows UNC pathname, and
  * <li> A sequence of zero or more string <em>names</em>.
  * </ol>
  *
@@ -61,7 +61,7 @@
  * inherently system-dependent.  When an abstract pathname is converted into a
  * pathname string, each name is separated from the next by a single copy of
  * the default <em>separator character</em>.  The default name-separator
- * character is defined by the system property <code>file.separator</code>, and
+ * character is defined by the system property {@code file.separator}, and
  * is made available in the public static fields {@link
  * #separator} and {@link #separatorChar} of this class.
  * When a pathname string is converted into an abstract pathname, the names
@@ -73,9 +73,9 @@
  * that no other information is required in order to locate the file that it
  * denotes.  A relative pathname, in contrast, must be interpreted in terms of
  * information taken from some other pathname.  By default the classes in the
- * <code>java.io</code> package always resolve relative pathnames against the
+ * {@code java.io} package always resolve relative pathnames against the
  * current user directory.  This directory is named by the system property
- * <code>user.dir</code>, and is typically the directory in which the Java
+ * {@code user.dir}, and is typically the directory in which the Java
  * virtual machine was invoked.
  *
  * <p> The <em>parent</em> of an abstract pathname may be obtained by invoking
@@ -94,14 +94,14 @@
  * <ul>
  *
  * <li> For UNIX platforms, the prefix of an absolute pathname is always
- * <code>"/"</code>.  Relative pathnames have no prefix.  The abstract pathname
- * denoting the root directory has the prefix <code>"/"</code> and an empty
+ * {@code "/"}.  Relative pathnames have no prefix.  The abstract pathname
+ * denoting the root directory has the prefix {@code "/"} and an empty
  * name sequence.
  *
  * <li> For Microsoft Windows platforms, the prefix of a pathname that contains a drive
- * specifier consists of the drive letter followed by <code>":"</code> and
- * possibly followed by <code>"\\"</code> if the pathname is absolute.  The
- * prefix of a UNC pathname is <code>"\\\\"</code>; the hostname and the share
+ * specifier consists of the drive letter followed by {@code ":"} and
+ * possibly followed by {@code "\\"} if the pathname is absolute.  The
+ * prefix of a UNC pathname is {@code "\\\\"}; the hostname and the share
  * name are the first two names in the name sequence.  A relative pathname that
  * does not specify a drive has no prefix.
  *
@@ -124,8 +124,8 @@
  * may apply to all other users.  The access permissions on an object may
  * cause some methods in this class to fail.
  *
- * <p> Instances of the <code>File</code> class are immutable; that is, once
- * created, the abstract pathname represented by a <code>File</code> object
+ * <p> Instances of the {@code File} class are immutable; that is, once
+ * created, the abstract pathname represented by a {@code File} object
  * will never change.
  *
  * <h2>Interoperability with {@code java.nio.file} package</h2>
@@ -208,8 +208,8 @@
     /**
      * The system-dependent default name-separator character.  This field is
      * initialized to contain the first character of the value of the system
-     * property <code>file.separator</code>.  On UNIX systems the value of this
-     * field is <code>'/'</code>; on Microsoft Windows systems it is <code>'\\'</code>.
+     * property {@code file.separator}.  On UNIX systems the value of this
+     * field is {@code '/'}; on Microsoft Windows systems it is {@code '\\'}.
      *
      * @see     java.lang.System#getProperty(java.lang.String)
      */
@@ -225,10 +225,10 @@
     /**
      * The system-dependent path-separator character.  This field is
      * initialized to contain the first character of the value of the system
-     * property <code>path.separator</code>.  This character is used to
+     * property {@code path.separator}.  This character is used to
      * separate filenames in a sequence of files given as a <em>path list</em>.
-     * On UNIX systems, this character is <code>':'</code>; on Microsoft Windows systems it
-     * is <code>';'</code>.
+     * On UNIX systems, this character is {@code ':'}; on Microsoft Windows systems it
+     * is {@code ';'}.
      *
      * @see     java.lang.System#getProperty(java.lang.String)
      */
@@ -265,13 +265,13 @@
     }
 
     /**
-     * Creates a new <code>File</code> instance by converting the given
+     * Creates a new {@code File} instance by converting the given
      * pathname string into an abstract pathname.  If the given string is
      * the empty string, then the result is the empty abstract pathname.
      *
      * @param   pathname  A pathname string
      * @throws  NullPointerException
-     *          If the <code>pathname</code> argument is <code>null</code>
+     *          If the {@code pathname} argument is {@code null}
      */
     public File(String pathname) {
         if (pathname == null) {
@@ -289,21 +289,21 @@
        compatibility with the original behavior of this class. */
 
     /**
-     * Creates a new <code>File</code> instance from a parent pathname string
+     * Creates a new {@code File} instance from a parent pathname string
      * and a child pathname string.
      *
-     * <p> If <code>parent</code> is <code>null</code> then the new
-     * <code>File</code> instance is created as if by invoking the
-     * single-argument <code>File</code> constructor on the given
-     * <code>child</code> pathname string.
+     * <p> If {@code parent} is {@code null} then the new
+     * {@code File} instance is created as if by invoking the
+     * single-argument {@code File} constructor on the given
+     * {@code child} pathname string.
      *
-     * <p> Otherwise the <code>parent</code> pathname string is taken to denote
-     * a directory, and the <code>child</code> pathname string is taken to
-     * denote either a directory or a file.  If the <code>child</code> pathname
+     * <p> Otherwise the {@code parent} pathname string is taken to denote
+     * a directory, and the {@code child} pathname string is taken to
+     * denote either a directory or a file.  If the {@code child} pathname
      * string is absolute then it is converted into a relative pathname in a
-     * system-dependent way.  If <code>parent</code> is the empty string then
-     * the new <code>File</code> instance is created by converting
-     * <code>child</code> into an abstract pathname and resolving the result
+     * system-dependent way.  If {@code parent} is the empty string then
+     * the new {@code File} instance is created by converting
+     * {@code child} into an abstract pathname and resolving the result
      * against a system-dependent default directory.  Otherwise each pathname
      * string is converted into an abstract pathname and the child abstract
      * pathname is resolved against the parent.
@@ -311,7 +311,7 @@
      * @param   parent  The parent pathname string
      * @param   child   The child pathname string
      * @throws  NullPointerException
-     *          If <code>child</code> is <code>null</code>
+     *          If {@code child} is {@code null}
      */
     public File(String parent, String child) {
         if (child == null) {
@@ -332,21 +332,21 @@
     }
 
     /**
-     * Creates a new <code>File</code> instance from a parent abstract
+     * Creates a new {@code File} instance from a parent abstract
      * pathname and a child pathname string.
      *
-     * <p> If <code>parent</code> is <code>null</code> then the new
-     * <code>File</code> instance is created as if by invoking the
-     * single-argument <code>File</code> constructor on the given
-     * <code>child</code> pathname string.
+     * <p> If {@code parent} is {@code null} then the new
+     * {@code File} instance is created as if by invoking the
+     * single-argument {@code File} constructor on the given
+     * {@code child} pathname string.
      *
-     * <p> Otherwise the <code>parent</code> abstract pathname is taken to
-     * denote a directory, and the <code>child</code> pathname string is taken
-     * to denote either a directory or a file.  If the <code>child</code>
+     * <p> Otherwise the {@code parent} abstract pathname is taken to
+     * denote a directory, and the {@code child} pathname string is taken
+     * to denote either a directory or a file.  If the {@code child}
      * pathname string is absolute then it is converted into a relative
-     * pathname in a system-dependent way.  If <code>parent</code> is the empty
-     * abstract pathname then the new <code>File</code> instance is created by
-     * converting <code>child</code> into an abstract pathname and resolving
+     * pathname in a system-dependent way.  If {@code parent} is the empty
+     * abstract pathname then the new {@code File} instance is created by
+     * converting {@code child} into an abstract pathname and resolving
      * the result against a system-dependent default directory.  Otherwise each
      * pathname string is converted into an abstract pathname and the child
      * abstract pathname is resolved against the parent.
@@ -354,7 +354,7 @@
      * @param   parent  The parent abstract pathname
      * @param   child   The child pathname string
      * @throws  NullPointerException
-     *          If <code>child</code> is <code>null</code>
+     *          If {@code child} is {@code null}
      */
     public File(File parent, String child) {
         if (child == null) {
@@ -460,7 +460,7 @@
 
     /**
      * Returns the pathname string of this abstract pathname's parent, or
-     * <code>null</code> if this pathname does not name a parent directory.
+     * {@code null} if this pathname does not name a parent directory.
      *
      * <p> The <em>parent</em> of an abstract pathname consists of the
      * pathname's prefix, if any, and each name in the pathname's name
@@ -468,7 +468,7 @@
      * the pathname does not name a parent directory.
      *
      * @return  The pathname string of the parent directory named by this
-     *          abstract pathname, or <code>null</code> if this pathname
+     *          abstract pathname, or {@code null} if this pathname
      *          does not name a parent
      */
     public String getParent() {
@@ -483,7 +483,7 @@
 
     /**
      * Returns the abstract pathname of this abstract pathname's parent,
-     * or <code>null</code> if this pathname does not name a parent
+     * or {@code null} if this pathname does not name a parent
      * directory.
      *
      * <p> The <em>parent</em> of an abstract pathname consists of the
@@ -492,7 +492,7 @@
      * the pathname does not name a parent directory.
      *
      * @return  The abstract pathname of the parent directory named by this
-     *          abstract pathname, or <code>null</code> if this pathname
+     *          abstract pathname, or {@code null} if this pathname
      *          does not name a parent
      *
      * @since 1.2
@@ -520,12 +520,12 @@
     /**
      * Tests whether this abstract pathname is absolute.  The definition of
      * absolute pathname is system dependent.  On UNIX systems, a pathname is
-     * absolute if its prefix is <code>"/"</code>.  On Microsoft Windows systems, a
+     * absolute if its prefix is {@code "/"}.  On Microsoft Windows systems, a
      * pathname is absolute if its prefix is a drive specifier followed by
-     * <code>"\\"</code>, or if its prefix is <code>"\\\\"</code>.
+     * {@code "\\"}, or if its prefix is {@code "\\\\"}.
      *
-     * @return  <code>true</code> if this abstract pathname is absolute,
-     *          <code>false</code> otherwise
+     * @return  {@code true} if this abstract pathname is absolute,
+     *          {@code false} otherwise
      */
     public boolean isAbsolute() {
         return fs.isAbsolute(this);
@@ -538,7 +538,7 @@
      * string is simply returned as if by the {@link #getPath}
      * method.  If this abstract pathname is the empty abstract pathname then
      * the pathname string of the current user directory, which is named by the
-     * system property <code>user.dir</code>, is returned.  Otherwise this
+     * system property {@code user.dir}, is returned.  Otherwise this
      * pathname is resolved in a system-dependent way.  On UNIX systems, a
      * relative pathname is made absolute by resolving it against the current
      * user directory.  On Microsoft Windows systems, a relative pathname is made absolute
@@ -658,7 +658,7 @@
     }
 
     /**
-     * Converts this abstract pathname into a <code>file:</code> URL.  The
+     * Converts this abstract pathname into a {@code file:} URL.  The
      * exact form of the URL is system-dependent.  If it can be determined that
      * the file denoted by this abstract pathname is a directory, then the
      * resulting URL will end with a slash.
@@ -751,9 +751,9 @@
      * files that are marked as unreadable. Consequently this method may return
      * {@code true} even though the file does not have read permissions.
      *
-     * @return  <code>true</code> if and only if the file specified by this
+     * @return  {@code true} if and only if the file specified by this
      *          abstract pathname exists <em>and</em> can be read by the
-     *          application; <code>false</code> otherwise
+     *          application; {@code false} otherwise
      *
      * @throws  SecurityException
      *          If a security manager exists and its {@link
@@ -778,10 +778,10 @@
      * files that are marked read-only. Consequently this method may return
      * {@code true} even though the file is marked read-only.
      *
-     * @return  <code>true</code> if and only if the file system actually
+     * @return  {@code true} if and only if the file system actually
      *          contains a file denoted by this abstract pathname <em>and</em>
      *          the application is allowed to write to the file;
-     *          <code>false</code> otherwise.
+     *          {@code false} otherwise.
      *
      * @throws  SecurityException
      *          If a security manager exists and its {@link
@@ -803,8 +803,8 @@
      * Tests whether the file or directory denoted by this abstract pathname
      * exists.
      *
-     * @return  <code>true</code> if and only if the file or directory denoted
-     *          by this abstract pathname exists; <code>false</code> otherwise
+     * @return  {@code true} if and only if the file or directory denoted
+     *          by this abstract pathname exists; {@code false} otherwise
      *
      * @throws  SecurityException
      *          If a security manager exists and its {@link
@@ -832,9 +832,9 @@
      * java.nio.file.Files#readAttributes(Path,Class,LinkOption[])
      * Files.readAttributes} method may be used.
      *
-     * @return <code>true</code> if and only if the file denoted by this
+     * @return {@code true} if and only if the file denoted by this
      *          abstract pathname exists <em>and</em> is a directory;
-     *          <code>false</code> otherwise
+     *          {@code false} otherwise
      *
      * @throws  SecurityException
      *          If a security manager exists and its {@link
@@ -865,9 +865,9 @@
      * java.nio.file.Files#readAttributes(Path,Class,LinkOption[])
      * Files.readAttributes} method may be used.
      *
-     * @return  <code>true</code> if and only if the file denoted by this
+     * @return  {@code true} if and only if the file denoted by this
      *          abstract pathname exists <em>and</em> is a normal file;
-     *          <code>false</code> otherwise
+     *          {@code false} otherwise
      *
      * @throws  SecurityException
      *          If a security manager exists and its {@link
@@ -889,10 +889,10 @@
      * Tests whether the file named by this abstract pathname is a hidden
      * file.  The exact definition of <em>hidden</em> is system-dependent.  On
      * UNIX systems, a file is considered to be hidden if its name begins with
-     * a period character (<code>'.'</code>).  On Microsoft Windows systems, a file is
+     * a period character ({@code '.'}).  On Microsoft Windows systems, a file is
      * considered to be hidden if it has been marked as such in the filesystem.
      *
-     * @return  <code>true</code> if and only if the file denoted by this
+     * @return  {@code true} if and only if the file denoted by this
      *          abstract pathname is hidden according to the conventions of the
      *          underlying platform
      *
@@ -934,9 +934,9 @@
      * {@link java.nio.file.Files#getLastModifiedTime(Path,LinkOption[])
      * Files.getLastModifiedTime} method may be used instead.
      *
-     * @return  A <code>long</code> value representing the time the file was
+     * @return  A {@code long} value representing the time the file was
      *          last modified, measured in milliseconds since the epoch
-     *          (00:00:00 GMT, January 1, 1970), or <code>0L</code> if the
+     *          (00:00:00 GMT, January 1, 1970), or {@code 0L} if the
      *          file does not exist or if an I/O error occurs.  The value may
      *          be negative indicating the number of milliseconds before the
      *          epoch
@@ -968,8 +968,8 @@
      * Files.readAttributes} method may be used.
      *
      * @return  The length, in bytes, of the file denoted by this abstract
-     *          pathname, or <code>0L</code> if the file does not exist.  Some
-     *          operating systems may return <code>0L</code> for pathnames
+     *          pathname, or {@code 0L} if the file does not exist.  Some
+     *          operating systems may return {@code 0L} for pathnames
      *          denoting system-dependent entities such as devices or pipes.
      *
      * @throws  SecurityException
@@ -1003,8 +1003,8 @@
      * {@link java.nio.channels.FileLock FileLock}
      * facility should be used instead.
      *
-     * @return  <code>true</code> if the named file does not exist and was
-     *          successfully created; <code>false</code> if the named file
+     * @return  {@code true} if the named file does not exist and was
+     *          successfully created; {@code false} if the named file
      *          already exists
      *
      * @throws  IOException
@@ -1036,8 +1036,8 @@
      * when a file cannot be deleted. This is useful for error reporting and to
      * diagnose why a file cannot be deleted.
      *
-     * @return  <code>true</code> if and only if the file or directory is
-     *          successfully deleted; <code>false</code> otherwise
+     * @return  {@code true} if and only if the file or directory is
+     *          successfully deleted; {@code false} otherwise
      *
      * @throws  SecurityException
      *          If a security manager exists and its {@link
@@ -1311,8 +1311,8 @@
     /**
      * Creates the directory named by this abstract pathname.
      *
-     * @return  <code>true</code> if and only if the directory was
-     *          created; <code>false</code> otherwise
+     * @return  {@code true} if and only if the directory was
+     *          created; {@code false} otherwise
      *
      * @throws  SecurityException
      *          If a security manager exists and its {@link
@@ -1336,8 +1336,8 @@
      * operation fails it may have succeeded in creating some of the necessary
      * parent directories.
      *
-     * @return  <code>true</code> if and only if the directory was created,
-     *          along with all necessary parent directories; <code>false</code>
+     * @return  {@code true} if and only if the directory was created,
+     *          along with all necessary parent directories; {@code false}
      *          otherwise
      *
      * @throws  SecurityException
@@ -1385,8 +1385,8 @@
      *
      * @param  dest  The new abstract pathname for the named file
      *
-     * @return  <code>true</code> if and only if the renaming succeeded;
-     *          <code>false</code> otherwise
+     * @return  {@code true} if and only if the renaming succeeded;
+     *          {@code false} otherwise
      *
      * @throws  SecurityException
      *          If a security manager exists and its {@link
@@ -1394,7 +1394,7 @@
      *          method denies write access to either the old or new pathnames
      *
      * @throws  NullPointerException
-     *          If parameter <code>dest</code> is <code>null</code>
+     *          If parameter {@code dest} is {@code null}
      */
     public boolean renameTo(File dest) {
         if (dest == null) {
@@ -1420,13 +1420,13 @@
      * the supported precision.  If the operation succeeds and no intervening
      * operations on the file take place, then the next invocation of the
      * {@link #lastModified} method will return the (possibly
-     * truncated) <code>time</code> argument that was passed to this method.
+     * truncated) {@code time} argument that was passed to this method.
      *
      * @param  time  The new last-modified time, measured in milliseconds since
      *               the epoch (00:00:00 GMT, January 1, 1970)
      *
-     * @return <code>true</code> if and only if the operation succeeded;
-     *          <code>false</code> otherwise
+     * @return {@code true} if and only if the operation succeeded;
+     *          {@code false} otherwise
      *
      * @throws  IllegalArgumentException  If the argument is negative
      *
@@ -1458,8 +1458,8 @@
      * files that are marked read-only. Whether or not a read-only file or
      * directory may be deleted depends upon the underlying system.
      *
-     * @return <code>true</code> if and only if the operation succeeded;
-     *          <code>false</code> otherwise
+     * @return {@code true} if and only if the operation succeeded;
+     *          {@code false} otherwise
      *
      * @throws  SecurityException
      *          If a security manager exists and its {@link
@@ -1490,17 +1490,17 @@
      * manipulation of file permissions is required.
      *
      * @param   writable
-     *          If <code>true</code>, sets the access permission to allow write
-     *          operations; if <code>false</code> to disallow write operations
+     *          If {@code true}, sets the access permission to allow write
+     *          operations; if {@code false} to disallow write operations
      *
      * @param   ownerOnly
-     *          If <code>true</code>, the write permission applies only to the
+     *          If {@code true}, the write permission applies only to the
      *          owner's write permission; otherwise, it applies to everybody.  If
      *          the underlying file system can not distinguish the owner's write
      *          permission from that of others, then the permission will apply to
      *          everybody, regardless of this value.
      *
-     * @return  <code>true</code> if and only if the operation succeeded. The
+     * @return  {@code true} if and only if the operation succeeded. The
      *          operation will fail if the user does not have permission to change
      *          the access permissions of this abstract pathname.
      *
@@ -1536,10 +1536,10 @@
      * }</pre>
      *
      * @param   writable
-     *          If <code>true</code>, sets the access permission to allow write
-     *          operations; if <code>false</code> to disallow write operations
+     *          If {@code true}, sets the access permission to allow write
+     *          operations; if {@code false} to disallow write operations
      *
-     * @return  <code>true</code> if and only if the operation succeeded.  The
+     * @return  {@code true} if and only if the operation succeeded.  The
      *          operation will fail if the user does not have permission to
      *          change the access permissions of this abstract pathname.
      *
@@ -1565,20 +1565,20 @@
      * manipulation of file permissions is required.
      *
      * @param   readable
-     *          If <code>true</code>, sets the access permission to allow read
-     *          operations; if <code>false</code> to disallow read operations
+     *          If {@code true}, sets the access permission to allow read
+     *          operations; if {@code false} to disallow read operations
      *
      * @param   ownerOnly
-     *          If <code>true</code>, the read permission applies only to the
+     *          If {@code true}, the read permission applies only to the
      *          owner's read permission; otherwise, it applies to everybody.  If
      *          the underlying file system can not distinguish the owner's read
      *          permission from that of others, then the permission will apply to
      *          everybody, regardless of this value.
      *
-     * @return  <code>true</code> if and only if the operation succeeded.  The
+     * @return  {@code true} if and only if the operation succeeded.  The
      *          operation will fail if the user does not have permission to
      *          change the access permissions of this abstract pathname.  If
-     *          <code>readable</code> is <code>false</code> and the underlying
+     *          {@code readable} is {@code false} and the underlying
      *          file system does not implement a read permission, then the
      *          operation will fail.
      *
@@ -1614,13 +1614,13 @@
      * }</pre>
      *
      * @param  readable
-     *          If <code>true</code>, sets the access permission to allow read
-     *          operations; if <code>false</code> to disallow read operations
+     *          If {@code true}, sets the access permission to allow read
+     *          operations; if {@code false} to disallow read operations
      *
-     * @return  <code>true</code> if and only if the operation succeeded.  The
+     * @return  {@code true} if and only if the operation succeeded.  The
      *          operation will fail if the user does not have permission to
      *          change the access permissions of this abstract pathname.  If
-     *          <code>readable</code> is <code>false</code> and the underlying
+     *          {@code readable} is {@code false} and the underlying
      *          file system does not implement a read permission, then the
      *          operation will fail.
      *
@@ -1646,20 +1646,20 @@
      * manipulation of file permissions is required.
      *
      * @param   executable
-     *          If <code>true</code>, sets the access permission to allow execute
-     *          operations; if <code>false</code> to disallow execute operations
+     *          If {@code true}, sets the access permission to allow execute
+     *          operations; if {@code false} to disallow execute operations
      *
      * @param   ownerOnly
-     *          If <code>true</code>, the execute permission applies only to the
+     *          If {@code true}, the execute permission applies only to the
      *          owner's execute permission; otherwise, it applies to everybody.
      *          If the underlying file system can not distinguish the owner's
      *          execute permission from that of others, then the permission will
      *          apply to everybody, regardless of this value.
      *
-     * @return  <code>true</code> if and only if the operation succeeded.  The
+     * @return  {@code true} if and only if the operation succeeded.  The
      *          operation will fail if the user does not have permission to
      *          change the access permissions of this abstract pathname.  If
-     *          <code>executable</code> is <code>false</code> and the underlying
+     *          {@code executable} is {@code false} and the underlying
      *          file system does not implement an execute permission, then the
      *          operation will fail.
      *
@@ -1695,13 +1695,13 @@
      * }</pre>
      *
      * @param   executable
-     *          If <code>true</code>, sets the access permission to allow execute
-     *          operations; if <code>false</code> to disallow execute operations
+     *          If {@code true}, sets the access permission to allow execute
+     *          operations; if {@code false} to disallow execute operations
      *
-     * @return   <code>true</code> if and only if the operation succeeded.  The
+     * @return   {@code true} if and only if the operation succeeded.  The
      *           operation will fail if the user does not have permission to
      *           change the access permissions of this abstract pathname.  If
-     *           <code>executable</code> is <code>false</code> and the underlying
+     *           {@code executable} is {@code false} and the underlying
      *           file system does not implement an execute permission, then the
      *           operation will fail.
      *
@@ -1723,7 +1723,7 @@
      * files that are not marked executable. Consequently this method may return
      * {@code true} even though the file does not have execute permissions.
      *
-     * @return  <code>true</code> if and only if the abstract pathname exists
+     * @return  {@code true} if and only if the abstract pathname exists
      *          <em>and</em> the application is allowed to execute the file
      *
      * @throws  SecurityException
@@ -2007,28 +2007,28 @@
      * for a file created by this method to be deleted automatically, use the
      * {@link #deleteOnExit} method.
      *
-     * <p> The <code>prefix</code> argument must be at least three characters
+     * <p> The {@code prefix} argument must be at least three characters
      * long.  It is recommended that the prefix be a short, meaningful string
-     * such as <code>"hjb"</code> or <code>"mail"</code>.  The
-     * <code>suffix</code> argument may be <code>null</code>, in which case the
-     * suffix <code>".tmp"</code> will be used.
+     * such as {@code "hjb"} or {@code "mail"}.  The
+     * {@code suffix} argument may be {@code null}, in which case the
+     * suffix {@code ".tmp"} will be used.
      *
      * <p> To create the new file, the prefix and the suffix may first be
      * adjusted to fit the limitations of the underlying platform.  If the
      * prefix is too long then it will be truncated, but its first three
      * characters will always be preserved.  If the suffix is too long then it
      * too will be truncated, but if it begins with a period character
-     * (<code>'.'</code>) then the period and the first three characters
+     * ({@code '.'}) then the period and the first three characters
      * following it will always be preserved.  Once these adjustments have been
      * made the name of the new file will be generated by concatenating the
      * prefix, five or more internally-generated characters, and the suffix.
      *
-     * <p> If the <code>directory</code> argument is <code>null</code> then the
+     * <p> If the {@code directory} argument is {@code null} then the
      * system-dependent default temporary-file directory will be used.  The
      * default temporary-file directory is specified by the system property
-     * <code>java.io.tmpdir</code>.  On UNIX systems the default value of this
-     * property is typically <code>"/tmp"</code> or <code>"/var/tmp"</code>; on
-     * Microsoft Windows systems it is typically <code>"C:\\WINNT\\TEMP"</code>.  A different
+     * {@code java.io.tmpdir}.  On UNIX systems the default value of this
+     * property is typically {@code "/tmp"} or {@code "/var/tmp"}; on
+     * Microsoft Windows systems it is typically {@code "C:\\WINNT\\TEMP"}.  A different
      * value may be given to this system property when the Java virtual machine
      * is invoked, but programmatic changes to this property are not guaranteed
      * to have any effect upon the temporary directory used by this method.
@@ -2037,17 +2037,17 @@
      *                    name; must be at least three characters long
      *
      * @param  suffix     The suffix string to be used in generating the file's
-     *                    name; may be <code>null</code>, in which case the
-     *                    suffix <code>".tmp"</code> will be used
+     *                    name; may be {@code null}, in which case the
+     *                    suffix {@code ".tmp"} will be used
      *
      * @param  directory  The directory in which the file is to be created, or
-     *                    <code>null</code> if the default temporary-file
+     *                    {@code null} if the default temporary-file
      *                    directory is to be used
      *
      * @return  An abstract pathname denoting a newly-created empty file
      *
      * @throws  IllegalArgumentException
-     *          If the <code>prefix</code> argument contains fewer than three
+     *          If the {@code prefix} argument contains fewer than three
      *          characters
      *
      * @throws  IOException  If a file could not be created
@@ -2113,13 +2113,13 @@
      *                    name; must be at least three characters long
      *
      * @param  suffix     The suffix string to be used in generating the file's
-     *                    name; may be <code>null</code>, in which case the
-     *                    suffix <code>".tmp"</code> will be used
+     *                    name; may be {@code null}, in which case the
+     *                    suffix {@code ".tmp"} will be used
      *
      * @return  An abstract pathname denoting a newly-created empty file
      *
      * @throws  IllegalArgumentException
-     *          If the <code>prefix</code> argument contains fewer than three
+     *          If the {@code prefix} argument contains fewer than three
      *          characters
      *
      * @throws  IOException  If a file could not be created
@@ -2163,8 +2163,8 @@
 
     /**
      * Tests this abstract pathname for equality with the given object.
-     * Returns <code>true</code> if and only if the argument is not
-     * <code>null</code> and is an abstract pathname that denotes the same file
+     * Returns {@code true} if and only if the argument is not
+     * {@code null} and is an abstract pathname that denotes the same file
      * or directory as this abstract pathname.  Whether or not two abstract
      * pathnames are equal depends upon the underlying system.  On UNIX
      * systems, alphabetic case is significant in comparing pathnames; on Microsoft Windows
@@ -2172,8 +2172,8 @@
      *
      * @param   obj   The object to be compared with this abstract pathname
      *
-     * @return  <code>true</code> if and only if the objects are the same;
-     *          <code>false</code> otherwise
+     * @return  {@code true} if and only if the objects are the same;
+     *          {@code false} otherwise
      */
     public boolean equals(Object obj) {
         if ((obj != null) && (obj instanceof File)) {
@@ -2188,10 +2188,10 @@
      * of their hash codes.  On UNIX systems, the hash code of an abstract
      * pathname is equal to the exclusive <em>or</em> of the hash code
      * of its pathname string and the decimal value
-     * <code>1234321</code>.  On Microsoft Windows systems, the hash
+     * {@code 1234321}.  On Microsoft Windows systems, the hash
      * code is equal to the exclusive <em>or</em> of the hash code of
      * its pathname string converted to lower case and the decimal
-     * value <code>1234321</code>.  Locale is not taken into account on
+     * value {@code 1234321}.  Locale is not taken into account on
      * lowercasing the pathname string.
      *
      * @return  A hash code for this abstract pathname
--- a/src/java.base/share/classes/java/io/FileFilter.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/FileFilter.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, 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
@@ -43,7 +43,7 @@
      * included in a pathname list.
      *
      * @param  pathname  The abstract pathname to be tested
-     * @return  <code>true</code> if and only if <code>pathname</code>
+     * @return  {@code true} if and only if {@code pathname}
      *          should be included
      */
     boolean accept(File pathname);
--- a/src/java.base/share/classes/java/io/FileInputStream.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/FileInputStream.java	Wed Sep 25 22:40:41 2019 +0200
@@ -30,13 +30,13 @@
 
 
 /**
- * A <code>FileInputStream</code> obtains input bytes
+ * A {@code FileInputStream} obtains input bytes
  * from a file in a file system. What files
  * are  available depends on the host environment.
  *
- * <p><code>FileInputStream</code> is meant for reading streams of raw bytes
+ * <p>{@code FileInputStream} is meant for reading streams of raw bytes
  * such as image data. For reading streams of characters, consider using
- * <code>FileReader</code>.
+ * {@code FileReader}.
  *
  * @apiNote
  * To release resources used by this stream {@link #close} should be called
@@ -80,21 +80,21 @@
     private volatile boolean closed;
 
     /**
-     * Creates a <code>FileInputStream</code> by
+     * Creates a {@code FileInputStream} by
      * opening a connection to an actual file,
-     * the file named by the path name <code>name</code>
-     * in the file system.  A new <code>FileDescriptor</code>
+     * the file named by the path name {@code name}
+     * in the file system.  A new {@code FileDescriptor}
      * object is created to represent this file
      * connection.
      * <p>
      * First, if there is a security
-     * manager, its <code>checkRead</code> method
-     * is called with the <code>name</code> argument
+     * manager, its {@code checkRead} method
+     * is called with the {@code name} argument
      * as its argument.
      * <p>
      * If the named file does not exist, is a directory rather than a regular
      * file, or for some other reason cannot be opened for reading then a
-     * <code>FileNotFoundException</code> is thrown.
+     * {@code FileNotFoundException} is thrown.
      *
      * @param      name   the system-dependent file name.
      * @throws     FileNotFoundException  if the file does not exist,
@@ -102,7 +102,7 @@
      *             or for some other reason cannot be opened for
      *             reading.
      * @throws     SecurityException      if a security manager exists and its
-     *             <code>checkRead</code> method denies read access
+     *             {@code checkRead} method denies read access
      *             to the file.
      * @see        java.lang.SecurityManager#checkRead(java.lang.String)
      */
@@ -111,21 +111,21 @@
     }
 
     /**
-     * Creates a <code>FileInputStream</code> by
+     * Creates a {@code FileInputStream} by
      * opening a connection to an actual file,
-     * the file named by the <code>File</code>
-     * object <code>file</code> in the file system.
-     * A new <code>FileDescriptor</code> object
+     * the file named by the {@code File}
+     * object {@code file} in the file system.
+     * A new {@code FileDescriptor} object
      * is created to represent this file connection.
      * <p>
      * First, if there is a security manager,
-     * its <code>checkRead</code> method  is called
-     * with the path represented by the <code>file</code>
+     * its {@code checkRead} method  is called
+     * with the path represented by the {@code file}
      * argument as its argument.
      * <p>
      * If the named file does not exist, is a directory rather than a regular
      * file, or for some other reason cannot be opened for reading then a
-     * <code>FileNotFoundException</code> is thrown.
+     * {@code FileNotFoundException} is thrown.
      *
      * @param      file   the file to be opened for reading.
      * @throws     FileNotFoundException  if the file does not exist,
@@ -133,7 +133,7 @@
      *             or for some other reason cannot be opened for
      *             reading.
      * @throws     SecurityException      if a security manager exists and its
-     *             <code>checkRead</code> method denies read access to the file.
+     *             {@code checkRead} method denies read access to the file.
      * @see        java.io.File#getPath()
      * @see        java.lang.SecurityManager#checkRead(java.lang.String)
      */
@@ -157,26 +157,26 @@
     }
 
     /**
-     * Creates a <code>FileInputStream</code> by using the file descriptor
-     * <code>fdObj</code>, which represents an existing connection to an
+     * Creates a {@code FileInputStream} by using the file descriptor
+     * {@code fdObj}, which represents an existing connection to an
      * actual file in the file system.
      * <p>
-     * If there is a security manager, its <code>checkRead</code> method is
-     * called with the file descriptor <code>fdObj</code> as its argument to
+     * If there is a security manager, its {@code checkRead} method is
+     * called with the file descriptor {@code fdObj} as its argument to
      * see if it's ok to read the file descriptor. If read access is denied
-     * to the file descriptor a <code>SecurityException</code> is thrown.
+     * to the file descriptor a {@code SecurityException} is thrown.
      * <p>
-     * If <code>fdObj</code> is null then a <code>NullPointerException</code>
+     * If {@code fdObj} is null then a {@code NullPointerException}
      * is thrown.
      * <p>
-     * This constructor does not throw an exception if <code>fdObj</code>
+     * This constructor does not throw an exception if {@code fdObj}
      * is {@link java.io.FileDescriptor#valid() invalid}.
      * However, if the methods are invoked on the resulting stream to attempt
-     * I/O on the stream, an <code>IOException</code> is thrown.
+     * I/O on the stream, an {@code IOException} is thrown.
      *
      * @param      fdObj   the file descriptor to be opened for reading.
      * @throws     SecurityException      if a security manager exists and its
-     *             <code>checkRead</code> method denies read access to the
+     *             {@code checkRead} method denies read access to the
      *             file descriptor.
      * @see        SecurityManager#checkRead(java.io.FileDescriptor)
      */
@@ -217,7 +217,7 @@
      * Reads a byte of data from this input stream. This method blocks
      * if no input is yet available.
      *
-     * @return     the next byte of data, or <code>-1</code> if the end of the
+     * @return     the next byte of data, or {@code -1} if the end of the
      *             file is reached.
      * @throws     IOException  if an I/O error occurs.
      */
@@ -237,13 +237,13 @@
     private native int readBytes(byte b[], int off, int len) throws IOException;
 
     /**
-     * Reads up to <code>b.length</code> bytes of data from this input
+     * Reads up to {@code b.length} bytes of data from this input
      * stream into an array of bytes. This method blocks until some input
      * is available.
      *
      * @param      b   the buffer into which the data is read.
      * @return     the total number of bytes read into the buffer, or
-     *             <code>-1</code> if there is no more data because the end of
+     *             {@code -1} if there is no more data because the end of
      *             the file has been reached.
      * @throws     IOException  if an I/O error occurs.
      */
@@ -252,21 +252,21 @@
     }
 
     /**
-     * Reads up to <code>len</code> bytes of data from this input stream
-     * into an array of bytes. If <code>len</code> is not zero, the method
+     * Reads up to {@code len} bytes of data from this input stream
+     * into an array of bytes. If {@code len} is not zero, the method
      * blocks until some input is available; otherwise, no
-     * bytes are read and <code>0</code> is returned.
+     * bytes are read and {@code 0} is returned.
      *
      * @param      b     the buffer into which the data is read.
-     * @param      off   the start offset in the destination array <code>b</code>
+     * @param      off   the start offset in the destination array {@code b}
      * @param      len   the maximum number of bytes read.
      * @return     the total number of bytes read into the buffer, or
-     *             <code>-1</code> if there is no more data because the end of
+     *             {@code -1} if there is no more data because the end of
      *             the file has been reached.
-     * @throws     NullPointerException If <code>b</code> is <code>null</code>.
-     * @throws     IndexOutOfBoundsException If <code>off</code> is negative,
-     *             <code>len</code> is negative, or <code>len</code> is greater than
-     *             <code>b.length - off</code>
+     * @throws     NullPointerException If {@code b} is {@code null}.
+     * @throws     IndexOutOfBoundsException If {@code off} is negative,
+     *             {@code len} is negative, or {@code len} is greater than
+     *             {@code b.length - off}
      * @throws     IOException  if an I/O error occurs.
      */
     public int read(byte b[], int off, int len) throws IOException {
@@ -274,14 +274,14 @@
     }
 
     /**
-     * Skips over and discards <code>n</code> bytes of data from the
+     * Skips over and discards {@code n} bytes of data from the
      * input stream.
      *
-     * <p>The <code>skip</code> method may, for a variety of
+     * <p>The {@code skip} method may, for a variety of
      * reasons, end up skipping over some smaller number of bytes,
-     * possibly <code>0</code>. If <code>n</code> is negative, the method
+     * possibly {@code 0}. If {@code n} is negative, the method
      * will try to skip backwards. In case the backing file does not support
-     * backward skip at its current position, an <code>IOException</code> is
+     * backward skip at its current position, an {@code IOException} is
      * thrown. The actual number of bytes skipped is returned. If it skips
      * forwards, it returns a positive value. If it skips backwards, it
      * returns a negative value.
@@ -372,10 +372,10 @@
     }
 
     /**
-     * Returns the <code>FileDescriptor</code>
+     * Returns the {@code FileDescriptor}
      * object  that represents the connection to
      * the actual file in the file system being
-     * used by this <code>FileInputStream</code>.
+     * used by this {@code FileInputStream}.
      *
      * @return     the file descriptor object associated with this stream.
      * @throws     IOException  if an I/O error occurs.
--- a/src/java.base/share/classes/java/io/FileNotFoundException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/FileNotFoundException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -45,19 +45,19 @@
     private static final long serialVersionUID = -897856973823710492L;
 
     /**
-     * Constructs a <code>FileNotFoundException</code> with
-     * <code>null</code> as its error detail message.
+     * Constructs a {@code FileNotFoundException} with
+     * {@code null} as its error detail message.
      */
     public FileNotFoundException() {
         super();
     }
 
     /**
-     * Constructs a <code>FileNotFoundException</code> with the
-     * specified detail message. The string <code>s</code> can be
+     * Constructs a {@code FileNotFoundException} with the
+     * specified detail message. The string {@code s} can be
      * retrieved later by the
      * <code>{@link java.lang.Throwable#getMessage}</code>
-     * method of class <code>java.lang.Throwable</code>.
+     * method of class {@code java.lang.Throwable}.
      *
      * @param   s   the detail message.
      */
@@ -66,9 +66,9 @@
     }
 
     /**
-     * Constructs a <code>FileNotFoundException</code> with a detail message
+     * Constructs a {@code FileNotFoundException} with a detail message
      * consisting of the given pathname string followed by the given reason
-     * string.  If the <code>reason</code> argument is <code>null</code> then
+     * string.  If the {@code reason} argument is {@code null} then
      * it will be omitted.  This private constructor is invoked only by native
      * I/O methods.
      *
--- a/src/java.base/share/classes/java/io/FileOutputStream.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/FileOutputStream.java	Wed Sep 25 22:40:41 2019 +0200
@@ -33,16 +33,16 @@
 
 /**
  * A file output stream is an output stream for writing data to a
- * <code>File</code> or to a <code>FileDescriptor</code>. Whether or not
+ * {@code File} or to a {@code FileDescriptor}. Whether or not
  * a file is available or may be created depends upon the underlying
  * platform.  Some platforms, in particular, allow a file to be opened
  * for writing by only one {@code FileOutputStream} (or other
  * file-writing object) at a time.  In such situations the constructors in
  * this class will fail if the file involved is already open.
  *
- * <p><code>FileOutputStream</code> is meant for writing streams of raw bytes
+ * <p>{@code FileOutputStream} is meant for writing streams of raw bytes
  * such as image data. For writing streams of characters, consider using
- * <code>FileWriter</code>.
+ * {@code FileWriter}.
  *
  * @apiNote
  * To release resources used by this stream {@link #close} should be called
@@ -97,15 +97,15 @@
 
     /**
      * Creates a file output stream to write to the file with the
-     * specified name. A new <code>FileDescriptor</code> object is
+     * specified name. A new {@code FileDescriptor} object is
      * created to represent this file connection.
      * <p>
-     * First, if there is a security manager, its <code>checkWrite</code>
-     * method is called with <code>name</code> as its argument.
+     * First, if there is a security manager, its {@code checkWrite}
+     * method is called with {@code name} as its argument.
      * <p>
      * If the file exists but is a directory rather than a regular file, does
      * not exist but cannot be created, or cannot be opened for any other
-     * reason then a <code>FileNotFoundException</code> is thrown.
+     * reason then a {@code FileNotFoundException} is thrown.
      *
      * @implSpec Invoking this constructor with the parameter {@code name} is
      * equivalent to invoking {@link #FileOutputStream(String,boolean)
@@ -116,7 +116,7 @@
      *                   rather than a regular file, does not exist but cannot
      *                   be created, or cannot be opened for any other reason
      * @throws     SecurityException  if a security manager exists and its
-     *               <code>checkWrite</code> method denies write access
+     *               {@code checkWrite} method denies write access
      *               to the file.
      * @see        java.lang.SecurityManager#checkWrite(java.lang.String)
      */
@@ -126,26 +126,26 @@
 
     /**
      * Creates a file output stream to write to the file with the specified
-     * name.  If the second argument is <code>true</code>, then
+     * name.  If the second argument is {@code true}, then
      * bytes will be written to the end of the file rather than the beginning.
-     * A new <code>FileDescriptor</code> object is created to represent this
+     * A new {@code FileDescriptor} object is created to represent this
      * file connection.
      * <p>
-     * First, if there is a security manager, its <code>checkWrite</code>
-     * method is called with <code>name</code> as its argument.
+     * First, if there is a security manager, its {@code checkWrite}
+     * method is called with {@code name} as its argument.
      * <p>
      * If the file exists but is a directory rather than a regular file, does
      * not exist but cannot be created, or cannot be opened for any other
-     * reason then a <code>FileNotFoundException</code> is thrown.
+     * reason then a {@code FileNotFoundException} is thrown.
      *
      * @param     name        the system-dependent file name
-     * @param     append      if <code>true</code>, then bytes will be written
+     * @param     append      if {@code true}, then bytes will be written
      *                   to the end of the file rather than the beginning
      * @throws     FileNotFoundException  if the file exists but is a directory
      *                   rather than a regular file, does not exist but cannot
      *                   be created, or cannot be opened for any other reason.
      * @throws     SecurityException  if a security manager exists and its
-     *               <code>checkWrite</code> method denies write access
+     *               {@code checkWrite} method denies write access
      *               to the file.
      * @see        java.lang.SecurityManager#checkWrite(java.lang.String)
      * @since     1.1
@@ -158,24 +158,24 @@
 
     /**
      * Creates a file output stream to write to the file represented by
-     * the specified <code>File</code> object. A new
-     * <code>FileDescriptor</code> object is created to represent this
+     * the specified {@code File} object. A new
+     * {@code FileDescriptor} object is created to represent this
      * file connection.
      * <p>
-     * First, if there is a security manager, its <code>checkWrite</code>
-     * method is called with the path represented by the <code>file</code>
+     * First, if there is a security manager, its {@code checkWrite}
+     * method is called with the path represented by the {@code file}
      * argument as its argument.
      * <p>
      * If the file exists but is a directory rather than a regular file, does
      * not exist but cannot be created, or cannot be opened for any other
-     * reason then a <code>FileNotFoundException</code> is thrown.
+     * reason then a {@code FileNotFoundException} is thrown.
      *
      * @param      file               the file to be opened for writing.
      * @throws     FileNotFoundException  if the file exists but is a directory
      *                   rather than a regular file, does not exist but cannot
      *                   be created, or cannot be opened for any other reason
      * @throws     SecurityException  if a security manager exists and its
-     *               <code>checkWrite</code> method denies write access
+     *               {@code checkWrite} method denies write access
      *               to the file.
      * @see        java.io.File#getPath()
      * @see        java.lang.SecurityException
@@ -187,27 +187,27 @@
 
     /**
      * Creates a file output stream to write to the file represented by
-     * the specified <code>File</code> object. If the second argument is
-     * <code>true</code>, then bytes will be written to the end of the file
-     * rather than the beginning. A new <code>FileDescriptor</code> object is
+     * the specified {@code File} object. If the second argument is
+     * {@code true}, then bytes will be written to the end of the file
+     * rather than the beginning. A new {@code FileDescriptor} object is
      * created to represent this file connection.
      * <p>
-     * First, if there is a security manager, its <code>checkWrite</code>
-     * method is called with the path represented by the <code>file</code>
+     * First, if there is a security manager, its {@code checkWrite}
+     * method is called with the path represented by the {@code file}
      * argument as its argument.
      * <p>
      * If the file exists but is a directory rather than a regular file, does
      * not exist but cannot be created, or cannot be opened for any other
-     * reason then a <code>FileNotFoundException</code> is thrown.
+     * reason then a {@code FileNotFoundException} is thrown.
      *
      * @param      file               the file to be opened for writing.
-     * @param     append      if <code>true</code>, then bytes will be written
+     * @param     append      if {@code true}, then bytes will be written
      *                   to the end of the file rather than the beginning
      * @throws     FileNotFoundException  if the file exists but is a directory
      *                   rather than a regular file, does not exist but cannot
      *                   be created, or cannot be opened for any other reason
      * @throws     SecurityException  if a security manager exists and its
-     *               <code>checkWrite</code> method denies write access
+     *               {@code checkWrite} method denies write access
      *               to the file.
      * @see        java.io.File#getPath()
      * @see        java.lang.SecurityException
@@ -241,21 +241,21 @@
      * descriptor, which represents an existing connection to an actual
      * file in the file system.
      * <p>
-     * First, if there is a security manager, its <code>checkWrite</code>
-     * method is called with the file descriptor <code>fdObj</code>
+     * First, if there is a security manager, its {@code checkWrite}
+     * method is called with the file descriptor {@code fdObj}
      * argument as its argument.
      * <p>
-     * If <code>fdObj</code> is null then a <code>NullPointerException</code>
+     * If {@code fdObj} is null then a {@code NullPointerException}
      * is thrown.
      * <p>
-     * This constructor does not throw an exception if <code>fdObj</code>
+     * This constructor does not throw an exception if {@code fdObj}
      * is {@link java.io.FileDescriptor#valid() invalid}.
      * However, if the methods are invoked on the resulting stream to attempt
-     * I/O on the stream, an <code>IOException</code> is thrown.
+     * I/O on the stream, an {@code IOException} is thrown.
      *
      * @param      fdObj   the file descriptor to be opened for writing
      * @throws     SecurityException  if a security manager exists and its
-     *               <code>checkWrite</code> method denies
+     *               {@code checkWrite} method denies
      *               write access to the file descriptor
      * @see        java.lang.SecurityManager#checkWrite(java.io.FileDescriptor)
      */
@@ -303,7 +303,7 @@
 
     /**
      * Writes the specified byte to this file output stream. Implements
-     * the <code>write</code> method of <code>OutputStream</code>.
+     * the {@code write} method of {@code OutputStream}.
      *
      * @param      b   the byte to be written.
      * @throws     IOException  if an I/O error occurs.
@@ -325,7 +325,7 @@
         throws IOException;
 
     /**
-     * Writes <code>b.length</code> bytes from the specified byte array
+     * Writes {@code b.length} bytes from the specified byte array
      * to this file output stream.
      *
      * @param      b   the data.
@@ -336,8 +336,8 @@
     }
 
     /**
-     * Writes <code>len</code> bytes from the specified byte array
-     * starting at offset <code>off</code> to this file output stream.
+     * Writes {@code len} bytes from the specified byte array
+     * starting at offset {@code off} to this file output stream.
      *
      * @param      b     the data.
      * @param      off   the start offset in the data.
@@ -397,9 +397,9 @@
     /**
      * Returns the file descriptor associated with this stream.
      *
-     * @return  the <code>FileDescriptor</code> object that represents
+     * @return  the {@code FileDescriptor} object that represents
      *          the connection to the file in the file system being used
-     *          by this <code>FileOutputStream</code> object.
+     *          by this {@code FileOutputStream} object.
      *
      * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FileDescriptor
--- a/src/java.base/share/classes/java/io/FilePermission.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/FilePermission.java	Wed Sep 25 22:40:41 2019 +0200
@@ -46,7 +46,7 @@
  * <P>
  * Pathname is the pathname of the file or directory granted the specified
  * actions. A pathname that ends in "/*" (where "/" is
- * the file separator character, <code>File.separatorChar</code>) indicates
+ * the file separator character, {@code File.separatorChar}) indicates
  * all the files and directories contained in that directory. A pathname
  * that ends with "/-" indicates (recursively) all files
  * and subdirectories contained in that directory. Such a pathname is called
@@ -70,11 +70,11 @@
  *    <DT> read <DD> read permission
  *    <DT> write <DD> write permission
  *    <DT> execute
- *    <DD> execute permission. Allows <code>Runtime.exec</code> to
- *         be called. Corresponds to <code>SecurityManager.checkExec</code>.
+ *    <DD> execute permission. Allows {@code Runtime.exec} to
+ *         be called. Corresponds to {@code SecurityManager.checkExec}.
  *    <DT> delete
- *    <DD> delete permission. Allows <code>File.delete</code> to
- *         be called. Corresponds to <code>SecurityManager.checkDelete</code>.
+ *    <DD> delete permission. Allows {@code File.delete} to
+ *         be called. Corresponds to {@code SecurityManager.checkDelete}.
  *    <DT> readlink
  *    <DD> read link permission. Allows the target of a
  *         <a href="../nio/file/package-summary.html#links">symbolic link</a>
@@ -426,7 +426,7 @@
      * "read", "write", "execute", "delete", and "readlink".
      *
      * <p>A pathname that ends in "/*" (where "/" is
-     * the file separator character, <code>File.separatorChar</code>)
+     * the file separator character, {@code File.separatorChar})
      * indicates all the files and directories contained in that directory.
      * A pathname that ends with "/-" indicates (recursively) all files and
      * subdirectories contained in that directory. The special pathname
@@ -468,7 +468,7 @@
      * @param actions the action string.
      *
      * @throws IllegalArgumentException
-     *          If actions is <code>null</code>, empty or contains an action
+     *          If actions is {@code null}, empty or contains an action
      *          other than the specified possible actions.
      */
     public FilePermission(String path, String actions) {
@@ -481,7 +481,7 @@
      * More efficient than the FilePermission(String, String) constructor.
      * Can be used from within
      * code that needs to create a FilePermission object to pass into the
-     * <code>implies</code> method.
+     * {@code implies} method.
      *
      * @param path the pathname of the file/directory.
      * @param mask the action mask to use.
@@ -547,9 +547,9 @@
      *
      * @param p the permission to check against.
      *
-     * @return <code>true</code> if the specified permission is not
-     *                  <code>null</code> and is implied by this object,
-     *                  <code>false</code> otherwise.
+     * @return {@code true} if the specified permission is not
+     *                  {@code null} and is implied by this object,
+     *                  {@code false} otherwise.
      */
     @Override
     public boolean implies(Permission p) {
@@ -769,9 +769,9 @@
      * for itself, even if they are created using the same invalid path.
      *
      * @param obj the object we are testing for equality with this object.
-     * @return <code>true</code> if obj is a FilePermission, and has the same
+     * @return {@code true} if obj is a FilePermission, and has the same
      *          pathname and actions as this FilePermission object,
-     *          <code>false</code> otherwise.
+     *          {@code false} otherwise.
      */
     @Override
     public boolean equals(Object obj) {
@@ -987,7 +987,7 @@
      * Returns the "canonical string representation" of the actions.
      * That is, this method always returns present actions in the following order:
      * read, write, execute, delete, readlink. For example, if this FilePermission
-     * object allows both write and read actions, a call to <code>getActions</code>
+     * object allows both write and read actions, a call to {@code getActions}
      * will return the string "read,write".
      *
      * @return the canonical string representation of the actions.
@@ -1006,27 +1006,27 @@
      * <p>
      * FilePermission objects must be stored in a manner that allows them
      * to be inserted into the collection in any order, but that also enables the
-     * PermissionCollection <code>implies</code>
+     * PermissionCollection {@code implies}
      * method to be implemented in an efficient (and consistent) manner.
      *
      * <p>For example, if you have two FilePermissions:
      * <OL>
-     * <LI>  <code>"/tmp/-", "read"</code>
-     * <LI>  <code>"/tmp/scratch/foo", "write"</code>
+     * <LI>  {@code "/tmp/-", "read"}
+     * <LI>  {@code "/tmp/scratch/foo", "write"}
      * </OL>
      *
-     * <p>and you are calling the <code>implies</code> method with the FilePermission:
+     * <p>and you are calling the {@code implies} method with the FilePermission:
      *
      * <pre>
      *   "/tmp/scratch/foo", "read,write",
      * </pre>
      *
-     * then the <code>implies</code> function must
+     * then the {@code implies} function must
      * take into account both the "/tmp/-" and "/tmp/scratch/foo"
      * permissions, so the effective permission is "read,write",
-     * and <code>implies</code> returns true. The "implies" semantics for
+     * and {@code implies} returns true. The "implies" semantics for
      * FilePermissions are handled properly by the PermissionCollection object
-     * returned by this <code>newPermissionCollection</code> method.
+     * returned by this {@code newPermissionCollection} method.
      *
      * @return a new PermissionCollection object suitable for storing
      * FilePermissions.
--- a/src/java.base/share/classes/java/io/FileSystem.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/FileSystem.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, 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
@@ -148,7 +148,7 @@
 
     /**
      * Create a new empty file with the given pathname.  Return
-     * <code>true</code> if the file was created and <code>false</code> if a
+     * {@code true} if the file was created and {@code false} if a
      * file or directory with the given pathname already exists.  Throw an
      * IOException if an I/O error occurs.
      */
@@ -157,40 +157,40 @@
 
     /**
      * Delete the file or directory denoted by the given abstract pathname,
-     * returning <code>true</code> if and only if the operation succeeds.
+     * returning {@code true} if and only if the operation succeeds.
      */
     public abstract boolean delete(File f);
 
     /**
      * List the elements of the directory denoted by the given abstract
      * pathname.  Return an array of strings naming the elements of the
-     * directory if successful; otherwise, return <code>null</code>.
+     * directory if successful; otherwise, return {@code null}.
      */
     public abstract String[] list(File f);
 
     /**
      * Create a new directory denoted by the given abstract pathname,
-     * returning <code>true</code> if and only if the operation succeeds.
+     * returning {@code true} if and only if the operation succeeds.
      */
     public abstract boolean createDirectory(File f);
 
     /**
      * Rename the file or directory denoted by the first abstract pathname to
-     * the second abstract pathname, returning <code>true</code> if and only if
+     * the second abstract pathname, returning {@code true} if and only if
      * the operation succeeds.
      */
     public abstract boolean rename(File f1, File f2);
 
     /**
      * Set the last-modified time of the file or directory denoted by the
-     * given abstract pathname, returning <code>true</code> if and only if the
+     * given abstract pathname, returning {@code true} if and only if the
      * operation succeeds.
      */
     public abstract boolean setLastModifiedTime(File f, long time);
 
     /**
      * Mark the file or directory denoted by the given abstract pathname as
-     * read-only, returning <code>true</code> if and only if the operation
+     * read-only, returning {@code true} if and only if the operation
      * succeeds.
      */
     public abstract boolean setReadOnly(File f);
--- a/src/java.base/share/classes/java/io/FilenameFilter.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/FilenameFilter.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2013, 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
@@ -28,8 +28,8 @@
 /**
  * Instances of classes that implement this interface are used to
  * filter filenames. These instances are used to filter directory
- * listings in the <code>list</code> method of class
- * <code>File</code>, and by the Abstract Window Toolkit's file
+ * listings in the {@code list} method of class
+ * {@code File}, and by the Abstract Window Toolkit's file
  * dialog component.
  *
  * @author  Arthur van Hoff
@@ -46,8 +46,8 @@
      *
      * @param   dir    the directory in which the file was found.
      * @param   name   the name of the file.
-     * @return  <code>true</code> if and only if the name should be
-     * included in the file list; <code>false</code> otherwise.
+     * @return  {@code true} if and only if the name should be
+     * included in the file list; {@code false} otherwise.
      */
     boolean accept(File dir, String name);
 }
--- a/src/java.base/share/classes/java/io/FilterInputStream.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/FilterInputStream.java	Wed Sep 25 22:40:41 2019 +0200
@@ -26,15 +26,15 @@
 package java.io;
 
 /**
- * A <code>FilterInputStream</code> contains
+ * A {@code FilterInputStream} contains
  * some other input stream, which it uses as
  * its  basic source of data, possibly transforming
  * the data along the way or providing  additional
- * functionality. The class <code>FilterInputStream</code>
+ * functionality. The class {@code FilterInputStream}
  * itself simply overrides all  methods of
- * <code>InputStream</code> with versions that
+ * {@code InputStream} with versions that
  * pass all requests to the contained  input
- * stream. Subclasses of <code>FilterInputStream</code>
+ * stream. Subclasses of {@code FilterInputStream}
  * may further override some of  these methods
  * and may also provide additional methods
  * and fields.
@@ -50,12 +50,12 @@
     protected volatile InputStream in;
 
     /**
-     * Creates a <code>FilterInputStream</code>
-     * by assigning the  argument <code>in</code>
-     * to the field <code>this.in</code> so as
+     * Creates a {@code FilterInputStream}
+     * by assigning the  argument {@code in}
+     * to the field {@code this.in} so as
      * to remember it for later use.
      *
-     * @param   in   the underlying input stream, or <code>null</code> if
+     * @param   in   the underlying input stream, or {@code null} if
      *          this instance is to be created without an underlying stream.
      */
     protected FilterInputStream(InputStream in) {
@@ -64,17 +64,17 @@
 
     /**
      * Reads the next byte of data from this input stream. The value
-     * byte is returned as an <code>int</code> in the range
-     * <code>0</code> to <code>255</code>. If no byte is available
+     * byte is returned as an {@code int} in the range
+     * {@code 0} to {@code 255}. If no byte is available
      * because the end of the stream has been reached, the value
-     * <code>-1</code> is returned. This method blocks until input data
+     * {@code -1} is returned. This method blocks until input data
      * is available, the end of the stream is detected, or an exception
      * is thrown.
      * <p>
      * This method
-     * simply performs <code>in.read()</code> and returns the result.
+     * simply performs {@code in.read()} and returns the result.
      *
-     * @return     the next byte of data, or <code>-1</code> if the end of the
+     * @return     the next byte of data, or {@code -1} if the end of the
      *             stream is reached.
      * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterInputStream#in
@@ -84,21 +84,21 @@
     }
 
     /**
-     * Reads up to <code>b.length</code> bytes of data from this
+     * Reads up to {@code b.length} bytes of data from this
      * input stream into an array of bytes. This method blocks until some
      * input is available.
      * <p>
      * This method simply performs the call
-     * <code>read(b, 0, b.length)</code> and returns
+     * {@code read(b, 0, b.length)} and returns
      * the  result. It is important that it does
-     * <i>not</i> do <code>in.read(b)</code> instead;
-     * certain subclasses of  <code>FilterInputStream</code>
+     * <i>not</i> do {@code in.read(b)} instead;
+     * certain subclasses of  {@code FilterInputStream}
      * depend on the implementation strategy actually
      * used.
      *
      * @param      b   the buffer into which the data is read.
      * @return     the total number of bytes read into the buffer, or
-     *             <code>-1</code> if there is no more data because the end of
+     *             {@code -1} if there is no more data because the end of
      *             the stream has been reached.
      * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterInputStream#read(byte[], int, int)
@@ -108,24 +108,24 @@
     }
 
     /**
-     * Reads up to <code>len</code> bytes of data from this input stream
-     * into an array of bytes. If <code>len</code> is not zero, the method
+     * Reads up to {@code len} bytes of data from this input stream
+     * into an array of bytes. If {@code len} is not zero, the method
      * blocks until some input is available; otherwise, no
-     * bytes are read and <code>0</code> is returned.
+     * bytes are read and {@code 0} is returned.
      * <p>
-     * This method simply performs <code>in.read(b, off, len)</code>
+     * This method simply performs {@code in.read(b, off, len)}
      * and returns the result.
      *
      * @param      b     the buffer into which the data is read.
-     * @param      off   the start offset in the destination array <code>b</code>
+     * @param      off   the start offset in the destination array {@code b}
      * @param      len   the maximum number of bytes read.
      * @return     the total number of bytes read into the buffer, or
-     *             <code>-1</code> if there is no more data because the end of
+     *             {@code -1} if there is no more data because the end of
      *             the stream has been reached.
-     * @throws     NullPointerException If <code>b</code> is <code>null</code>.
-     * @throws     IndexOutOfBoundsException If <code>off</code> is negative,
-     *             <code>len</code> is negative, or <code>len</code> is greater than
-     *             <code>b.length - off</code>
+     * @throws     NullPointerException If {@code b} is {@code null}.
+     * @throws     IndexOutOfBoundsException If {@code off} is negative,
+     *             {@code len} is negative, or {@code len} is greater than
+     *             {@code b.length - off}
      * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterInputStream#in
      */
@@ -134,13 +134,13 @@
     }
 
     /**
-     * Skips over and discards <code>n</code> bytes of data from the
-     * input stream. The <code>skip</code> method may, for a variety of
+     * Skips over and discards {@code n} bytes of data from the
+     * input stream. The {@code skip} method may, for a variety of
      * reasons, end up skipping over some smaller number of bytes,
-     * possibly <code>0</code>. The actual number of bytes skipped is
+     * possibly {@code 0}. The actual number of bytes skipped is
      * returned.
      * <p>
-     * This method simply performs <code>in.skip(n)</code>.
+     * This method simply performs {@code in.skip(n)}.
      *
      * @param      n   the number of bytes to be skipped.
      * @return     the actual number of bytes skipped.
@@ -171,7 +171,7 @@
      * Closes this input stream and releases any system resources
      * associated with the stream.
      * This
-     * method simply performs <code>in.close()</code>.
+     * method simply performs {@code in.close()}.
      *
      * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterInputStream#in
@@ -182,14 +182,14 @@
 
     /**
      * Marks the current position in this input stream. A subsequent
-     * call to the <code>reset</code> method repositions this stream at
+     * call to the {@code reset} method repositions this stream at
      * the last marked position so that subsequent reads re-read the same bytes.
      * <p>
-     * The <code>readlimit</code> argument tells this input stream to
+     * The {@code readlimit} argument tells this input stream to
      * allow that many bytes to be read before the mark position gets
      * invalidated.
      * <p>
-     * This method simply performs <code>in.mark(readlimit)</code>.
+     * This method simply performs {@code in.mark(readlimit)}.
      *
      * @param   readlimit   the maximum limit of bytes that can be read before
      *                      the mark position becomes invalid.
@@ -202,10 +202,10 @@
 
     /**
      * Repositions this stream to the position at the time the
-     * <code>mark</code> method was last called on this input stream.
+     * {@code mark} method was last called on this input stream.
      * <p>
      * This method
-     * simply performs <code>in.reset()</code>.
+     * simply performs {@code in.reset()}.
      * <p>
      * Stream marks are intended to be used in
      * situations where you need to read ahead a little to see what's in
@@ -226,14 +226,14 @@
     }
 
     /**
-     * Tests if this input stream supports the <code>mark</code>
-     * and <code>reset</code> methods.
+     * Tests if this input stream supports the {@code mark}
+     * and {@code reset} methods.
      * This method
-     * simply performs <code>in.markSupported()</code>.
+     * simply performs {@code in.markSupported()}.
      *
-     * @return  <code>true</code> if this stream type supports the
-     *          <code>mark</code> and <code>reset</code> method;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if this stream type supports the
+     *          {@code mark} and {@code reset} method;
+     *          {@code false} otherwise.
      * @see     java.io.FilterInputStream#in
      * @see     java.io.InputStream#mark(int)
      * @see     java.io.InputStream#reset()
--- a/src/java.base/share/classes/java/io/FilterOutputStream.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/FilterOutputStream.java	Wed Sep 25 22:40:41 2019 +0200
@@ -32,10 +32,10 @@
  * basic sink of data, but possibly transforming the data along the
  * way or providing additional functionality.
  * <p>
- * The class <code>FilterOutputStream</code> itself simply overrides
- * all methods of <code>OutputStream</code> with versions that pass
+ * The class {@code FilterOutputStream} itself simply overrides
+ * all methods of {@code OutputStream} with versions that pass
  * all requests to the underlying output stream. Subclasses of
- * <code>FilterOutputStream</code> may further override some of these
+ * {@code FilterOutputStream} may further override some of these
  * methods as well as provide additional methods and fields.
  *
  * @author  Jonathan Payne
@@ -63,7 +63,7 @@
      *
      * @param   out   the underlying output stream to be assigned to
      *                the field {@code this.out} for later use, or
-     *                <code>null</code> if this instance is to be
+     *                {@code null} if this instance is to be
      *                created without an underlying stream.
      */
     public FilterOutputStream(OutputStream out) {
@@ -71,15 +71,15 @@
     }
 
     /**
-     * Writes the specified <code>byte</code> to this output stream.
+     * Writes the specified {@code byte} to this output stream.
      * <p>
-     * The <code>write</code> method of <code>FilterOutputStream</code>
-     * calls the <code>write</code> method of its underlying output stream,
+     * The {@code write} method of {@code FilterOutputStream}
+     * calls the {@code write} method of its underlying output stream,
      * that is, it performs {@code out.write(b)}.
      * <p>
      * Implements the abstract {@code write} method of {@code OutputStream}.
      *
-     * @param      b   the <code>byte</code>.
+     * @param      b   the {@code byte}.
      * @throws     IOException  if an I/O error occurs.
      */
     @Override
@@ -88,16 +88,16 @@
     }
 
     /**
-     * Writes <code>b.length</code> bytes to this output stream.
+     * Writes {@code b.length} bytes to this output stream.
      * <p>
-     * The <code>write</code> method of <code>FilterOutputStream</code>
-     * calls its <code>write</code> method of three arguments with the
-     * arguments <code>b</code>, <code>0</code>, and
-     * <code>b.length</code>.
+     * The {@code write} method of {@code FilterOutputStream}
+     * calls its {@code write} method of three arguments with the
+     * arguments {@code b}, {@code 0}, and
+     * {@code b.length}.
      * <p>
      * Note that this method does not call the one-argument
-     * <code>write</code> method of its underlying output stream with
-     * the single argument <code>b</code>.
+     * {@code write} method of its underlying output stream with
+     * the single argument {@code b}.
      *
      * @param      b   the data to be written.
      * @throws     IOException  if an I/O error occurs.
@@ -109,17 +109,17 @@
     }
 
     /**
-     * Writes <code>len</code> bytes from the specified
-     * <code>byte</code> array starting at offset <code>off</code> to
+     * Writes {@code len} bytes from the specified
+     * {@code byte} array starting at offset {@code off} to
      * this output stream.
      * <p>
-     * The <code>write</code> method of <code>FilterOutputStream</code>
-     * calls the <code>write</code> method of one argument on each
-     * <code>byte</code> to output.
+     * The {@code write} method of {@code FilterOutputStream}
+     * calls the {@code write} method of one argument on each
+     * {@code byte} to output.
      * <p>
-     * Note that this method does not call the <code>write</code> method
+     * Note that this method does not call the {@code write} method
      * of its underlying output stream with the same arguments. Subclasses
-     * of <code>FilterOutputStream</code> should provide a more efficient
+     * of {@code FilterOutputStream} should provide a more efficient
      * implementation of this method.
      *
      * @param      b     the data.
@@ -142,8 +142,8 @@
      * Flushes this output stream and forces any buffered output bytes
      * to be written out to the stream.
      * <p>
-     * The <code>flush</code> method of <code>FilterOutputStream</code>
-     * calls the <code>flush</code> method of its underlying output stream.
+     * The {@code flush} method of {@code FilterOutputStream}
+     * calls the {@code flush} method of its underlying output stream.
      *
      * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#out
--- a/src/java.base/share/classes/java/io/FilterReader.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/FilterReader.java	Wed Sep 25 22:40:41 2019 +0200
@@ -28,9 +28,9 @@
 
 /**
  * Abstract class for reading filtered character streams.
- * The abstract class <code>FilterReader</code> itself
+ * The abstract class {@code FilterReader} itself
  * provides default methods that pass all requests to
- * the contained stream. Subclasses of <code>FilterReader</code>
+ * the contained stream. Subclasses of {@code FilterReader}
  * should override some of these methods and may also provide
  * additional methods and fields.
  *
@@ -49,7 +49,7 @@
      * Creates a new filtered reader.
      *
      * @param in  a Reader object providing the underlying stream.
-     * @throws NullPointerException if <code>in</code> is <code>null</code>
+     * @throws NullPointerException if {@code in} is {@code null}
      */
     protected FilterReader(Reader in) {
         super(in);
--- a/src/java.base/share/classes/java/io/FilterWriter.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/FilterWriter.java	Wed Sep 25 22:40:41 2019 +0200
@@ -28,9 +28,9 @@
 
 /**
  * Abstract class for writing filtered character streams.
- * The abstract class <code>FilterWriter</code> itself
+ * The abstract class {@code FilterWriter} itself
  * provides default methods that pass all requests to the
- * contained stream. Subclasses of <code>FilterWriter</code>
+ * contained stream. Subclasses of {@code FilterWriter}
  * should override some of these methods and may also
  * provide additional methods and fields.
  *
@@ -49,7 +49,7 @@
      * Create a new filtered writer.
      *
      * @param out  a Writer object to provide the underlying stream.
-     * @throws NullPointerException if <code>out</code> is <code>null</code>
+     * @throws NullPointerException if {@code out} is {@code null}
      */
     protected FilterWriter(Writer out) {
         super(out);
--- a/src/java.base/share/classes/java/io/InputStream.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/InputStream.java	Wed Sep 25 22:40:41 2019 +0200
@@ -34,7 +34,7 @@
  * This abstract class is the superclass of all classes representing
  * an input stream of bytes.
  *
- * <p> Applications that need to define a subclass of <code>InputStream</code>
+ * <p> Applications that need to define a subclass of {@code InputStream}
  * must always provide a method that returns the next byte of input.
  *
  * @author  Arthur van Hoff
@@ -167,15 +167,15 @@
 
     /**
      * Reads the next byte of data from the input stream. The value byte is
-     * returned as an <code>int</code> in the range <code>0</code> to
-     * <code>255</code>. If no byte is available because the end of the stream
-     * has been reached, the value <code>-1</code> is returned. This method
+     * returned as an {@code int} in the range {@code 0} to
+     * {@code 255}. If no byte is available because the end of the stream
+     * has been reached, the value {@code -1} is returned. This method
      * blocks until input data is available, the end of the stream is detected,
      * or an exception is thrown.
      *
      * <p> A subclass must provide an implementation of this method.
      *
-     * @return     the next byte of data, or <code>-1</code> if the end of the
+     * @return     the next byte of data, or {@code -1} if the end of the
      *             stream is reached.
      * @throws     IOException  if an I/O error occurs.
      */
@@ -183,35 +183,35 @@
 
     /**
      * Reads some number of bytes from the input stream and stores them into
-     * the buffer array <code>b</code>. The number of bytes actually read is
+     * the buffer array {@code b}. The number of bytes actually read is
      * returned as an integer.  This method blocks until input data is
      * available, end of file is detected, or an exception is thrown.
      *
-     * <p> If the length of <code>b</code> is zero, then no bytes are read and
-     * <code>0</code> is returned; otherwise, there is an attempt to read at
+     * <p> If the length of {@code b} is zero, then no bytes are read and
+     * {@code 0} is returned; otherwise, there is an attempt to read at
      * least one byte. If no byte is available because the stream is at the
-     * end of the file, the value <code>-1</code> is returned; otherwise, at
-     * least one byte is read and stored into <code>b</code>.
+     * end of the file, the value {@code -1} is returned; otherwise, at
+     * least one byte is read and stored into {@code b}.
      *
-     * <p> The first byte read is stored into element <code>b[0]</code>, the
-     * next one into <code>b[1]</code>, and so on. The number of bytes read is,
-     * at most, equal to the length of <code>b</code>. Let <i>k</i> be the
+     * <p> The first byte read is stored into element {@code b[0]}, the
+     * next one into {@code b[1]}, and so on. The number of bytes read is,
+     * at most, equal to the length of {@code b}. Let <i>k</i> be the
      * number of bytes actually read; these bytes will be stored in elements
-     * <code>b[0]</code> through <code>b[</code><i>k</i><code>-1]</code>,
-     * leaving elements <code>b[</code><i>k</i><code>]</code> through
-     * <code>b[b.length-1]</code> unaffected.
+     * {@code b[0]} through {@code b[}<i>k</i>{@code -1]},
+     * leaving elements {@code b[}<i>k</i>{@code ]} through
+     * {@code b[b.length-1]} unaffected.
      *
-     * <p> The <code>read(b)</code> method for class <code>InputStream</code>
-     * has the same effect as: <pre><code> read(b, 0, b.length) </code></pre>
+     * <p> The {@code read(b)} method for class {@code InputStream}
+     * has the same effect as: <pre>{@code  read(b, 0, b.length) }</pre>
      *
      * @param      b   the buffer into which the data is read.
      * @return     the total number of bytes read into the buffer, or
-     *             <code>-1</code> if there is no more data because the end of
+     *             {@code -1} if there is no more data because the end of
      *             the stream has been reached.
      * @throws     IOException  If the first byte cannot be read for any reason
      *             other than the end of the file, if the input stream has been
      *             closed, or if some other I/O error occurs.
-     * @throws     NullPointerException  if <code>b</code> is <code>null</code>.
+     * @throws     NullPointerException  if {@code b} is {@code null}.
      * @see        java.io.InputStream#read(byte[], int, int)
      */
     public int read(byte b[]) throws IOException {
@@ -219,60 +219,60 @@
     }
 
     /**
-     * Reads up to <code>len</code> bytes of data from the input stream into
+     * Reads up to {@code len} bytes of data from the input stream into
      * an array of bytes.  An attempt is made to read as many as
-     * <code>len</code> bytes, but a smaller number may be read.
+     * {@code len} bytes, but a smaller number may be read.
      * The number of bytes actually read is returned as an integer.
      *
      * <p> This method blocks until input data is available, end of file is
      * detected, or an exception is thrown.
      *
-     * <p> If <code>len</code> is zero, then no bytes are read and
-     * <code>0</code> is returned; otherwise, there is an attempt to read at
+     * <p> If {@code len} is zero, then no bytes are read and
+     * {@code 0} is returned; otherwise, there is an attempt to read at
      * least one byte. If no byte is available because the stream is at end of
-     * file, the value <code>-1</code> is returned; otherwise, at least one
-     * byte is read and stored into <code>b</code>.
+     * file, the value {@code -1} is returned; otherwise, at least one
+     * byte is read and stored into {@code b}.
      *
-     * <p> The first byte read is stored into element <code>b[off]</code>, the
-     * next one into <code>b[off+1]</code>, and so on. The number of bytes read
-     * is, at most, equal to <code>len</code>. Let <i>k</i> be the number of
+     * <p> The first byte read is stored into element {@code b[off]}, the
+     * next one into {@code b[off+1]}, and so on. The number of bytes read
+     * is, at most, equal to {@code len}. Let <i>k</i> be the number of
      * bytes actually read; these bytes will be stored in elements
-     * <code>b[off]</code> through <code>b[off+</code><i>k</i><code>-1]</code>,
-     * leaving elements <code>b[off+</code><i>k</i><code>]</code> through
-     * <code>b[off+len-1]</code> unaffected.
+     * {@code b[off]} through {@code b[off+}<i>k</i>{@code -1]},
+     * leaving elements {@code b[off+}<i>k</i>{@code ]} through
+     * {@code b[off+len-1]} unaffected.
      *
-     * <p> In every case, elements <code>b[0]</code> through
-     * <code>b[off-1]</code> and elements <code>b[off+len]</code> through
-     * <code>b[b.length-1]</code> are unaffected.
+     * <p> In every case, elements {@code b[0]} through
+     * {@code b[off-1]} and elements {@code b[off+len]} through
+     * {@code b[b.length-1]} are unaffected.
      *
-     * <p> The <code>read(b,</code> <code>off,</code> <code>len)</code> method
-     * for class <code>InputStream</code> simply calls the method
-     * <code>read()</code> repeatedly. If the first such call results in an
-     * <code>IOException</code>, that exception is returned from the call to
-     * the <code>read(b,</code> <code>off,</code> <code>len)</code> method.  If
-     * any subsequent call to <code>read()</code> results in a
-     * <code>IOException</code>, the exception is caught and treated as if it
+     * <p> The {@code read(b, off, len)} method
+     * for class {@code InputStream} simply calls the method
+     * {@code read()} repeatedly. If the first such call results in an
+     * {@code IOException}, that exception is returned from the call to
+     * the {@code read(b,} {@code off,} {@code len)} method.  If
+     * any subsequent call to {@code read()} results in a
+     * {@code IOException}, the exception is caught and treated as if it
      * were end of file; the bytes read up to that point are stored into
-     * <code>b</code> and the number of bytes read before the exception
+     * {@code b} and the number of bytes read before the exception
      * occurred is returned. The default implementation of this method blocks
-     * until the requested amount of input data <code>len</code> has been read,
+     * until the requested amount of input data {@code len} has been read,
      * end of file is detected, or an exception is thrown. Subclasses are
      * encouraged to provide a more efficient implementation of this method.
      *
      * @param      b     the buffer into which the data is read.
-     * @param      off   the start offset in array <code>b</code>
+     * @param      off   the start offset in array {@code b}
      *                   at which the data is written.
      * @param      len   the maximum number of bytes to read.
      * @return     the total number of bytes read into the buffer, or
-     *             <code>-1</code> if there is no more data because the end of
+     *             {@code -1} if there is no more data because the end of
      *             the stream has been reached.
      * @throws     IOException If the first byte cannot be read for any reason
      *             other than end of file, or if the input stream has been closed,
      *             or if some other I/O error occurs.
-     * @throws     NullPointerException If <code>b</code> is <code>null</code>.
-     * @throws     IndexOutOfBoundsException If <code>off</code> is negative,
-     *             <code>len</code> is negative, or <code>len</code> is greater than
-     *             <code>b.length - off</code>
+     * @throws     NullPointerException If {@code b} is {@code null}.
+     * @throws     IndexOutOfBoundsException If {@code off} is negative,
+     *             {@code len} is negative, or {@code len} is greater than
+     *             {@code b.length - off}
      * @see        java.io.InputStream#read()
      */
     public int read(byte b[], int off, int len) throws IOException {
@@ -509,18 +509,18 @@
     }
 
     /**
-     * Skips over and discards <code>n</code> bytes of data from this input
-     * stream. The <code>skip</code> method may, for a variety of reasons, end
-     * up skipping over some smaller number of bytes, possibly <code>0</code>.
+     * Skips over and discards {@code n} bytes of data from this input
+     * stream. The {@code skip} method may, for a variety of reasons, end
+     * up skipping over some smaller number of bytes, possibly {@code 0}.
      * This may result from any of a number of conditions; reaching end of file
-     * before <code>n</code> bytes have been skipped is only one possibility.
+     * before {@code n} bytes have been skipped is only one possibility.
      * The actual number of bytes skipped is returned. If {@code n} is
      * negative, the {@code skip} method for class {@code InputStream} always
      * returns 0, and no bytes are skipped. Subclasses may handle the negative
      * value differently.
      *
-     * <p> The <code>skip</code> method implementation of this class creates a
-     * byte array and then repeatedly reads into it until <code>n</code> bytes
+     * <p> The {@code skip} method implementation of this class creates a
+     * byte array and then repeatedly reads into it until {@code n} bytes
      * have been read or the end of the stream has been reached. Subclasses are
      * encouraged to provide a more efficient implementation of this method.
      * For instance, the implementation may depend on the ability to seek.
@@ -644,7 +644,7 @@
      * Closes this input stream and releases any system resources associated
      * with the stream.
      *
-     * <p> The <code>close</code> method of <code>InputStream</code> does
+     * <p> The {@code close} method of {@code InputStream} does
      * nothing.
      *
      * @throws     IOException  if an I/O error occurs.
@@ -653,24 +653,24 @@
 
     /**
      * Marks the current position in this input stream. A subsequent call to
-     * the <code>reset</code> method repositions this stream at the last marked
+     * the {@code reset} method repositions this stream at the last marked
      * position so that subsequent reads re-read the same bytes.
      *
-     * <p> The <code>readlimit</code> arguments tells this input stream to
+     * <p> The {@code readlimit} arguments tells this input stream to
      * allow that many bytes to be read before the mark position gets
      * invalidated.
      *
-     * <p> The general contract of <code>mark</code> is that, if the method
-     * <code>markSupported</code> returns <code>true</code>, the stream somehow
-     * remembers all the bytes read after the call to <code>mark</code> and
+     * <p> The general contract of {@code mark} is that, if the method
+     * {@code markSupported} returns {@code true}, the stream somehow
+     * remembers all the bytes read after the call to {@code mark} and
      * stands ready to supply those same bytes again if and whenever the method
-     * <code>reset</code> is called.  However, the stream is not required to
-     * remember any data at all if more than <code>readlimit</code> bytes are
-     * read from the stream before <code>reset</code> is called.
+     * {@code reset} is called.  However, the stream is not required to
+     * remember any data at all if more than {@code readlimit} bytes are
+     * read from the stream before {@code reset} is called.
      *
      * <p> Marking a closed stream should not have any effect on the stream.
      *
-     * <p> The <code>mark</code> method of <code>InputStream</code> does
+     * <p> The {@code mark} method of {@code InputStream} does
      * nothing.
      *
      * @param   readlimit   the maximum limit of bytes that can be read before
@@ -681,42 +681,42 @@
 
     /**
      * Repositions this stream to the position at the time the
-     * <code>mark</code> method was last called on this input stream.
+     * {@code mark} method was last called on this input stream.
      *
-     * <p> The general contract of <code>reset</code> is:
+     * <p> The general contract of {@code reset} is:
      *
      * <ul>
-     * <li> If the method <code>markSupported</code> returns
-     * <code>true</code>, then:
+     * <li> If the method {@code markSupported} returns
+     * {@code true}, then:
      *
-     *     <ul><li> If the method <code>mark</code> has not been called since
+     *     <ul><li> If the method {@code mark} has not been called since
      *     the stream was created, or the number of bytes read from the stream
-     *     since <code>mark</code> was last called is larger than the argument
-     *     to <code>mark</code> at that last call, then an
-     *     <code>IOException</code> might be thrown.
+     *     since {@code mark} was last called is larger than the argument
+     *     to {@code mark} at that last call, then an
+     *     {@code IOException} might be thrown.
      *
-     *     <li> If such an <code>IOException</code> is not thrown, then the
+     *     <li> If such an {@code IOException} is not thrown, then the
      *     stream is reset to a state such that all the bytes read since the
-     *     most recent call to <code>mark</code> (or since the start of the
-     *     file, if <code>mark</code> has not been called) will be resupplied
-     *     to subsequent callers of the <code>read</code> method, followed by
+     *     most recent call to {@code mark} (or since the start of the
+     *     file, if {@code mark} has not been called) will be resupplied
+     *     to subsequent callers of the {@code read} method, followed by
      *     any bytes that otherwise would have been the next input data as of
-     *     the time of the call to <code>reset</code>. </ul>
+     *     the time of the call to {@code reset}. </ul>
      *
-     * <li> If the method <code>markSupported</code> returns
-     * <code>false</code>, then:
+     * <li> If the method {@code markSupported} returns
+     * {@code false}, then:
      *
-     *     <ul><li> The call to <code>reset</code> may throw an
-     *     <code>IOException</code>.
+     *     <ul><li> The call to {@code reset} may throw an
+     *     {@code IOException}.
      *
-     *     <li> If an <code>IOException</code> is not thrown, then the stream
+     *     <li> If an {@code IOException} is not thrown, then the stream
      *     is reset to a fixed state that depends on the particular type of the
      *     input stream and how it was created. The bytes that will be supplied
-     *     to subsequent callers of the <code>read</code> method depend on the
+     *     to subsequent callers of the {@code read} method depend on the
      *     particular type of the input stream. </ul></ul>
      *
-     * <p>The method <code>reset</code> for class <code>InputStream</code>
-     * does nothing except throw an <code>IOException</code>.
+     * <p>The method {@code reset} for class {@code InputStream}
+     * does nothing except throw an {@code IOException}.
      *
      * @throws  IOException  if this stream has not been marked or if the
      *          mark has been invalidated.
@@ -728,14 +728,14 @@
     }
 
     /**
-     * Tests if this input stream supports the <code>mark</code> and
-     * <code>reset</code> methods. Whether or not <code>mark</code> and
-     * <code>reset</code> are supported is an invariant property of a
-     * particular input stream instance. The <code>markSupported</code> method
-     * of <code>InputStream</code> returns <code>false</code>.
+     * Tests if this input stream supports the {@code mark} and
+     * {@code reset} methods. Whether or not {@code mark} and
+     * {@code reset} are supported is an invariant property of a
+     * particular input stream instance. The {@code markSupported} method
+     * of {@code InputStream} returns {@code false}.
      *
-     * @return  <code>true</code> if this stream instance supports the mark
-     *          and reset methods; <code>false</code> otherwise.
+     * @return  {@code true} if this stream instance supports the mark
+     *          and reset methods; {@code false} otherwise.
      * @see     java.io.InputStream#mark(int)
      * @see     java.io.InputStream#reset()
      */
--- a/src/java.base/share/classes/java/io/InputStreamReader.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/InputStreamReader.java	Wed Sep 25 22:40:41 2019 +0200
@@ -141,11 +141,11 @@
      * <p> If this instance was created with the {@link
      * #InputStreamReader(InputStream, String)} constructor then the returned
      * name, being unique for the encoding, may differ from the name passed to
-     * the constructor. This method will return <code>null</code> if the
+     * the constructor. This method will return {@code null} if the
      * stream has been closed.
      * </p>
      * @return The historical name of this encoding, or
-     *         <code>null</code> if the stream has been closed
+     *         {@code null} if the stream has been closed
      *
      * @see java.nio.charset.Charset
      *
--- a/src/java.base/share/classes/java/io/InterruptedIOException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/InterruptedIOException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -27,7 +27,7 @@
 
 /**
  * Signals that an I/O operation has been interrupted. An
- * <code>InterruptedIOException</code> is thrown to indicate that an
+ * {@code InterruptedIOException} is thrown to indicate that an
  * input or output transfer has been terminated because the thread
  * performing it was interrupted. The field {@link #bytesTransferred}
  * indicates how many bytes were successfully transferred before
@@ -45,19 +45,19 @@
     private static final long serialVersionUID = 4020568460727500567L;
 
     /**
-     * Constructs an <code>InterruptedIOException</code> with
-     * <code>null</code> as its error detail message.
+     * Constructs an {@code InterruptedIOException} with
+     * {@code null} as its error detail message.
      */
     public InterruptedIOException() {
         super();
     }
 
     /**
-     * Constructs an <code>InterruptedIOException</code> with the
-     * specified detail message. The string <code>s</code> can be
+     * Constructs an {@code InterruptedIOException} with the
+     * specified detail message. The string {@code s} can be
      * retrieved later by the
      * <code>{@link java.lang.Throwable#getMessage}</code>
-     * method of class <code>java.lang.Throwable</code>.
+     * method of class {@code java.lang.Throwable}.
      *
      * @param   s   the detail message.
      */
--- a/src/java.base/share/classes/java/io/InvalidObjectException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/InvalidObjectException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -41,7 +41,7 @@
     private static final long serialVersionUID = 3233174318281839583L;
 
     /**
-     * Constructs an <code>InvalidObjectException</code>.
+     * Constructs an {@code InvalidObjectException}.
      * @param reason Detailed message explaining the reason for the failure.
      *
      * @see ObjectInputValidation
--- a/src/java.base/share/classes/java/io/ObjectInputStream.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/ObjectInputStream.java	Wed Sep 25 22:40:41 2019 +0200
@@ -74,7 +74,7 @@
  * <p>Only objects that support the java.io.Serializable or
  * java.io.Externalizable interface can be read from streams.
  *
- * <p>The method <code>readObject</code> is used to read an object from the
+ * <p>The method {@code readObject} is used to read an object from the
  * stream.  Java's safe casting should be used to get the desired type.  In
  * Java, strings and arrays are objects and are treated as objects during
  * serialization. When read they need to be cast to the expected type.
@@ -157,7 +157,7 @@
  * throw OptionalDataExceptions with eof set to true, bytewise reads will
  * return -1, and primitive reads will throw EOFExceptions.  Note that this
  * behavior does not hold for streams written with the old
- * <code>ObjectStreamConstants.PROTOCOL_VERSION_1</code> protocol, in which the
+ * {@code ObjectStreamConstants.PROTOCOL_VERSION_1} protocol, in which the
  * end of data written by writeExternal methods is not demarcated, and hence
  * cannot be detected.
  *
@@ -208,7 +208,7 @@
  * solely of its name; field values of the constant are not transmitted.  To
  * deserialize an enum constant, ObjectInputStream reads the constant name from
  * the stream; the deserialized constant is then obtained by calling the static
- * method <code>Enum.valueOf(Class, String)</code> with the enum constant's
+ * method {@code Enum.valueOf(Class, String)} with the enum constant's
  * base type and the received constant name as arguments.  Like other
  * serializable or externalizable objects, enum constants can function as the
  * targets of back references appearing subsequently in the serialization
@@ -335,7 +335,7 @@
      * @throws  IOException if an I/O error occurs while reading stream header
      * @throws  SecurityException if untrusted subclass illegally overrides
      *          security-sensitive methods
-     * @throws  NullPointerException if <code>in</code> is <code>null</code>
+     * @throws  NullPointerException if {@code in} is {@code null}
      * @see     ObjectInputStream#ObjectInputStream()
      * @see     ObjectInputStream#readFields()
      * @see     ObjectOutputStream#ObjectOutputStream(OutputStream)
@@ -360,12 +360,12 @@
      * {@linkplain ObjectInputFilter.Config#getSerialFilter() the system-wide filter}.
      *
      * <p>If there is a security manager installed, this method first calls the
-     * security manager's <code>checkPermission</code> method with the
-     * <code>SerializablePermission("enableSubclassImplementation")</code>
+     * security manager's {@code checkPermission} method with the
+     * {@code SerializablePermission("enableSubclassImplementation")}
      * permission to ensure it's ok to enable subclassing.
      *
      * @throws  SecurityException if a security manager exists and its
-     *          <code>checkPermission</code> method denies enabling
+     *          {@code checkPermission} method denies enabling
      *          subclassing.
      * @throws  IOException if an I/O error occurs while creating this stream
      * @see SecurityManager#checkPermission
@@ -587,7 +587,7 @@
      * Reads the persistent fields from the stream and makes them available by
      * name.
      *
-     * @return  the <code>GetField</code> object representing the persistent
+     * @return  the {@code GetField} object representing the persistent
      *          fields of the object being deserialized
      * @throws  ClassNotFoundException if the class of a serialized object
      *          could not be found.
@@ -651,36 +651,36 @@
      * description.  Subclasses may implement this method to allow classes to
      * be fetched from an alternate source.
      *
-     * <p>The corresponding method in <code>ObjectOutputStream</code> is
-     * <code>annotateClass</code>.  This method will be invoked only once for
+     * <p>The corresponding method in {@code ObjectOutputStream} is
+     * {@code annotateClass}.  This method will be invoked only once for
      * each unique class in the stream.  This method can be implemented by
      * subclasses to use an alternate loading mechanism but must return a
-     * <code>Class</code> object. Once returned, if the class is not an array
+     * {@code Class} object. Once returned, if the class is not an array
      * class, its serialVersionUID is compared to the serialVersionUID of the
      * serialized class, and if there is a mismatch, the deserialization fails
      * and an {@link InvalidClassException} is thrown.
      *
      * <p>The default implementation of this method in
-     * <code>ObjectInputStream</code> returns the result of calling
+     * {@code ObjectInputStream} returns the result of calling
      * <pre>
      *     Class.forName(desc.getName(), false, loader)
      * </pre>
-     * where <code>loader</code> is the first class loader on the current
+     * where {@code loader} is the first class loader on the current
      * thread's stack (starting from the currently executing method) that is
      * neither the {@linkplain ClassLoader#getPlatformClassLoader() platform
-     * class loader} nor its ancestor; otherwise, <code>loader</code> is the
+     * class loader} nor its ancestor; otherwise, {@code loader} is the
      * <em>platform class loader</em>. If this call results in a
-     * <code>ClassNotFoundException</code> and the name of the passed
-     * <code>ObjectStreamClass</code> instance is the Java language keyword
-     * for a primitive type or void, then the <code>Class</code> object
+     * {@code ClassNotFoundException} and the name of the passed
+     * {@code ObjectStreamClass} instance is the Java language keyword
+     * for a primitive type or void, then the {@code Class} object
      * representing that primitive type or void will be returned
-     * (e.g., an <code>ObjectStreamClass</code> with the name
-     * <code>"int"</code> will be resolved to <code>Integer.TYPE</code>).
-     * Otherwise, the <code>ClassNotFoundException</code> will be thrown to
+     * (e.g., an {@code ObjectStreamClass} with the name
+     * {@code "int"} will be resolved to {@code Integer.TYPE}).
+     * Otherwise, the {@code ClassNotFoundException} will be thrown to
      * the caller of this method.
      *
-     * @param   desc an instance of class <code>ObjectStreamClass</code>
-     * @return  a <code>Class</code> object corresponding to <code>desc</code>
+     * @param   desc an instance of class {@code ObjectStreamClass}
+     * @return  a {@code Class} object corresponding to {@code desc}
      * @throws  IOException any of the usual Input/Output exceptions.
      * @throws  ClassNotFoundException if class of a serialized object cannot
      *          be found.
@@ -711,43 +711,43 @@
      * <p>This method is called exactly once for each unique proxy class
      * descriptor in the stream.
      *
-     * <p>The corresponding method in <code>ObjectOutputStream</code> is
-     * <code>annotateProxyClass</code>.  For a given subclass of
-     * <code>ObjectInputStream</code> that overrides this method, the
-     * <code>annotateProxyClass</code> method in the corresponding subclass of
-     * <code>ObjectOutputStream</code> must write any data or objects read by
+     * <p>The corresponding method in {@code ObjectOutputStream} is
+     * {@code annotateProxyClass}.  For a given subclass of
+     * {@code ObjectInputStream} that overrides this method, the
+     * {@code annotateProxyClass} method in the corresponding subclass of
+     * {@code ObjectOutputStream} must write any data or objects read by
      * this method.
      *
      * <p>The default implementation of this method in
-     * <code>ObjectInputStream</code> returns the result of calling
-     * <code>Proxy.getProxyClass</code> with the list of <code>Class</code>
-     * objects for the interfaces that are named in the <code>interfaces</code>
-     * parameter.  The <code>Class</code> object for each interface name
-     * <code>i</code> is the value returned by calling
+     * {@code ObjectInputStream} returns the result of calling
+     * {@code Proxy.getProxyClass} with the list of {@code Class}
+     * objects for the interfaces that are named in the {@code interfaces}
+     * parameter.  The {@code Class} object for each interface name
+     * {@code i} is the value returned by calling
      * <pre>
      *     Class.forName(i, false, loader)
      * </pre>
-     * where <code>loader</code> is the first class loader on the current
+     * where {@code loader} is the first class loader on the current
      * thread's stack (starting from the currently executing method) that is
      * neither the {@linkplain ClassLoader#getPlatformClassLoader() platform
-     * class loader} nor its ancestor; otherwise, <code>loader</code> is the
+     * class loader} nor its ancestor; otherwise, {@code loader} is the
      * <em>platform class loader</em>.
      * Unless any of the resolved interfaces are non-public, this same value
-     * of <code>loader</code> is also the class loader passed to
-     * <code>Proxy.getProxyClass</code>; if non-public interfaces are present,
+     * of {@code loader} is also the class loader passed to
+     * {@code Proxy.getProxyClass}; if non-public interfaces are present,
      * their class loader is passed instead (if more than one non-public
      * interface class loader is encountered, an
-     * <code>IllegalAccessError</code> is thrown).
-     * If <code>Proxy.getProxyClass</code> throws an
-     * <code>IllegalArgumentException</code>, <code>resolveProxyClass</code>
-     * will throw a <code>ClassNotFoundException</code> containing the
-     * <code>IllegalArgumentException</code>.
+     * {@code IllegalAccessError} is thrown).
+     * If {@code Proxy.getProxyClass} throws an
+     * {@code IllegalArgumentException}, {@code resolveProxyClass}
+     * will throw a {@code ClassNotFoundException} containing the
+     * {@code IllegalArgumentException}.
      *
      * @param interfaces the list of interface names that were
      *                deserialized in the proxy class descriptor
      * @return  a proxy class for the specified interfaces
      * @throws        IOException any exception thrown by the underlying
-     *                <code>InputStream</code>
+     *                {@code InputStream}
      * @throws        ClassNotFoundException if the proxy class or any of the
      *                named interfaces could not be found
      * @see ObjectOutputStream#annotateProxyClass(Class)
@@ -863,7 +863,7 @@
      * and version number.
      *
      * @throws  IOException if there are I/O errors while reading from the
-     *          underlying <code>InputStream</code>
+     *          underlying {@code InputStream}
      * @throws  StreamCorruptedException if control information in the stream
      *          is inconsistent
      */
@@ -884,7 +884,7 @@
      * item in the serialization stream.  Subclasses of ObjectInputStream may
      * override this method to read in class descriptors that have been written
      * in non-standard formats (by subclasses of ObjectOutputStream which have
-     * overridden the <code>writeClassDescriptor</code> method).  By default,
+     * overridden the {@code writeClassDescriptor} method).  By default,
      * this method reads class descriptors according to the format defined in
      * the Object Serialization specification.
      *
@@ -946,7 +946,7 @@
      *
      * @return  the number of available bytes.
      * @throws  IOException if there are I/O errors while reading from the
-     *          underlying <code>InputStream</code>
+     *          underlying {@code InputStream}
      */
     public int available() throws IOException {
         return bin.available();
@@ -1129,7 +1129,7 @@
      *
      * @return  a String copy of the line.
      * @throws  IOException if there are I/O errors while reading from the
-     *          underlying <code>InputStream</code>
+     *          underlying {@code InputStream}
      * @deprecated This method does not properly convert bytes to characters.
      *          see DataInputStream for the details and alternatives.
      */
@@ -1145,7 +1145,7 @@
      *
      * @return  the String.
      * @throws  IOException if there are I/O errors while reading from the
-     *          underlying <code>InputStream</code>
+     *          underlying {@code InputStream}
      * @throws  UTFDataFormatException if read bytes do not represent a valid
      *          modified UTF-8 encoding of a string
      */
@@ -1340,8 +1340,8 @@
          * @param  name the name of the field
          * @return true, if and only if the named field is defaulted
          * @throws IOException if there are I/O errors while reading from
-         *         the underlying <code>InputStream</code>
-         * @throws IllegalArgumentException if <code>name</code> does not
+         *         the underlying {@code InputStream}
+         * @throws IllegalArgumentException if {@code name} does not
          *         correspond to a serializable field
          */
         public abstract boolean defaulted(String name) throws IOException;
@@ -1350,12 +1350,12 @@
          * Get the value of the named boolean field from the persistent field.
          *
          * @param  name the name of the field
-         * @param  val the default value to use if <code>name</code> does not
+         * @param  val the default value to use if {@code name} does not
          *         have a value
-         * @return the value of the named <code>boolean</code> field
+         * @return the value of the named {@code boolean} field
          * @throws IOException if there are I/O errors while reading from the
-         *         underlying <code>InputStream</code>
-         * @throws IllegalArgumentException if type of <code>name</code> is
+         *         underlying {@code InputStream}
+         * @throws IllegalArgumentException if type of {@code name} is
          *         not serializable or if the field type is incorrect
          */
         public abstract boolean get(String name, boolean val)
@@ -1365,12 +1365,12 @@
          * Get the value of the named byte field from the persistent field.
          *
          * @param  name the name of the field
-         * @param  val the default value to use if <code>name</code> does not
+         * @param  val the default value to use if {@code name} does not
          *         have a value
-         * @return the value of the named <code>byte</code> field
+         * @return the value of the named {@code byte} field
          * @throws IOException if there are I/O errors while reading from the
-         *         underlying <code>InputStream</code>
-         * @throws IllegalArgumentException if type of <code>name</code> is
+         *         underlying {@code InputStream}
+         * @throws IllegalArgumentException if type of {@code name} is
          *         not serializable or if the field type is incorrect
          */
         public abstract byte get(String name, byte val) throws IOException;
@@ -1379,12 +1379,12 @@
          * Get the value of the named char field from the persistent field.
          *
          * @param  name the name of the field
-         * @param  val the default value to use if <code>name</code> does not
+         * @param  val the default value to use if {@code name} does not
          *         have a value
-         * @return the value of the named <code>char</code> field
+         * @return the value of the named {@code char} field
          * @throws IOException if there are I/O errors while reading from the
-         *         underlying <code>InputStream</code>
-         * @throws IllegalArgumentException if type of <code>name</code> is
+         *         underlying {@code InputStream}
+         * @throws IllegalArgumentException if type of {@code name} is
          *         not serializable or if the field type is incorrect
          */
         public abstract char get(String name, char val) throws IOException;
@@ -1393,12 +1393,12 @@
          * Get the value of the named short field from the persistent field.
          *
          * @param  name the name of the field
-         * @param  val the default value to use if <code>name</code> does not
+         * @param  val the default value to use if {@code name} does not
          *         have a value
-         * @return the value of the named <code>short</code> field
+         * @return the value of the named {@code short} field
          * @throws IOException if there are I/O errors while reading from the
-         *         underlying <code>InputStream</code>
-         * @throws IllegalArgumentException if type of <code>name</code> is
+         *         underlying {@code InputStream}
+         * @throws IllegalArgumentException if type of {@code name} is
          *         not serializable or if the field type is incorrect
          */
         public abstract short get(String name, short val) throws IOException;
@@ -1407,12 +1407,12 @@
          * Get the value of the named int field from the persistent field.
          *
          * @param  name the name of the field
-         * @param  val the default value to use if <code>name</code> does not
+         * @param  val the default value to use if {@code name} does not
          *         have a value
-         * @return the value of the named <code>int</code> field
+         * @return the value of the named {@code int} field
          * @throws IOException if there are I/O errors while reading from the
-         *         underlying <code>InputStream</code>
-         * @throws IllegalArgumentException if type of <code>name</code> is
+         *         underlying {@code InputStream}
+         * @throws IllegalArgumentException if type of {@code name} is
          *         not serializable or if the field type is incorrect
          */
         public abstract int get(String name, int val) throws IOException;
@@ -1421,12 +1421,12 @@
          * Get the value of the named long field from the persistent field.
          *
          * @param  name the name of the field
-         * @param  val the default value to use if <code>name</code> does not
+         * @param  val the default value to use if {@code name} does not
          *         have a value
-         * @return the value of the named <code>long</code> field
+         * @return the value of the named {@code long} field
          * @throws IOException if there are I/O errors while reading from the
-         *         underlying <code>InputStream</code>
-         * @throws IllegalArgumentException if type of <code>name</code> is
+         *         underlying {@code InputStream}
+         * @throws IllegalArgumentException if type of {@code name} is
          *         not serializable or if the field type is incorrect
          */
         public abstract long get(String name, long val) throws IOException;
@@ -1435,12 +1435,12 @@
          * Get the value of the named float field from the persistent field.
          *
          * @param  name the name of the field
-         * @param  val the default value to use if <code>name</code> does not
+         * @param  val the default value to use if {@code name} does not
          *         have a value
-         * @return the value of the named <code>float</code> field
+         * @return the value of the named {@code float} field
          * @throws IOException if there are I/O errors while reading from the
-         *         underlying <code>InputStream</code>
-         * @throws IllegalArgumentException if type of <code>name</code> is
+         *         underlying {@code InputStream}
+         * @throws IllegalArgumentException if type of {@code name} is
          *         not serializable or if the field type is incorrect
          */
         public abstract float get(String name, float val) throws IOException;
@@ -1449,12 +1449,12 @@
          * Get the value of the named double field from the persistent field.
          *
          * @param  name the name of the field
-         * @param  val the default value to use if <code>name</code> does not
+         * @param  val the default value to use if {@code name} does not
          *         have a value
-         * @return the value of the named <code>double</code> field
+         * @return the value of the named {@code double} field
          * @throws IOException if there are I/O errors while reading from the
-         *         underlying <code>InputStream</code>
-         * @throws IllegalArgumentException if type of <code>name</code> is
+         *         underlying {@code InputStream}
+         * @throws IllegalArgumentException if type of {@code name} is
          *         not serializable or if the field type is incorrect
          */
         public abstract double get(String name, double val) throws IOException;
@@ -1463,12 +1463,12 @@
          * Get the value of the named Object field from the persistent field.
          *
          * @param  name the name of the field
-         * @param  val the default value to use if <code>name</code> does not
+         * @param  val the default value to use if {@code name} does not
          *         have a value
-         * @return the value of the named <code>Object</code> field
+         * @return the value of the named {@code Object} field
          * @throws IOException if there are I/O errors while reading from the
-         *         underlying <code>InputStream</code>
-         * @throws IllegalArgumentException if type of <code>name</code> is
+         *         underlying {@code InputStream}
+         * @throws IllegalArgumentException if type of {@code name} is
          *         not serializable or if the field type is incorrect
          */
         public abstract Object get(String name, Object val) throws IOException;
--- a/src/java.base/share/classes/java/io/ObjectOutputStream.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/ObjectOutputStream.java	Wed Sep 25 22:40:41 2019 +0200
@@ -232,7 +232,7 @@
      * @throws  IOException if an I/O error occurs while writing stream header
      * @throws  SecurityException if untrusted subclass illegally overrides
      *          security-sensitive methods
-     * @throws  NullPointerException if <code>out</code> is <code>null</code>
+     * @throws  NullPointerException if {@code out} is {@code null}
      * @since   1.4
      * @see     ObjectOutputStream#ObjectOutputStream()
      * @see     ObjectOutputStream#putFields()
@@ -259,12 +259,12 @@
      * this implementation of ObjectOutputStream.
      *
      * <p>If there is a security manager installed, this method first calls the
-     * security manager's <code>checkPermission</code> method with a
-     * <code>SerializablePermission("enableSubclassImplementation")</code>
+     * security manager's {@code checkPermission} method with a
+     * {@code SerializablePermission("enableSubclassImplementation")}
      * permission to ensure it's ok to enable subclassing.
      *
      * @throws  SecurityException if a security manager exists and its
-     *          <code>checkPermission</code> method denies enabling
+     *          {@code checkPermission} method denies enabling
      *          subclassing.
      * @throws  IOException if an I/O error occurs while creating this stream
      * @see SecurityManager#checkPermission
@@ -429,7 +429,7 @@
      * called otherwise.
      *
      * @throws  IOException if I/O errors occur while writing to the underlying
-     *          <code>OutputStream</code>
+     *          {@code OutputStream}
      */
     public void defaultWriteObject() throws IOException {
         SerialCallbackContext ctx = curContext;
@@ -529,18 +529,18 @@
      *
      * <p>This method is called exactly once for each unique proxy class
      * descriptor in the stream.  The default implementation of this method in
-     * <code>ObjectOutputStream</code> does nothing.
+     * {@code ObjectOutputStream} does nothing.
      *
-     * <p>The corresponding method in <code>ObjectInputStream</code> is
-     * <code>resolveProxyClass</code>.  For a given subclass of
-     * <code>ObjectOutputStream</code> that overrides this method, the
-     * <code>resolveProxyClass</code> method in the corresponding subclass of
-     * <code>ObjectInputStream</code> must read any data or objects written by
-     * <code>annotateProxyClass</code>.
+     * <p>The corresponding method in {@code ObjectInputStream} is
+     * {@code resolveProxyClass}.  For a given subclass of
+     * {@code ObjectOutputStream} that overrides this method, the
+     * {@code resolveProxyClass} method in the corresponding subclass of
+     * {@code ObjectInputStream} must read any data or objects written by
+     * {@code annotateProxyClass}.
      *
      * @param   cl the proxy class to annotate custom data for
      * @throws  IOException any exception thrown by the underlying
-     *          <code>OutputStream</code>
+     *          {@code OutputStream}
      * @see ObjectInputStream#resolveProxyClass(String[])
      * @since   1.3
      */
@@ -646,16 +646,16 @@
      * stream.  Subclasses of ObjectOutputStream may override this method to
      * customize the way in which class descriptors are written to the
      * serialization stream.  The corresponding method in ObjectInputStream,
-     * <code>readClassDescriptor</code>, should then be overridden to
+     * {@code readClassDescriptor}, should then be overridden to
      * reconstitute the class descriptor from its custom stream representation.
      * By default, this method writes class descriptors according to the format
      * defined in the Object Serialization specification.
      *
      * <p>Note that this method will only be called if the ObjectOutputStream
      * is not using the old serialization stream format (set by calling
-     * ObjectOutputStream's <code>useProtocolVersion</code> method).  If this
+     * ObjectOutputStream's {@code useProtocolVersion} method).  If this
      * serialization stream is using the old format
-     * (<code>PROTOCOL_VERSION_1</code>), the class descriptor will be written
+     * ({@code PROTOCOL_VERSION_1}), the class descriptor will be written
      * internally in a manner that cannot be overridden or customized.
      *
      * @param   desc class descriptor to write to the stream
@@ -889,10 +889,10 @@
          *
          * @param  name the name of the serializable field
          * @param  val the value to assign to the field
-         * @throws IllegalArgumentException if <code>name</code> does not
+         * @throws IllegalArgumentException if {@code name} does not
          * match the name of a serializable field for the class whose fields
          * are being written, or if the type of the named field is not
-         * <code>boolean</code>
+         * {@code boolean}
          */
         public abstract void put(String name, boolean val);
 
@@ -901,10 +901,10 @@
          *
          * @param  name the name of the serializable field
          * @param  val the value to assign to the field
-         * @throws IllegalArgumentException if <code>name</code> does not
+         * @throws IllegalArgumentException if {@code name} does not
          * match the name of a serializable field for the class whose fields
          * are being written, or if the type of the named field is not
-         * <code>byte</code>
+         * {@code byte}
          */
         public abstract void put(String name, byte val);
 
@@ -913,10 +913,10 @@
          *
          * @param  name the name of the serializable field
          * @param  val the value to assign to the field
-         * @throws IllegalArgumentException if <code>name</code> does not
+         * @throws IllegalArgumentException if {@code name} does not
          * match the name of a serializable field for the class whose fields
          * are being written, or if the type of the named field is not
-         * <code>char</code>
+         * {@code char}
          */
         public abstract void put(String name, char val);
 
@@ -925,10 +925,10 @@
          *
          * @param  name the name of the serializable field
          * @param  val the value to assign to the field
-         * @throws IllegalArgumentException if <code>name</code> does not
+         * @throws IllegalArgumentException if {@code name} does not
          * match the name of a serializable field for the class whose fields
          * are being written, or if the type of the named field is not
-         * <code>short</code>
+         * {@code short}
          */
         public abstract void put(String name, short val);
 
@@ -937,10 +937,10 @@
          *
          * @param  name the name of the serializable field
          * @param  val the value to assign to the field
-         * @throws IllegalArgumentException if <code>name</code> does not
+         * @throws IllegalArgumentException if {@code name} does not
          * match the name of a serializable field for the class whose fields
          * are being written, or if the type of the named field is not
-         * <code>int</code>
+         * {@code int}
          */
         public abstract void put(String name, int val);
 
@@ -949,10 +949,10 @@
          *
          * @param  name the name of the serializable field
          * @param  val the value to assign to the field
-         * @throws IllegalArgumentException if <code>name</code> does not
+         * @throws IllegalArgumentException if {@code name} does not
          * match the name of a serializable field for the class whose fields
          * are being written, or if the type of the named field is not
-         * <code>long</code>
+         * {@code long}
          */
         public abstract void put(String name, long val);
 
@@ -961,10 +961,10 @@
          *
          * @param  name the name of the serializable field
          * @param  val the value to assign to the field
-         * @throws IllegalArgumentException if <code>name</code> does not
+         * @throws IllegalArgumentException if {@code name} does not
          * match the name of a serializable field for the class whose fields
          * are being written, or if the type of the named field is not
-         * <code>float</code>
+         * {@code float}
          */
         public abstract void put(String name, float val);
 
@@ -973,10 +973,10 @@
          *
          * @param  name the name of the serializable field
          * @param  val the value to assign to the field
-         * @throws IllegalArgumentException if <code>name</code> does not
+         * @throws IllegalArgumentException if {@code name} does not
          * match the name of a serializable field for the class whose fields
          * are being written, or if the type of the named field is not
-         * <code>double</code>
+         * {@code double}
          */
         public abstract void put(String name, double val);
 
@@ -985,8 +985,8 @@
          *
          * @param  name the name of the serializable field
          * @param  val the value to assign to the field
-         *         (which may be <code>null</code>)
-         * @throws IllegalArgumentException if <code>name</code> does not
+         *         (which may be {@code null})
+         * @throws IllegalArgumentException if {@code name} does not
          * match the name of a serializable field for the class whose fields
          * are being written, or if the type of the named field is not a
          * reference type
@@ -996,18 +996,18 @@
         /**
          * Write the data and fields to the specified ObjectOutput stream,
          * which must be the same stream that produced this
-         * <code>PutField</code> object.
+         * {@code PutField} object.
          *
          * @param  out the stream to write the data and fields to
          * @throws IOException if I/O errors occur while writing to the
          *         underlying stream
          * @throws IllegalArgumentException if the specified stream is not
-         *         the same stream that produced this <code>PutField</code>
+         *         the same stream that produced this {@code PutField}
          *         object
          * @deprecated This method does not write the values contained by this
-         *         <code>PutField</code> object in a proper format, and may
+         *         {@code PutField} object in a proper format, and may
          *         result in corruption of the serialization stream.  The
-         *         correct way to write <code>PutField</code> data is by
+         *         correct way to write {@code PutField} data is by
          *         calling the {@link java.io.ObjectOutputStream#writeFields()}
          *         method.
          */
--- a/src/java.base/share/classes/java/io/ObjectStreamClass.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/ObjectStreamClass.java	Wed Sep 25 22:40:41 2019 +0200
@@ -276,7 +276,7 @@
      * Return the class in the local VM that this version is mapped to.  Null
      * is returned if there is no corresponding local class.
      *
-     * @return  the <code>Class</code> instance that this descriptor represents
+     * @return  the {@code Class} instance that this descriptor represents
      */
     @CallerSensitive
     public Class<?> forClass() {
--- a/src/java.base/share/classes/java/io/ObjectStreamField.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/ObjectStreamField.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2015, 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
@@ -60,10 +60,10 @@
 
     /**
      * Create a Serializable field with the specified type.  This field should
-     * be documented with a <code>serialField</code> tag.
+     * be documented with a {@code serialField} tag.
      *
      * @param   name the name of the serializable field
-     * @param   type the <code>Class</code> object of the serializable field
+     * @param   type the {@code Class} object of the serializable field
      */
     public ObjectStreamField(String name, Class<?> type) {
         this(name, type, false);
@@ -197,7 +197,7 @@
     /**
      * Get the name of this field.
      *
-     * @return  a <code>String</code> representing the name of the serializable
+     * @return  a {@code String} representing the name of the serializable
      *          field
      */
     public String getName() {
@@ -206,12 +206,12 @@
 
     /**
      * Get the type of the field.  If the type is non-primitive and this
-     * <code>ObjectStreamField</code> was obtained from a deserialized {@link
-     * ObjectStreamClass} instance, then <code>Object.class</code> is returned.
-     * Otherwise, the <code>Class</code> object for the type of the field is
+     * {@code ObjectStreamField} was obtained from a deserialized {@link
+     * ObjectStreamClass} instance, then {@code Object.class} is returned.
+     * Otherwise, the {@code Class} object for the type of the field is
      * returned.
      *
-     * @return  a <code>Class</code> object representing the type of the
+     * @return  a {@code Class} object representing the type of the
      *          serializable field
      */
     @CallerSensitive
@@ -303,7 +303,7 @@
     }
 
     /**
-     * Compare this field with another <code>ObjectStreamField</code>.  Return
+     * Compare this field with another {@code ObjectStreamField}.  Return
      * -1 if this is smaller, 0 if equal, 1 if greater.  Types that are
      * primitives are "smaller" than object types.  If equal, the field names
      * are compared.
--- a/src/java.base/share/classes/java/io/OptionalDataException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/OptionalDataException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -51,7 +51,7 @@
     private static final long serialVersionUID = -8011121865681257820L;
 
     /*
-     * Create an <code>OptionalDataException</code> with a length.
+     * Create an {@code OptionalDataException} with a length.
      */
     OptionalDataException(int len) {
         eof = false;
@@ -59,7 +59,7 @@
     }
 
     /*
-     * Create an <code>OptionalDataException</code> signifying no
+     * Create an {@code OptionalDataException} signifying no
      * more primitive data is available.
      */
     OptionalDataException(boolean end) {
--- a/src/java.base/share/classes/java/io/OutputStream.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/OutputStream.java	Wed Sep 25 22:40:41 2019 +0200
@@ -33,7 +33,7 @@
  * and sends them to some sink.
  * <p>
  * Applications that need to define a subclass of
- * <code>OutputStream</code> must always provide at least a method
+ * {@code OutputStream} must always provide at least a method
  * that writes one byte of output.
  *
  * @author  Arthur van Hoff
@@ -98,26 +98,26 @@
 
     /**
      * Writes the specified byte to this output stream. The general
-     * contract for <code>write</code> is that one byte is written
+     * contract for {@code write} is that one byte is written
      * to the output stream. The byte to be written is the eight
-     * low-order bits of the argument <code>b</code>. The 24
-     * high-order bits of <code>b</code> are ignored.
+     * low-order bits of the argument {@code b}. The 24
+     * high-order bits of {@code b} are ignored.
      * <p>
-     * Subclasses of <code>OutputStream</code> must provide an
+     * Subclasses of {@code OutputStream} must provide an
      * implementation for this method.
      *
-     * @param      b   the <code>byte</code>.
+     * @param      b   the {@code byte}.
      * @throws     IOException  if an I/O error occurs. In particular,
-     *             an <code>IOException</code> may be thrown if the
+     *             an {@code IOException} may be thrown if the
      *             output stream has been closed.
      */
     public abstract void write(int b) throws IOException;
 
     /**
-     * Writes <code>b.length</code> bytes from the specified byte array
-     * to this output stream. The general contract for <code>write(b)</code>
+     * Writes {@code b.length} bytes from the specified byte array
+     * to this output stream. The general contract for {@code write(b)}
      * is that it should have exactly the same effect as the call
-     * <code>write(b, 0, b.length)</code>.
+     * {@code write(b, 0, b.length)}.
      *
      * @param      b   the data.
      * @throws     IOException  if an I/O error occurs.
@@ -128,31 +128,31 @@
     }
 
     /**
-     * Writes <code>len</code> bytes from the specified byte array
-     * starting at offset <code>off</code> to this output stream.
-     * The general contract for <code>write(b, off, len)</code> is that
-     * some of the bytes in the array <code>b</code> are written to the
-     * output stream in order; element <code>b[off]</code> is the first
-     * byte written and <code>b[off+len-1]</code> is the last byte written
+     * Writes {@code len} bytes from the specified byte array
+     * starting at offset {@code off} to this output stream.
+     * The general contract for {@code write(b, off, len)} is that
+     * some of the bytes in the array {@code b} are written to the
+     * output stream in order; element {@code b[off]} is the first
+     * byte written and {@code b[off+len-1]} is the last byte written
      * by this operation.
      * <p>
-     * The <code>write</code> method of <code>OutputStream</code> calls
+     * The {@code write} method of {@code OutputStream} calls
      * the write method of one argument on each of the bytes to be
      * written out. Subclasses are encouraged to override this method and
      * provide a more efficient implementation.
      * <p>
-     * If <code>b</code> is <code>null</code>, a
-     * <code>NullPointerException</code> is thrown.
+     * If {@code b} is {@code null}, a
+     * {@code NullPointerException} is thrown.
      * <p>
-     * If <code>off</code> is negative, or <code>len</code> is negative, or
-     * <code>off+len</code> is greater than the length of the array
+     * If {@code off} is negative, or {@code len} is negative, or
+     * {@code off+len} is greater than the length of the array
      * {@code b}, then an {@code IndexOutOfBoundsException} is thrown.
      *
      * @param      b     the data.
      * @param      off   the start offset in the data.
      * @param      len   the number of bytes to write.
      * @throws     IOException  if an I/O error occurs. In particular,
-     *             an <code>IOException</code> is thrown if the output
+     *             an {@code IOException} is thrown if the output
      *             stream is closed.
      */
     public void write(byte b[], int off, int len) throws IOException {
@@ -165,7 +165,7 @@
 
     /**
      * Flushes this output stream and forces any buffered output bytes
-     * to be written out. The general contract of <code>flush</code> is
+     * to be written out. The general contract of {@code flush} is
      * that calling it is an indication that, if any bytes previously
      * written have been buffered by the implementation of the output
      * stream, such bytes should immediately be written to their
@@ -177,7 +177,7 @@
      * passed to the operating system for writing; it does not guarantee that
      * they are actually written to a physical device such as a disk drive.
      * <p>
-     * The <code>flush</code> method of <code>OutputStream</code> does nothing.
+     * The {@code flush} method of {@code OutputStream} does nothing.
      *
      * @throws     IOException  if an I/O error occurs.
      */
@@ -186,11 +186,11 @@
 
     /**
      * Closes this output stream and releases any system resources
-     * associated with this stream. The general contract of <code>close</code>
+     * associated with this stream. The general contract of {@code close}
      * is that it closes the output stream. A closed stream cannot perform
      * output operations and cannot be reopened.
      * <p>
-     * The <code>close</code> method of <code>OutputStream</code> does nothing.
+     * The {@code close} method of {@code OutputStream} does nothing.
      *
      * @throws     IOException  if an I/O error occurs.
      */
--- a/src/java.base/share/classes/java/io/OutputStreamWriter.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/OutputStreamWriter.java	Wed Sep 25 22:40:41 2019 +0200
@@ -164,7 +164,7 @@
      * been closed. </p>
      *
      * @return The historical name of this encoding, or possibly
-     *         <code>null</code> if the stream has been closed
+     *         {@code null} if the stream has been closed
      *
      * @see java.nio.charset.Charset
      *
--- a/src/java.base/share/classes/java/io/PipedInputStream.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/PipedInputStream.java	Wed Sep 25 22:40:41 2019 +0200
@@ -30,9 +30,9 @@
  * to a piped output stream; the piped  input
  * stream then provides whatever data bytes
  * are written to the piped output  stream.
- * Typically, data is read from a <code>PipedInputStream</code>
+ * Typically, data is read from a {@code PipedInputStream}
  * object by one thread  and data is written
- * to the corresponding <code>PipedOutputStream</code>
+ * to the corresponding {@code PipedOutputStream}
  * by some  other thread. Attempting to use
  * both objects from a single thread is not
  * recommended, as it may deadlock the thread.
@@ -80,7 +80,7 @@
      * The index of the position in the circular buffer at which the
      * next byte of data will be stored when received from the connected
      * piped output stream. <code>in&lt;0</code> implies the buffer is empty,
-     * <code>in==out</code> implies the buffer is full
+     * {@code in==out} implies the buffer is full
      * @since   1.1
      */
     protected int in = -1;
@@ -93,10 +93,10 @@
     protected int out = 0;
 
     /**
-     * Creates a <code>PipedInputStream</code> so
+     * Creates a {@code PipedInputStream} so
      * that it is connected to the piped output
-     * stream <code>src</code>. Data bytes written
-     * to <code>src</code> will then be  available
+     * stream {@code src}. Data bytes written
+     * to {@code src} will then be  available
      * as input from this stream.
      *
      * @param      src   the stream to connect to.
@@ -107,11 +107,11 @@
     }
 
     /**
-     * Creates a <code>PipedInputStream</code> so that it is
+     * Creates a {@code PipedInputStream} so that it is
      * connected to the piped output stream
-     * <code>src</code> and uses the specified pipe size for
+     * {@code src} and uses the specified pipe size for
      * the pipe's buffer.
-     * Data bytes written to <code>src</code> will then
+     * Data bytes written to {@code src} will then
      * be available as input from this stream.
      *
      * @param      src   the stream to connect to.
@@ -127,24 +127,24 @@
     }
 
     /**
-     * Creates a <code>PipedInputStream</code> so
+     * Creates a {@code PipedInputStream} so
      * that it is not yet {@linkplain #connect(java.io.PipedOutputStream)
      * connected}.
      * It must be {@linkplain java.io.PipedOutputStream#connect(
      * java.io.PipedInputStream) connected} to a
-     * <code>PipedOutputStream</code> before being used.
+     * {@code PipedOutputStream} before being used.
      */
     public PipedInputStream() {
         initPipe(DEFAULT_PIPE_SIZE);
     }
 
     /**
-     * Creates a <code>PipedInputStream</code> so that it is not yet
+     * Creates a {@code PipedInputStream} so that it is not yet
      * {@linkplain #connect(java.io.PipedOutputStream) connected} and
      * uses the specified pipe size for the pipe's buffer.
      * It must be {@linkplain java.io.PipedOutputStream#connect(
      * java.io.PipedInputStream)
-     * connected} to a <code>PipedOutputStream</code> before being used.
+     * connected} to a {@code PipedOutputStream} before being used.
      *
      * @param      pipeSize the size of the pipe's buffer.
      * @throws     IllegalArgumentException if {@code pipeSize <= 0}.
@@ -163,21 +163,21 @@
 
     /**
      * Causes this piped input stream to be connected
-     * to the piped  output stream <code>src</code>.
+     * to the piped  output stream {@code src}.
      * If this object is already connected to some
-     * other piped output  stream, an <code>IOException</code>
+     * other piped output  stream, an {@code IOException}
      * is thrown.
      * <p>
-     * If <code>src</code> is an
-     * unconnected piped output stream and <code>snk</code>
+     * If {@code src} is an
+     * unconnected piped output stream and {@code snk}
      * is an unconnected piped input stream, they
      * may be connected by either the call:
      *
-     * <pre><code>snk.connect(src)</code> </pre>
+     * <pre>{@code snk.connect(src)} </pre>
      * <p>
      * or the call:
      *
-     * <pre><code>src.connect(snk)</code> </pre>
+     * <pre>{@code src.connect(snk)} </pre>
      * <p>
      * The two calls have the same effect.
      *
@@ -192,7 +192,7 @@
      * Receives a byte of data.  This method will block if no input is
      * available.
      * @param   b the byte being received
-     * @throws  IOException If the pipe is <a href="#BROKEN"> <code>broken</code></a>,
+     * @throws  IOException If the pipe is <a href="#BROKEN"> {@code broken}</a>,
      *          {@link #connect(java.io.PipedOutputStream) unconnected},
      *          closed, or if an I/O error occurs.
      * @since   1.1
@@ -288,16 +288,16 @@
 
     /**
      * Reads the next byte of data from this piped input stream. The
-     * value byte is returned as an <code>int</code> in the range
-     * <code>0</code> to <code>255</code>.
+     * value byte is returned as an {@code int} in the range
+     * {@code 0} to {@code 255}.
      * This method blocks until input data is available, the end of the
      * stream is detected, or an exception is thrown.
      *
-     * @return   the next byte of data, or <code>-1</code> if the end of the
+     * @return   the next byte of data, or {@code -1} if the end of the
      *           stream is reached.
      * @throws   IOException  if the pipe is
      *           {@link #connect(java.io.PipedOutputStream) unconnected},
-     *           <a href="#BROKEN"> <code>broken</code></a>, closed,
+     *           <a href="#BROKEN"> {@code broken}</a>, closed,
      *           or if an I/O error occurs.
      */
     public synchronized int read()  throws IOException {
@@ -341,26 +341,26 @@
     }
 
     /**
-     * Reads up to <code>len</code> bytes of data from this piped input
-     * stream into an array of bytes. Less than <code>len</code> bytes
+     * Reads up to {@code len} bytes of data from this piped input
+     * stream into an array of bytes. Less than {@code len} bytes
      * will be read if the end of the data stream is reached or if
-     * <code>len</code> exceeds the pipe's buffer size.
-     * If <code>len </code> is zero, then no bytes are read and 0 is returned;
+     * {@code len} exceeds the pipe's buffer size.
+     * If {@code len } is zero, then no bytes are read and 0 is returned;
      * otherwise, the method blocks until at least 1 byte of input is
      * available, end of the stream has been detected, or an exception is
      * thrown.
      *
      * @param      b     the buffer into which the data is read.
-     * @param      off   the start offset in the destination array <code>b</code>
+     * @param      off   the start offset in the destination array {@code b}
      * @param      len   the maximum number of bytes read.
      * @return     the total number of bytes read into the buffer, or
-     *             <code>-1</code> if there is no more data because the end of
+     *             {@code -1} if there is no more data because the end of
      *             the stream has been reached.
-     * @throws     NullPointerException If <code>b</code> is <code>null</code>.
-     * @throws     IndexOutOfBoundsException If <code>off</code> is negative,
-     *             <code>len</code> is negative, or <code>len</code> is greater than
-     *             <code>b.length - off</code>
-     * @throws     IOException if the pipe is <a href="#BROKEN"> <code>broken</code></a>,
+     * @throws     NullPointerException If {@code b} is {@code null}.
+     * @throws     IndexOutOfBoundsException If {@code off} is negative,
+     *             {@code len} is negative, or {@code len} is greater than
+     *             {@code b.length - off}
+     * @throws     IOException if the pipe is <a href="#BROKEN"> {@code broken}</a>,
      *           {@link #connect(java.io.PipedOutputStream) unconnected},
      *           closed, or if an I/O error occurs.
      */
@@ -418,7 +418,7 @@
      *         without blocking, or {@code 0} if this input stream has been
      *         closed by invoking its {@link #close()} method, or if the pipe
      *         is {@link #connect(java.io.PipedOutputStream) unconnected}, or
-     *         <a href="#BROKEN"> <code>broken</code></a>.
+     *         <a href="#BROKEN"> {@code broken}</a>.
      *
      * @throws IOException  if an I/O error occurs.
      * @since  1.0.2
--- a/src/java.base/share/classes/java/io/PipedOutputStream.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/PipedOutputStream.java	Wed Sep 25 22:40:41 2019 +0200
@@ -31,8 +31,8 @@
  * A piped output stream can be connected to a piped input stream
  * to create a communications pipe. The piped output stream is the
  * sending end of the pipe. Typically, data is written to a
- * <code>PipedOutputStream</code> object by one thread and data is
- * read from the connected <code>PipedInputStream</code> by some
+ * {@code PipedOutputStream} object by one thread and data is
+ * read from the connected {@code PipedInputStream} by some
  * other thread. Attempting to use both objects from a single thread
  * is not recommended as it may deadlock the thread.
  * The pipe is said to be <a id=BROKEN> <i>broken</i> </a> if a
@@ -55,7 +55,7 @@
     /**
      * Creates a piped output stream connected to the specified piped
      * input stream. Data bytes written to this stream will then be
-     * available as input from <code>snk</code>.
+     * available as input from {@code snk}.
      *
      * @param      snk   The piped input stream to connect to.
      * @throws     IOException  if an I/O error occurs.
@@ -78,10 +78,10 @@
     /**
      * Connects this piped output stream to a receiver. If this object
      * is already connected to some other piped input stream, an
-     * <code>IOException</code> is thrown.
+     * {@code IOException} is thrown.
      * <p>
-     * If <code>snk</code> is an unconnected piped input stream and
-     * <code>src</code> is an unconnected piped output stream, they may
+     * If {@code snk} is an unconnected piped input stream and
+     * {@code src} is an unconnected piped output stream, they may
      * be connected by either the call:
      * <blockquote><pre>
      * src.connect(snk)</pre></blockquote>
@@ -106,11 +106,11 @@
     }
 
     /**
-     * Writes the specified <code>byte</code> to the piped output stream.
+     * Writes the specified {@code byte} to the piped output stream.
      * <p>
-     * Implements the <code>write</code> method of <code>OutputStream</code>.
+     * Implements the {@code write} method of {@code OutputStream}.
      *
-     * @param   b   the <code>byte</code> to be written.
+     * @param   b   the {@code byte} to be written.
      * @throws  IOException if the pipe is <a href=#BROKEN> broken</a>,
      *          {@link #connect(java.io.PipedInputStream) unconnected},
      *          closed, or if an I/O error occurs.
@@ -123,8 +123,8 @@
     }
 
     /**
-     * Writes <code>len</code> bytes from the specified byte array
-     * starting at offset <code>off</code> to this piped output stream.
+     * Writes {@code len} bytes from the specified byte array
+     * starting at offset {@code off} to this piped output stream.
      * This method blocks until all the bytes are written to the output
      * stream.
      *
--- a/src/java.base/share/classes/java/io/PipedReader.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/PipedReader.java	Wed Sep 25 22:40:41 2019 +0200
@@ -59,7 +59,7 @@
      * The index of the position in the circular buffer at which the
      * next character of data will be stored when received from the connected
      * piped writer. <code>in&lt;0</code> implies the buffer is empty,
-     * <code>in==out</code> implies the buffer is full
+     * {@code in==out} implies the buffer is full
      */
     int in = -1;
 
@@ -70,9 +70,9 @@
     int out = 0;
 
     /**
-     * Creates a <code>PipedReader</code> so
+     * Creates a {@code PipedReader} so
      * that it is connected to the piped writer
-     * <code>src</code>. Data written to <code>src</code>
+     * {@code src}. Data written to {@code src}
      * will then be available as input from this stream.
      *
      * @param      src   the stream to connect to.
@@ -83,9 +83,9 @@
     }
 
     /**
-     * Creates a <code>PipedReader</code> so that it is connected
-     * to the piped writer <code>src</code> and uses the specified
-     * pipe size for the pipe's buffer. Data written to <code>src</code>
+     * Creates a {@code PipedReader} so that it is connected
+     * to the piped writer {@code src} and uses the specified
+     * pipe size for the pipe's buffer. Data written to {@code src}
      * will then be  available as input from this stream.
 
      * @param      src       the stream to connect to.
@@ -101,10 +101,10 @@
 
 
     /**
-     * Creates a <code>PipedReader</code> so
+     * Creates a {@code PipedReader} so
      * that it is not yet {@linkplain #connect(java.io.PipedWriter)
      * connected}. It must be {@linkplain java.io.PipedWriter#connect(
-     * java.io.PipedReader) connected} to a <code>PipedWriter</code>
+     * java.io.PipedReader) connected} to a {@code PipedWriter}
      * before being used.
      */
     public PipedReader() {
@@ -112,11 +112,11 @@
     }
 
     /**
-     * Creates a <code>PipedReader</code> so that it is not yet
+     * Creates a {@code PipedReader} so that it is not yet
      * {@link #connect(java.io.PipedWriter) connected} and uses
      * the specified pipe size for the pipe's buffer.
      * It must be  {@linkplain java.io.PipedWriter#connect(
-     * java.io.PipedReader) connected} to a <code>PipedWriter</code>
+     * java.io.PipedReader) connected} to a {@code PipedWriter}
      * before being used.
      *
      * @param   pipeSize the size of the pipe's buffer.
@@ -136,21 +136,21 @@
 
     /**
      * Causes this piped reader to be connected
-     * to the piped  writer <code>src</code>.
+     * to the piped  writer {@code src}.
      * If this object is already connected to some
-     * other piped writer, an <code>IOException</code>
+     * other piped writer, an {@code IOException}
      * is thrown.
      * <p>
-     * If <code>src</code> is an
-     * unconnected piped writer and <code>snk</code>
+     * If {@code src} is an
+     * unconnected piped writer and {@code snk}
      * is an unconnected piped reader, they
      * may be connected by either the call:
      *
-     * <pre><code>snk.connect(src)</code> </pre>
+     * <pre>{@code snk.connect(src)} </pre>
      * <p>
      * or the call:
      *
-     * <pre><code>src.connect(snk)</code> </pre>
+     * <pre>{@code src.connect(snk)} </pre>
      * <p>
      * The two calls have the same effect.
      *
@@ -219,14 +219,14 @@
     /**
      * Reads the next character of data from this piped stream.
      * If no character is available because the end of the stream
-     * has been reached, the value <code>-1</code> is returned.
+     * has been reached, the value {@code -1} is returned.
      * This method blocks until input data is available, the end of
      * the stream is detected, or an exception is thrown.
      *
-     * @return  the next character of data, or <code>-1</code> if the end of the
+     * @return  the next character of data, or {@code -1} if the end of the
      *          stream is reached.
      * @throws  IOException  if the pipe is
-     *          <a href=PipedInputStream.html#BROKEN> <code>broken</code></a>,
+     *          <a href=PipedInputStream.html#BROKEN> {@code broken}</a>,
      *          {@link #connect(java.io.PipedWriter) unconnected}, closed,
      *          or an I/O error occurs.
      */
@@ -270,20 +270,20 @@
     }
 
     /**
-     * Reads up to <code>len</code> characters of data from this piped
-     * stream into an array of characters. Less than <code>len</code> characters
+     * Reads up to {@code len} characters of data from this piped
+     * stream into an array of characters. Less than {@code len} characters
      * will be read if the end of the data stream is reached or if
-     * <code>len</code> exceeds the pipe's buffer size. This method
+     * {@code len} exceeds the pipe's buffer size. This method
      * blocks until at least one character of input is available.
      *
      * @param      cbuf     the buffer into which the data is read.
      * @param      off   the start offset of the data.
      * @param      len   the maximum number of characters read.
      * @return     the total number of characters read into the buffer, or
-     *             <code>-1</code> if there is no more data because the end of
+     *             {@code -1} if there is no more data because the end of
      *             the stream has been reached.
      * @throws     IOException  if the pipe is
-     *             <a href=PipedInputStream.html#BROKEN> <code>broken</code></a>,
+     *             <a href=PipedInputStream.html#BROKEN> {@code broken}</a>,
      *             {@link #connect(java.io.PipedWriter) unconnected}, closed,
      *             or an I/O error occurs.
      * @throws     IndexOutOfBoundsException {@inheritDoc}
@@ -331,7 +331,7 @@
      * stream is ready if the circular buffer is not empty.
      *
      * @throws     IOException  if the pipe is
-     *             <a href=PipedInputStream.html#BROKEN> <code>broken</code></a>,
+     *             <a href=PipedInputStream.html#BROKEN> {@code broken}</a>,
      *             {@link #connect(java.io.PipedWriter) unconnected}, or closed.
      */
     public synchronized boolean ready() throws IOException {
--- a/src/java.base/share/classes/java/io/PipedWriter.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/PipedWriter.java	Wed Sep 25 22:40:41 2019 +0200
@@ -50,7 +50,7 @@
     /**
      * Creates a piped writer connected to the specified piped
      * reader. Data characters written to this stream will then be
-     * available as input from <code>snk</code>.
+     * available as input from {@code snk}.
      *
      * @param      snk   The piped reader to connect to.
      * @throws     IOException  if an I/O error occurs.
@@ -73,10 +73,10 @@
     /**
      * Connects this piped writer to a receiver. If this object
      * is already connected to some other piped reader, an
-     * <code>IOException</code> is thrown.
+     * {@code IOException} is thrown.
      * <p>
-     * If <code>snk</code> is an unconnected piped reader and
-     * <code>src</code> is an unconnected piped writer, they may
+     * If {@code snk} is an unconnected piped reader and
+     * {@code src} is an unconnected piped writer, they may
      * be connected by either the call:
      * <blockquote><pre>
      * src.connect(snk)</pre></blockquote>
@@ -104,16 +104,16 @@
     }
 
     /**
-     * Writes the specified <code>char</code> to the piped output stream.
+     * Writes the specified {@code char} to the piped output stream.
      * If a thread was reading data characters from the connected piped input
      * stream, but the thread is no longer alive, then an
-     * <code>IOException</code> is thrown.
+     * {@code IOException} is thrown.
      * <p>
-     * Implements the <code>write</code> method of <code>Writer</code>.
+     * Implements the {@code write} method of {@code Writer}.
      *
-     * @param   c   the <code>char</code> to be written.
+     * @param   c   the {@code char} to be written.
      * @throw   IOException  if the pipe is
-     *          <a href=PipedOutputStream.html#BROKEN> <code>broken</code></a>,
+     *          <a href=PipedOutputStream.html#BROKEN> {@code broken}</a>,
      *          {@link #connect(java.io.PipedReader) unconnected}, closed
      *          or an I/O error occurs.
      */
@@ -143,7 +143,7 @@
      *          of the given array
      *
      * @throws  IOException  if the pipe is
-     *          <a href=PipedOutputStream.html#BROKEN><code>broken</code></a>,
+     *          <a href=PipedOutputStream.html#BROKEN>{@code broken}</a>,
      *          {@link #connect(java.io.PipedReader) unconnected}, closed
      *          or an I/O error occurs.
      */
--- a/src/java.base/share/classes/java/io/PushbackInputStream.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/PushbackInputStream.java	Wed Sep 25 22:40:41 2019 +0200
@@ -26,7 +26,7 @@
 package java.io;
 
 /**
- * A <code>PushbackInputStream</code> adds
+ * A {@code PushbackInputStream} adds
  * functionality to another input stream, namely
  * the  ability to "push back" or "unread" bytes,
  * by storing pushed-back bytes in an internal buffer.
@@ -59,8 +59,8 @@
 
     /**
      * The position within the pushback buffer from which the next byte will
-     * be read.  When the buffer is empty, <code>pos</code> is equal to
-     * <code>buf.length</code>; when the buffer is full, <code>pos</code> is
+     * be read.  When the buffer is empty, {@code pos} is equal to
+     * {@code buf.length}; when the buffer is full, {@code pos} is
      * equal to zero.
      *
      * @since   1.1
@@ -76,10 +76,10 @@
     }
 
     /**
-     * Creates a <code>PushbackInputStream</code>
-     * with a pushback buffer of the specified <code>size</code>,
+     * Creates a {@code PushbackInputStream}
+     * with a pushback buffer of the specified {@code size},
      * and saves its argument, the input stream
-     * <code>in</code>, for later use. Initially,
+     * {@code in}, for later use. Initially,
      * the pushback buffer is empty.
      *
      * @param  in    the input stream from which bytes will be read.
@@ -97,9 +97,9 @@
     }
 
     /**
-     * Creates a <code>PushbackInputStream</code>
+     * Creates a {@code PushbackInputStream}
      * with a 1-byte pushback buffer, and saves its argument, the input stream
-     * <code>in</code>, for later use. Initially,
+     * {@code in}, for later use. Initially,
      * the pushback buffer is empty.
      *
      * @param   in   the input stream from which bytes will be read.
@@ -110,18 +110,18 @@
 
     /**
      * Reads the next byte of data from this input stream. The value
-     * byte is returned as an <code>int</code> in the range
-     * <code>0</code> to <code>255</code>. If no byte is available
+     * byte is returned as an {@code int} in the range
+     * {@code 0} to {@code 255}. If no byte is available
      * because the end of the stream has been reached, the value
-     * <code>-1</code> is returned. This method blocks until input data
+     * {@code -1} is returned. This method blocks until input data
      * is available, the end of the stream is detected, or an exception
      * is thrown.
      *
      * <p> This method returns the most recently pushed-back byte, if there is
-     * one, and otherwise calls the <code>read</code> method of its underlying
+     * one, and otherwise calls the {@code read} method of its underlying
      * input stream and returns whatever value that method returns.
      *
-     * @return     the next byte of data, or <code>-1</code> if the end of the
+     * @return     the next byte of data, or {@code -1} if the end of the
      *             stream has been reached.
      * @throws     IOException  if this input stream has been closed by
      *             invoking its {@link #close()} method,
@@ -137,23 +137,23 @@
     }
 
     /**
-     * Reads up to <code>len</code> bytes of data from this input stream into
+     * Reads up to {@code len} bytes of data from this input stream into
      * an array of bytes.  This method first reads any pushed-back bytes; after
-     * that, if fewer than <code>len</code> bytes have been read then it
-     * reads from the underlying input stream. If <code>len</code> is not zero, the method
+     * that, if fewer than {@code len} bytes have been read then it
+     * reads from the underlying input stream. If {@code len} is not zero, the method
      * blocks until at least 1 byte of input is available; otherwise, no
-     * bytes are read and <code>0</code> is returned.
+     * bytes are read and {@code 0} is returned.
      *
      * @param      b     the buffer into which the data is read.
-     * @param      off   the start offset in the destination array <code>b</code>
+     * @param      off   the start offset in the destination array {@code b}
      * @param      len   the maximum number of bytes read.
      * @return     the total number of bytes read into the buffer, or
-     *             <code>-1</code> if there is no more data because the end of
+     *             {@code -1} if there is no more data because the end of
      *             the stream has been reached.
-     * @throws     NullPointerException If <code>b</code> is <code>null</code>.
-     * @throws     IndexOutOfBoundsException If <code>off</code> is negative,
-     *             <code>len</code> is negative, or <code>len</code> is greater than
-     *             <code>b.length - off</code>
+     * @throws     NullPointerException If {@code b} is {@code null}.
+     * @throws     IndexOutOfBoundsException If {@code off} is negative,
+     *             {@code len} is negative, or {@code len} is greater than
+     *             {@code b.length - off}
      * @throws     IOException  if this input stream has been closed by
      *             invoking its {@link #close()} method,
      *             or an I/O error occurs.
@@ -192,9 +192,9 @@
     /**
      * Pushes back a byte by copying it to the front of the pushback buffer.
      * After this method returns, the next byte to be read will have the value
-     * <code>(byte)b</code>.
+     * {@code (byte)b}.
      *
-     * @param      b   the <code>int</code> value whose low-order
+     * @param      b   the {@code int} value whose low-order
      *                  byte is to be pushed back.
      * @throws    IOException If there is not enough room in the pushback
      *            buffer for the byte, or this input stream has been closed by
@@ -211,13 +211,13 @@
     /**
      * Pushes back a portion of an array of bytes by copying it to the front
      * of the pushback buffer.  After this method returns, the next byte to be
-     * read will have the value <code>b[off]</code>, the byte after that will
-     * have the value <code>b[off+1]</code>, and so forth.
+     * read will have the value {@code b[off]}, the byte after that will
+     * have the value {@code b[off+1]}, and so forth.
      *
      * @param     b the byte array to push back.
      * @param     off the start offset of the data.
      * @param     len the number of bytes to push back.
-     * @throws    NullPointerException If <code>b</code> is <code>null</code>.
+     * @throws    NullPointerException If {@code b} is {@code null}.
      * @throws    IOException If there is not enough room in the pushback
      *            buffer for the specified number of bytes,
      *            or this input stream has been closed by
@@ -236,11 +236,11 @@
     /**
      * Pushes back an array of bytes by copying it to the front of the
      * pushback buffer.  After this method returns, the next byte to be read
-     * will have the value <code>b[0]</code>, the byte after that will have the
-     * value <code>b[1]</code>, and so forth.
+     * will have the value {@code b[0]}, the byte after that will have the
+     * value {@code b[1]}, and so forth.
      *
      * @param     b the byte array to push back
-     * @throws    NullPointerException If <code>b</code> is <code>null</code>.
+     * @throws    NullPointerException If {@code b} is {@code null}.
      * @throws    IOException If there is not enough room in the pushback
      *            buffer for the specified number of bytes,
      *            or this input stream has been closed by
@@ -280,14 +280,14 @@
     }
 
     /**
-     * Skips over and discards <code>n</code> bytes of data from this
-     * input stream. The <code>skip</code> method may, for a variety of
+     * Skips over and discards {@code n} bytes of data from this
+     * input stream. The {@code skip} method may, for a variety of
      * reasons, end up skipping over some smaller number of bytes,
-     * possibly zero.  If <code>n</code> is negative, no bytes are skipped.
+     * possibly zero.  If {@code n} is negative, no bytes are skipped.
      *
-     * <p> The <code>skip</code> method of <code>PushbackInputStream</code>
+     * <p> The {@code skip} method of {@code PushbackInputStream}
      * first skips over the bytes in the pushback buffer, if any.  It then
-     * calls the <code>skip</code> method of the underlying input stream if
+     * calls the {@code skip} method of the underlying input stream if
      * more bytes need to be skipped.  The actual number of bytes skipped
      * is returned.
      *
@@ -322,11 +322,11 @@
     }
 
     /**
-     * Tests if this input stream supports the <code>mark</code> and
-     * <code>reset</code> methods, which it does not.
+     * Tests if this input stream supports the {@code mark} and
+     * {@code reset} methods, which it does not.
      *
-     * @return   <code>false</code>, since this class does not support the
-     *           <code>mark</code> and <code>reset</code> methods.
+     * @return   {@code false}, since this class does not support the
+     *           {@code mark} and {@code reset} methods.
      * @see      java.io.InputStream#mark(int)
      * @see      java.io.InputStream#reset()
      */
@@ -337,7 +337,7 @@
     /**
      * Marks the current position in this input stream.
      *
-     * <p> The <code>mark</code> method of <code>PushbackInputStream</code>
+     * <p> The {@code mark} method of {@code PushbackInputStream}
      * does nothing.
      *
      * @param   readlimit   the maximum limit of bytes that can be read before
@@ -349,11 +349,11 @@
 
     /**
      * Repositions this stream to the position at the time the
-     * <code>mark</code> method was last called on this input stream.
+     * {@code mark} method was last called on this input stream.
      *
-     * <p> The method <code>reset</code> for class
-     * <code>PushbackInputStream</code> does nothing except throw an
-     * <code>IOException</code>.
+     * <p> The method {@code reset} for class
+     * {@code PushbackInputStream} does nothing except throw an
+     * {@code IOException}.
      *
      * @throws  IOException  if this method is invoked.
      * @see     java.io.InputStream#mark(int)
--- a/src/java.base/share/classes/java/io/PushbackReader.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/PushbackReader.java	Wed Sep 25 22:40:41 2019 +0200
@@ -142,7 +142,7 @@
     /**
      * Pushes back a single character by copying it to the front of the
      * pushback buffer. After this method returns, the next character to be read
-     * will have the value <code>(char)c</code>.
+     * will have the value {@code (char)c}.
      *
      * @param  c  The int value representing a character to be pushed back
      *
@@ -161,8 +161,8 @@
     /**
      * Pushes back a portion of an array of characters by copying it to the
      * front of the pushback buffer.  After this method returns, the next
-     * character to be read will have the value <code>cbuf[off]</code>, the
-     * character after that will have the value <code>cbuf[off+1]</code>, and
+     * character to be read will have the value {@code cbuf[off]}, the
+     * character after that will have the value {@code cbuf[off+1]}, and
      * so forth.
      *
      * @param      cbuf  Character array
@@ -185,8 +185,8 @@
     /**
      * Pushes back an array of characters by copying it to the front of the
      * pushback buffer.  After this method returns, the next character to be
-     * read will have the value <code>cbuf[0]</code>, the character after that
-     * will have the value <code>cbuf[1]</code>, and so forth.
+     * read will have the value {@code cbuf[0]}, the character after that
+     * will have the value {@code cbuf[1]}, and so forth.
      *
      * @param      cbuf  Character array to push back
      *
@@ -210,8 +210,8 @@
     }
 
     /**
-     * Marks the present position in the stream. The <code>mark</code>
-     * for class <code>PushbackReader</code> always throws an exception.
+     * Marks the present position in the stream. The {@code mark}
+     * for class {@code PushbackReader} always throws an exception.
      *
      * @throws     IOException  Always, since mark is not supported
      */
@@ -220,8 +220,8 @@
     }
 
     /**
-     * Resets the stream. The <code>reset</code> method of
-     * <code>PushbackReader</code> always throws an exception.
+     * Resets the stream. The {@code reset} method of
+     * {@code PushbackReader} always throws an exception.
      *
      * @throws     IOException  Always, since reset is not supported
      */
@@ -261,7 +261,7 @@
      *
      * @return    The number of characters actually skipped
      *
-     * @throws    IllegalArgumentException  If <code>n</code> is negative.
+     * @throws    IllegalArgumentException  If {@code n} is negative.
      * @throws    IOException  If an I/O error occurs
      */
     public long skip(long n) throws IOException {
--- a/src/java.base/share/classes/java/io/Reader.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/Reader.java	Wed Sep 25 22:40:41 2019 +0200
@@ -262,7 +262,7 @@
      *
      * @return    The number of characters actually skipped
      *
-     * @throws     IllegalArgumentException  If <code>n</code> is negative.
+     * @throws     IllegalArgumentException  If {@code n} is negative.
      * @throws     IOException  If an I/O error occurs
      */
     public long skip(long n) throws IOException {
--- a/src/java.base/share/classes/java/io/SequenceInputStream.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/SequenceInputStream.java	Wed Sep 25 22:40:41 2019 +0200
@@ -30,7 +30,7 @@
 import java.util.Vector;
 
 /**
- * A <code>SequenceInputStream</code> represents
+ * A {@code SequenceInputStream} represents
  * the logical concatenation of other input
  * streams. It starts out with an ordered
  * collection of input streams and reads from
@@ -48,17 +48,17 @@
     InputStream in;
 
     /**
-     * Initializes a newly created <code>SequenceInputStream</code>
+     * Initializes a newly created {@code SequenceInputStream}
      * by remembering the argument, which must
-     * be an <code>Enumeration</code>  that produces
-     * objects whose run-time type is <code>InputStream</code>.
+     * be an {@code Enumeration}  that produces
+     * objects whose run-time type is {@code InputStream}.
      * The input streams that are  produced by
      * the enumeration will be read, in order,
      * to provide the bytes to be read  from this
-     * <code>SequenceInputStream</code>. After
+     * {@code SequenceInputStream}. After
      * each input stream from the enumeration
      * is exhausted, it is closed by calling its
-     * <code>close</code> method.
+     * {@code close} method.
      *
      * @param   e   an enumeration of input streams.
      * @see     java.util.Enumeration
@@ -70,11 +70,11 @@
 
     /**
      * Initializes a newly
-     * created <code>SequenceInputStream</code>
+     * created {@code SequenceInputStream}
      * by remembering the two arguments, which
-     * will be read in order, first <code>s1</code>
-     * and then <code>s2</code>, to provide the
-     * bytes to be read from this <code>SequenceInputStream</code>.
+     * will be read in order, first {@code s1}
+     * and then {@code s2}, to provide the
+     * bytes to be read from this {@code SequenceInputStream}.
      *
      * @param   s1   the first input stream to read.
      * @param   s2   the second input stream to read.
@@ -135,19 +135,19 @@
 
     /**
      * Reads the next byte of data from this input stream. The byte is
-     * returned as an <code>int</code> in the range <code>0</code> to
-     * <code>255</code>. If no byte is available because the end of the
-     * stream has been reached, the value <code>-1</code> is returned.
+     * returned as an {@code int} in the range {@code 0} to
+     * {@code 255}. If no byte is available because the end of the
+     * stream has been reached, the value {@code -1} is returned.
      * This method blocks until input data is available, the end of the
      * stream is detected, or an exception is thrown.
      * <p>
      * This method
      * tries to read one character from the current substream. If it
-     * reaches the end of the stream, it calls the <code>close</code>
+     * reaches the end of the stream, it calls the {@code close}
      * method of the current substream and begins reading from the next
      * substream.
      *
-     * @return     the next byte of data, or <code>-1</code> if the end of the
+     * @return     the next byte of data, or {@code -1} if the end of the
      *             stream is reached.
      * @throws     IOException  if an I/O error occurs.
      */
@@ -163,26 +163,26 @@
     }
 
     /**
-     * Reads up to <code>len</code> bytes of data from this input stream
-     * into an array of bytes.  If <code>len</code> is not zero, the method
+     * Reads up to {@code len} bytes of data from this input stream
+     * into an array of bytes.  If {@code len} is not zero, the method
      * blocks until at least 1 byte of input is available; otherwise, no
-     * bytes are read and <code>0</code> is returned.
+     * bytes are read and {@code 0} is returned.
      * <p>
-     * The <code>read</code> method of <code>SequenceInputStream</code>
+     * The {@code read} method of {@code SequenceInputStream}
      * tries to read the data from the current substream. If it fails to
      * read any characters because the substream has reached the end of
-     * the stream, it calls the <code>close</code> method of the current
+     * the stream, it calls the {@code close} method of the current
      * substream and begins reading from the next substream.
      *
      * @param      b     the buffer into which the data is read.
-     * @param      off   the start offset in array <code>b</code>
+     * @param      off   the start offset in array {@code b}
      *                   at which the data is written.
      * @param      len   the maximum number of bytes read.
      * @return     int   the number of bytes read.
-     * @throws     NullPointerException If <code>b</code> is <code>null</code>.
-     * @throws     IndexOutOfBoundsException If <code>off</code> is negative,
-     *             <code>len</code> is negative, or <code>len</code> is
-     *             greater than <code>b.length - off</code>
+     * @throws     NullPointerException If {@code b} is {@code null}.
+     * @throws     IndexOutOfBoundsException If {@code off} is negative,
+     *             {@code len} is negative, or {@code len} is
+     *             greater than {@code b.length - off}
      * @throws     IOException  if an I/O error occurs.
      */
     public int read(byte b[], int off, int len) throws IOException {
@@ -208,14 +208,14 @@
     /**
      * Closes this input stream and releases any system resources
      * associated with the stream.
-     * A closed <code>SequenceInputStream</code>
+     * A closed {@code SequenceInputStream}
      * cannot  perform input operations and cannot
      * be reopened.
      * <p>
      * If this stream was created
      * from an enumeration, all remaining elements
      * are requested from the enumeration and closed
-     * before the <code>close</code> method returns.
+     * before the {@code close} method returns.
      *
      * @throws     IOException  if an I/O error occurs.
      */
--- a/src/java.base/share/classes/java/io/Serializable.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/Serializable.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, 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
@@ -142,8 +142,8 @@
  * serialVersionUID than that of the corresponding sender's class, then
  * deserialization will result in an {@link InvalidClassException}.  A
  * serializable class can declare its own serialVersionUID explicitly by
- * declaring a field named <code>"serialVersionUID"</code> that must be static,
- * final, and of type <code>long</code>:
+ * declaring a field named {@code "serialVersionUID"} that must be static,
+ * final, and of type {@code long}:
  *
  * <PRE>
  * ANY-ACCESS-MODIFIER static final long serialVersionUID = 42L;
@@ -157,11 +157,11 @@
  * serialVersionUID values, since the default serialVersionUID computation is
  * highly sensitive to class details that may vary depending on compiler
  * implementations, and can thus result in unexpected
- * <code>InvalidClassException</code>s during deserialization.  Therefore, to
+ * {@code InvalidClassException}s during deserialization.  Therefore, to
  * guarantee a consistent serialVersionUID value across different java compiler
  * implementations, a serializable class must declare an explicit
  * serialVersionUID value.  It is also strongly advised that explicit
- * serialVersionUID declarations use the <code>private</code> modifier where
+ * serialVersionUID declarations use the {@code private} modifier where
  * possible, since such declarations apply only to the immediately declaring
  * class--serialVersionUID fields are not useful as inherited members. Array
  * classes cannot declare an explicit serialVersionUID, so they always have
--- a/src/java.base/share/classes/java/io/SerializablePermission.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/SerializablePermission.java	Wed Sep 25 22:40:41 2019 +0200
@@ -116,8 +116,8 @@
      *
      * @param name the name of the SerializablePermission.
      *
-     * @throws NullPointerException if <code>name</code> is <code>null</code>.
-     * @throws IllegalArgumentException if <code>name</code> is empty.
+     * @throws NullPointerException if {@code name} is {@code null}.
+     * @throws IllegalArgumentException if {@code name} is empty.
      */
     public SerializablePermission(String name)
     {
@@ -132,8 +132,8 @@
      * @param name the name of the SerializablePermission.
      * @param actions currently unused and must be set to null
      *
-     * @throws NullPointerException if <code>name</code> is <code>null</code>.
-     * @throws IllegalArgumentException if <code>name</code> is empty.
+     * @throws NullPointerException if {@code name} is {@code null}.
+     * @throws IllegalArgumentException if {@code name} is empty.
      */
 
     public SerializablePermission(String name, String actions)
--- a/src/java.base/share/classes/java/io/StringBufferInputStream.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/StringBufferInputStream.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
  * This class allows an application to create an input stream in
  * which the bytes read are supplied by the contents of a string.
  * Applications can also read bytes from a byte array by using a
- * <code>ByteArrayInputStream</code>.
+ * {@code ByteArrayInputStream}.
  * <p>
  * Only the low eight bits of each character in the string are used by
  * this class.
@@ -40,7 +40,7 @@
  * @since      1.0
  * @deprecated This class does not properly convert characters into bytes.  As
  *             of JDK&nbsp;1.1, the preferred way to create a stream from a
- *             string is via the <code>StringReader</code> class.
+ *             string is via the {@code StringReader} class.
  */
 @Deprecated
 public
@@ -76,16 +76,16 @@
 
     /**
      * Reads the next byte of data from this input stream. The value
-     * byte is returned as an <code>int</code> in the range
-     * <code>0</code> to <code>255</code>. If no byte is available
+     * byte is returned as an {@code int} in the range
+     * {@code 0} to {@code 255}. If no byte is available
      * because the end of the stream has been reached, the value
-     * <code>-1</code> is returned.
+     * {@code -1} is returned.
      * <p>
-     * The <code>read</code> method of
-     * <code>StringBufferInputStream</code> cannot block. It returns the
+     * The {@code read} method of
+     * {@code StringBufferInputStream} cannot block. It returns the
      * low eight bits of the next character in this input stream's buffer.
      *
-     * @return     the next byte of data, or <code>-1</code> if the end of the
+     * @return     the next byte of data, or {@code -1} if the end of the
      *             stream is reached.
      */
     public synchronized int read() {
@@ -93,11 +93,11 @@
     }
 
     /**
-     * Reads up to <code>len</code> bytes of data from this input stream
+     * Reads up to {@code len} bytes of data from this input stream
      * into an array of bytes.
      * <p>
-     * The <code>read</code> method of
-     * <code>StringBufferInputStream</code> cannot block. It copies the
+     * The {@code read} method of
+     * {@code StringBufferInputStream} cannot block. It copies the
      * low eight bits from the characters in this input stream's buffer into
      * the byte array argument.
      *
@@ -105,7 +105,7 @@
      * @param      off   the start offset of the data.
      * @param      len   the maximum number of bytes read.
      * @return     the total number of bytes read into the buffer, or
-     *             <code>-1</code> if there is no more data because the end of
+     *             {@code -1} if there is no more data because the end of
      *             the stream has been reached.
      */
     @SuppressWarnings("deprecation")
@@ -133,7 +133,7 @@
     }
 
     /**
-     * Skips <code>n</code> bytes of input from this input stream. Fewer
+     * Skips {@code n} bytes of input from this input stream. Fewer
      * bytes might be skipped if the end of the input stream is reached.
      *
      * @param      n   the number of bytes to be skipped.
--- a/src/java.base/share/classes/java/io/StringReader.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/StringReader.java	Wed Sep 25 22:40:41 2019 +0200
@@ -108,9 +108,9 @@
      * Skips the specified number of characters in the stream. Returns
      * the number of characters that were skipped.
      *
-     * <p>The <code>ns</code> parameter may be negative, even though the
-     * <code>skip</code> method of the {@link Reader} superclass throws
-     * an exception in this case. Negative values of <code>ns</code> cause the
+     * <p>The {@code ns} parameter may be negative, even though the
+     * {@code skip} method of the {@link Reader} superclass throws
+     * an exception in this case. Negative values of {@code ns} cause the
      * stream to skip backwards. Negative return values indicate a skip
      * backwards. It is not possible to skip backwards past the beginning of
      * the string.
--- a/src/java.base/share/classes/java/io/UTFDataFormatException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/io/UTFDataFormatException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -32,7 +32,7 @@
  * input stream or by any class that implements the data input
  * interface.
  * See the
- * <a href="DataInput.html#modified-utf-8"><code>DataInput</code></a>
+ * <a href="DataInput.html#modified-utf-8">{@code DataInput}</a>
  * class description for the format in
  * which modified UTF-8 strings are read and written.
  *
@@ -48,19 +48,19 @@
     private static final long serialVersionUID = 420743449228280612L;
 
     /**
-     * Constructs a <code>UTFDataFormatException</code> with
-     * <code>null</code> as its error detail message.
+     * Constructs a {@code UTFDataFormatException} with
+     * {@code null} as its error detail message.
      */
     public UTFDataFormatException() {
         super();
     }
 
     /**
-     * Constructs a <code>UTFDataFormatException</code> with the
-     * specified detail message. The string <code>s</code> can be
+     * Constructs a {@code UTFDataFormatException} with the
+     * specified detail message. The string {@code s} can be
      * retrieved later by the
      * <code>{@link java.lang.Throwable#getMessage}</code>
-     * method of class <code>java.lang.Throwable</code>.
+     * method of class {@code java.lang.Throwable}.
      *
      * @param   s   the detail message.
      */
--- a/src/java.base/share/classes/java/lang/AbstractMethodError.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/AbstractMethodError.java	Wed Sep 25 22:40:41 2019 +0200
@@ -41,14 +41,14 @@
     private static final long serialVersionUID = -1654391082989018462L;
 
     /**
-     * Constructs an <code>AbstractMethodError</code> with no detail  message.
+     * Constructs an {@code AbstractMethodError} with no detail  message.
      */
     public AbstractMethodError() {
         super();
     }
 
     /**
-     * Constructs an <code>AbstractMethodError</code> with the specified
+     * Constructs an {@code AbstractMethodError} with the specified
      * detail message.
      *
      * @param   s   the detail message.
--- a/src/java.base/share/classes/java/lang/ArrayStoreException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/ArrayStoreException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -28,7 +28,7 @@
 /**
  * Thrown to indicate that an attempt has been made to store the
  * wrong type of object into an array of objects. For example, the
- * following code generates an <code>ArrayStoreException</code>:
+ * following code generates an {@code ArrayStoreException}:
  * <blockquote><pre>
  *     Object x[] = new String[3];
  *     x[0] = new Integer(0);
@@ -43,14 +43,14 @@
     private static final long serialVersionUID = -4522193890499838241L;
 
     /**
-     * Constructs an <code>ArrayStoreException</code> with no detail message.
+     * Constructs an {@code ArrayStoreException} with no detail message.
      */
     public ArrayStoreException() {
         super();
     }
 
     /**
-     * Constructs an <code>ArrayStoreException</code> with the specified
+     * Constructs an {@code ArrayStoreException} with the specified
      * detail message.
      *
      * @param   s   the detail message.
--- a/src/java.base/share/classes/java/lang/AssertionError.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/AssertionError.java	Wed Sep 25 22:40:41 2019 +0200
@@ -79,7 +79,7 @@
 
     /**
      * Constructs an AssertionError with its detail message derived
-     * from the specified <code>boolean</code>, which is converted to
+     * from the specified {@code boolean}, which is converted to
      * a string as defined in section 15.18.1.1 of
      * <cite>The Java&trade; Language Specification</cite>.
      *
@@ -91,7 +91,7 @@
 
     /**
      * Constructs an AssertionError with its detail message derived
-     * from the specified <code>char</code>, which is converted to a
+     * from the specified {@code char}, which is converted to a
      * string as defined in section 15.18.1.1 of
      * <cite>The Java&trade; Language Specification</cite>.
      *
@@ -103,7 +103,7 @@
 
     /**
      * Constructs an AssertionError with its detail message derived
-     * from the specified <code>int</code>, which is converted to a
+     * from the specified {@code int}, which is converted to a
      * string as defined in section 15.18.1.1 of
      * <cite>The Java&trade; Language Specification</cite>.
      *
@@ -115,7 +115,7 @@
 
     /**
      * Constructs an AssertionError with its detail message derived
-     * from the specified <code>long</code>, which is converted to a
+     * from the specified {@code long}, which is converted to a
      * string as defined in section 15.18.1.1 of
      * <cite>The Java&trade; Language Specification</cite>.
      *
@@ -127,7 +127,7 @@
 
     /**
      * Constructs an AssertionError with its detail message derived
-     * from the specified <code>float</code>, which is converted to a
+     * from the specified {@code float}, which is converted to a
      * string as defined in section 15.18.1.1 of
      * <cite>The Java&trade; Language Specification</cite>.
      *
@@ -139,7 +139,7 @@
 
     /**
      * Constructs an AssertionError with its detail message derived
-     * from the specified <code>double</code>, which is converted to a
+     * from the specified {@code double}, which is converted to a
      * string as defined in section 15.18.1.1 of
      * <cite>The Java&trade; Language Specification</cite>.
      *
--- a/src/java.base/share/classes/java/lang/ClassCastException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/ClassCastException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -28,7 +28,7 @@
 /**
  * Thrown to indicate that the code has attempted to cast an object
  * to a subclass of which it is not an instance. For example, the
- * following code generates a <code>ClassCastException</code>:
+ * following code generates a {@code ClassCastException}:
  * <blockquote><pre>
  *     Object x = new Integer(0);
  *     System.out.println((String)x);
@@ -43,14 +43,14 @@
     private static final long serialVersionUID = -9223365651070458532L;
 
     /**
-     * Constructs a <code>ClassCastException</code> with no detail message.
+     * Constructs a {@code ClassCastException} with no detail message.
      */
     public ClassCastException() {
         super();
     }
 
     /**
-     * Constructs a <code>ClassCastException</code> with the specified
+     * Constructs a {@code ClassCastException} with the specified
      * detail message.
      *
      * @param   s   the detail message.
--- a/src/java.base/share/classes/java/lang/ClassFormatError.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/ClassFormatError.java	Wed Sep 25 22:40:41 2019 +0200
@@ -39,14 +39,14 @@
     private static final long serialVersionUID = -8420114879011949195L;
 
     /**
-     * Constructs a <code>ClassFormatError</code> with no detail message.
+     * Constructs a {@code ClassFormatError} with no detail message.
      */
     public ClassFormatError() {
         super();
     }
 
     /**
-     * Constructs a <code>ClassFormatError</code> with the specified
+     * Constructs a {@code ClassFormatError} with the specified
      * detail message.
      *
      * @param   s   the detail message.
--- a/src/java.base/share/classes/java/lang/ClassNotFoundException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/ClassNotFoundException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -34,10 +34,10 @@
  * Thrown when an application tries to load in a class through its
  * string name using:
  * <ul>
- * <li>The <code>forName</code> method in class <code>Class</code>.
- * <li>The <code>findSystemClass</code> method in class
- *     <code>ClassLoader</code> .
- * <li>The <code>loadClass</code> method in class <code>ClassLoader</code>.
+ * <li>The {@code forName} method in class {@code Class}.
+ * <li>The {@code findSystemClass} method in class
+ *     {@code ClassLoader} .
+ * <li>The {@code loadClass} method in class {@code ClassLoader}.
  * </ul>
  * <p>
  * but no definition for the class with the specified name could be found.
@@ -63,14 +63,14 @@
      private static final long serialVersionUID = 9176873029745254542L;
 
     /**
-     * Constructs a <code>ClassNotFoundException</code> with no detail message.
+     * Constructs a {@code ClassNotFoundException} with no detail message.
      */
     public ClassNotFoundException() {
         super((Throwable)null);  // Disallow initCause
     }
 
     /**
-     * Constructs a <code>ClassNotFoundException</code> with the
+     * Constructs a {@code ClassNotFoundException} with the
      * specified detail message.
      *
      * @param   s   the detail message.
@@ -80,7 +80,7 @@
     }
 
     /**
-     * Constructs a <code>ClassNotFoundException</code> with the
+     * Constructs a {@code ClassNotFoundException} with the
      * specified detail message and optional exception that was
      * raised while loading the class.
      *
@@ -100,7 +100,7 @@
      * The {@link Throwable#getCause()} method is now the preferred means of
      * obtaining this information.
      *
-     * @return the <code>Exception</code> that was raised while loading a class
+     * @return the {@code Exception} that was raised while loading a class
      * @since 1.2
      */
     public Throwable getException() {
--- a/src/java.base/share/classes/java/lang/CloneNotSupportedException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/CloneNotSupportedException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -26,12 +26,12 @@
 package java.lang;
 
 /**
- * Thrown to indicate that the <code>clone</code> method in class
- * <code>Object</code> has been called to clone an object, but that
- * the object's class does not implement the <code>Cloneable</code>
+ * Thrown to indicate that the {@code clone} method in class
+ * {@code Object} has been called to clone an object, but that
+ * the object's class does not implement the {@code Cloneable}
  * interface.
  * <p>
- * Applications that override the <code>clone</code> method can also
+ * Applications that override the {@code clone} method can also
  * throw this exception to indicate that an object could not or
  * should not be cloned.
  *
@@ -47,7 +47,7 @@
     private static final long serialVersionUID = 5195511250079656443L;
 
     /**
-     * Constructs a <code>CloneNotSupportedException</code> with no
+     * Constructs a {@code CloneNotSupportedException} with no
      * detail message.
      */
     public CloneNotSupportedException() {
@@ -55,7 +55,7 @@
     }
 
     /**
-     * Constructs a <code>CloneNotSupportedException</code> with the
+     * Constructs a {@code CloneNotSupportedException} with the
      * specified detail message.
      *
      * @param   s   the detail message.
--- a/src/java.base/share/classes/java/lang/Cloneable.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/Cloneable.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,14 +26,14 @@
 package java.lang;
 
 /**
- * A class implements the <code>Cloneable</code> interface to
+ * A class implements the {@code Cloneable} interface to
  * indicate to the {@link java.lang.Object#clone()} method that it
  * is legal for that method to make a
  * field-for-field copy of instances of that class.
  * <p>
  * Invoking Object's clone method on an instance that does not implement the
- * <code>Cloneable</code> interface results in the exception
- * <code>CloneNotSupportedException</code> being thrown.
+ * {@code Cloneable} interface results in the exception
+ * {@code CloneNotSupportedException} being thrown.
  * <p>
  * By convention, classes that implement this interface should override
  * {@code Object.clone} (which is protected) with a public method.
--- a/src/java.base/share/classes/java/lang/ConditionalSpecialCasing.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/ConditionalSpecialCasing.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, 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
@@ -34,15 +34,15 @@
 
 
 /**
- * This is a utility class for <code>String.toLowerCase()</code> and
- * <code>String.toUpperCase()</code>, that handles special casing with
+ * This is a utility class for {@code String.toLowerCase()} and
+ * {@code String.toUpperCase()}, that handles special casing with
  * conditions.  In other words, it handles the mappings with conditions
  * that are defined in
  * <a href="http://www.unicode.org/Public/UNIDATA/SpecialCasing.txt">Special
  * Casing Properties</a> file.
  * <p>
  * Note that the unconditional case mappings (including 1:M mappings)
- * are handled in <code>Character.toLower/UpperCase()</code>.
+ * are handled in {@code Character.toLower/UpperCase()}.
  */
 final class ConditionalSpecialCasing {
 
@@ -329,7 +329,7 @@
     /**
      * Implements the "Before_Dot" condition
      *
-     * Specification: C is followed by <code>U+0307 COMBINING DOT ABOVE</code>.
+     * Specification: C is followed by {@code U+0307 COMBINING DOT ABOVE}.
      * Any sequence of characters with a combining class that is
      * neither 0 nor 230 may intervene between the current character
      * and the combining dot above.
--- a/src/java.base/share/classes/java/lang/ExceptionInInitializerError.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/ExceptionInInitializerError.java	Wed Sep 25 22:40:41 2019 +0200
@@ -32,7 +32,7 @@
 
 /**
  * Signals that an unexpected exception has occurred in a static initializer.
- * An <code>ExceptionInInitializerError</code> is thrown to indicate that an
+ * An {@code ExceptionInInitializerError} is thrown to indicate that an
  * exception occurred during evaluation of a static initializer or the
  * initializer for a static variable.
  *
@@ -54,8 +54,8 @@
     private static final long serialVersionUID = 1521711792217232256L;
 
     /**
-     * Constructs an <code>ExceptionInInitializerError</code> with
-     * <code>null</code> as its detail message string and with no saved
+     * Constructs an {@code ExceptionInInitializerError} with
+     * {@code null} as its detail message string and with no saved
      * throwable object.
      * A detail message is a String that describes this particular exception.
      */
@@ -64,10 +64,10 @@
     }
 
     /**
-     * Constructs a new <code>ExceptionInInitializerError</code> class by
-     * saving a reference to the <code>Throwable</code> object thrown for
+     * Constructs a new {@code ExceptionInInitializerError} class by
+     * saving a reference to the {@code Throwable} object thrown for
      * later retrieval by the {@link #getException()} method. The detail
-     * message string is set to <code>null</code>.
+     * message string is set to {@code null}.
      *
      * @param thrown The exception thrown
      */
@@ -97,8 +97,8 @@
      * obtaining this information.
      *
      * @return the saved throwable object of this
-     *         <code>ExceptionInInitializerError</code>, or <code>null</code>
-     *         if this <code>ExceptionInInitializerError</code> has no saved
+     *         {@code ExceptionInInitializerError}, or {@code null}
+     *         if this {@code ExceptionInInitializerError} has no saved
      *         throwable object.
      */
     public Throwable getException() {
--- a/src/java.base/share/classes/java/lang/IllegalAccessError.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/IllegalAccessError.java	Wed Sep 25 22:40:41 2019 +0200
@@ -41,14 +41,14 @@
     private static final long serialVersionUID = -8988904074992417891L;
 
     /**
-     * Constructs an <code>IllegalAccessError</code> with no detail message.
+     * Constructs an {@code IllegalAccessError} with no detail message.
      */
     public IllegalAccessError() {
         super();
     }
 
     /**
-     * Constructs an <code>IllegalAccessError</code> with the specified
+     * Constructs an {@code IllegalAccessError} with the specified
      * detail message.
      *
      * @param   s   the detail message.
--- a/src/java.base/share/classes/java/lang/IllegalAccessException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/IllegalAccessException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
     private static final long serialVersionUID = 6616958222490762034L;
 
     /**
-     * Constructs an <code>IllegalAccessException</code> without a
+     * Constructs an {@code IllegalAccessException} without a
      * detail message.
      */
     public IllegalAccessException() {
@@ -68,7 +68,7 @@
     }
 
     /**
-     * Constructs an <code>IllegalAccessException</code> with a detail message.
+     * Constructs an {@code IllegalAccessException} with a detail message.
      *
      * @param   s   the detail message.
      */
--- a/src/java.base/share/classes/java/lang/IllegalArgumentException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/IllegalArgumentException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -35,7 +35,7 @@
 public
 class IllegalArgumentException extends RuntimeException {
     /**
-     * Constructs an <code>IllegalArgumentException</code> with no
+     * Constructs an {@code IllegalArgumentException} with no
      * detail message.
      */
     public IllegalArgumentException() {
@@ -43,7 +43,7 @@
     }
 
     /**
-     * Constructs an <code>IllegalArgumentException</code> with the
+     * Constructs an {@code IllegalArgumentException} with the
      * specified detail message.
      *
      * @param   s   the detail message.
@@ -56,7 +56,7 @@
      * Constructs a new exception with the specified detail message and
      * cause.
      *
-     * <p>Note that the detail message associated with <code>cause</code> is
+     * <p>Note that the detail message associated with {@code cause} is
      * <i>not</i> automatically incorporated in this exception's detail
      * message.
      *
--- a/src/java.base/share/classes/java/lang/IllegalMonitorStateException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/IllegalMonitorStateException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -44,7 +44,7 @@
     private static final long serialVersionUID = 3713306369498869069L;
 
     /**
-     * Constructs an <code>IllegalMonitorStateException</code> with no
+     * Constructs an {@code IllegalMonitorStateException} with no
      * detail message.
      */
     public IllegalMonitorStateException() {
@@ -52,7 +52,7 @@
     }
 
     /**
-     * Constructs an <code>IllegalMonitorStateException</code> with the
+     * Constructs an {@code IllegalMonitorStateException} with the
      * specified detail message.
      *
      * @param   s   the detail message.
--- a/src/java.base/share/classes/java/lang/IllegalStateException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/IllegalStateException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -59,7 +59,7 @@
      * Constructs a new exception with the specified detail message and
      * cause.
      *
-     * <p>Note that the detail message associated with <code>cause</code> is
+     * <p>Note that the detail message associated with {@code cause} is
      * <i>not</i> automatically incorporated in this exception's detail
      * message.
      *
--- a/src/java.base/share/classes/java/lang/IllegalThreadStateException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/IllegalThreadStateException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -28,8 +28,8 @@
 /**
  * Thrown to indicate that a thread is not in an appropriate state
  * for the requested operation. See, for example, the
- * <code>suspend</code> and <code>resume</code> methods in class
- * <code>Thread</code>.
+ * {@code suspend} and {@code resume} methods in class
+ * {@code Thread}.
  *
  * @author  unascribed
  * @see     java.lang.Thread#resume()
@@ -41,7 +41,7 @@
     private static final long serialVersionUID = -7626246362397460174L;
 
     /**
-     * Constructs an <code>IllegalThreadStateException</code> with no
+     * Constructs an {@code IllegalThreadStateException} with no
      * detail message.
      */
     public IllegalThreadStateException() {
@@ -49,7 +49,7 @@
     }
 
     /**
-     * Constructs an <code>IllegalThreadStateException</code> with the
+     * Constructs an {@code IllegalThreadStateException} with the
      * specified detail message.
      *
      * @param   s   the detail message.
--- a/src/java.base/share/classes/java/lang/IncompatibleClassChangeError.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/IncompatibleClassChangeError.java	Wed Sep 25 22:40:41 2019 +0200
@@ -39,7 +39,7 @@
     private static final long serialVersionUID = -4914975503642802119L;
 
     /**
-     * Constructs an <code>IncompatibleClassChangeError</code> with no
+     * Constructs an {@code IncompatibleClassChangeError} with no
      * detail message.
      */
     public IncompatibleClassChangeError () {
@@ -47,7 +47,7 @@
     }
 
     /**
-     * Constructs an <code>IncompatibleClassChangeError</code> with the
+     * Constructs an {@code IncompatibleClassChangeError} with the
      * specified detail message.
      *
      * @param   s   the detail message.
--- a/src/java.base/share/classes/java/lang/InstantiationError.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/InstantiationError.java	Wed Sep 25 22:40:41 2019 +0200
@@ -26,7 +26,7 @@
 package java.lang;
 
 /**
- * Thrown when an application tries to use the Java <code>new</code>
+ * Thrown when an application tries to use the Java {@code new}
  * construct to instantiate an abstract class or an interface.
  * <p>
  * Normally, this error is caught by the compiler; this error can
@@ -44,14 +44,14 @@
     private static final long serialVersionUID = -4885810657349421204L;
 
     /**
-     * Constructs an <code>InstantiationError</code> with no detail  message.
+     * Constructs an {@code InstantiationError} with no detail  message.
      */
     public InstantiationError() {
         super();
     }
 
     /**
-     * Constructs an <code>InstantiationError</code> with the specified
+     * Constructs an {@code InstantiationError} with the specified
      * detail message.
      *
      * @param   s   the detail message.
--- a/src/java.base/share/classes/java/lang/InternalError.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/InternalError.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2011, 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
@@ -36,14 +36,14 @@
     private static final long serialVersionUID = -9062593416125562365L;
 
     /**
-     * Constructs an <code>InternalError</code> with no detail message.
+     * Constructs an {@code InternalError} with no detail message.
      */
     public InternalError() {
         super();
     }
 
     /**
-     * Constructs an <code>InternalError</code> with the specified
+     * Constructs an {@code InternalError} with the specified
      * detail message.
      *
      * @param   message   the detail message.
--- a/src/java.base/share/classes/java/lang/InterruptedException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/InterruptedException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -52,14 +52,14 @@
     private static final long serialVersionUID = 6700697376100628473L;
 
     /**
-     * Constructs an <code>InterruptedException</code> with no detail  message.
+     * Constructs an {@code InterruptedException} with no detail  message.
      */
     public InterruptedException() {
         super();
     }
 
     /**
-     * Constructs an <code>InterruptedException</code> with the
+     * Constructs an {@code InterruptedException} with the
      * specified detail message.
      *
      * @param   s   the detail message.
--- a/src/java.base/share/classes/java/lang/NegativeArraySizeException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/NegativeArraySizeException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -37,7 +37,7 @@
     private static final long serialVersionUID = -8960118058596991861L;
 
     /**
-     * Constructs a <code>NegativeArraySizeException</code> with no
+     * Constructs a {@code NegativeArraySizeException} with no
      * detail message.
      */
     public NegativeArraySizeException() {
@@ -45,7 +45,7 @@
     }
 
     /**
-     * Constructs a <code>NegativeArraySizeException</code> with the
+     * Constructs a {@code NegativeArraySizeException} with the
      * specified detail message.
      *
      * @param   s   the detail message.
--- a/src/java.base/share/classes/java/lang/NoClassDefFoundError.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/NoClassDefFoundError.java	Wed Sep 25 22:40:41 2019 +0200
@@ -26,9 +26,9 @@
 package java.lang;
 
 /**
- * Thrown if the Java Virtual Machine or a <code>ClassLoader</code> instance
+ * Thrown if the Java Virtual Machine or a {@code ClassLoader} instance
  * tries to load in the definition of a class (as part of a normal method call
- * or as part of creating a new instance using the <code>new</code> expression)
+ * or as part of creating a new instance using the {@code new} expression)
  * and no definition of the class could be found.
  * <p>
  * The searched-for class definition existed when the currently
@@ -44,14 +44,14 @@
     private static final long serialVersionUID = 9095859863287012458L;
 
     /**
-     * Constructs a <code>NoClassDefFoundError</code> with no detail message.
+     * Constructs a {@code NoClassDefFoundError} with no detail message.
      */
     public NoClassDefFoundError() {
         super();
     }
 
     /**
-     * Constructs a <code>NoClassDefFoundError</code> with the specified
+     * Constructs a {@code NoClassDefFoundError} with the specified
      * detail message.
      *
      * @param   s   the detail message.
--- a/src/java.base/share/classes/java/lang/NoSuchFieldError.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/NoSuchFieldError.java	Wed Sep 25 22:40:41 2019 +0200
@@ -42,14 +42,14 @@
     private static final long serialVersionUID = -3456430195886129035L;
 
     /**
-     * Constructs a <code>NoSuchFieldError</code> with no detail message.
+     * Constructs a {@code NoSuchFieldError} with no detail message.
      */
     public NoSuchFieldError() {
         super();
     }
 
     /**
-     * Constructs a <code>NoSuchFieldError</code> with the specified
+     * Constructs a {@code NoSuchFieldError} with the specified
      * detail message.
      *
      * @param   s   the detail message.
--- a/src/java.base/share/classes/java/lang/NoSuchMethodError.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/NoSuchMethodError.java	Wed Sep 25 22:40:41 2019 +0200
@@ -43,14 +43,14 @@
     private static final long serialVersionUID = -3765521442372831335L;
 
     /**
-     * Constructs a <code>NoSuchMethodError</code> with no detail message.
+     * Constructs a {@code NoSuchMethodError} with no detail message.
      */
     public NoSuchMethodError() {
         super();
     }
 
     /**
-     * Constructs a <code>NoSuchMethodError</code> with the
+     * Constructs a {@code NoSuchMethodError} with the
      * specified detail message.
      *
      * @param   s   the detail message.
--- a/src/java.base/share/classes/java/lang/NoSuchMethodException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/NoSuchMethodException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -37,14 +37,14 @@
     private static final long serialVersionUID = 5034388446362600923L;
 
     /**
-     * Constructs a <code>NoSuchMethodException</code> without a detail message.
+     * Constructs a {@code NoSuchMethodException} without a detail message.
      */
     public NoSuchMethodException() {
         super();
     }
 
     /**
-     * Constructs a <code>NoSuchMethodException</code> with a detail message.
+     * Constructs a {@code NoSuchMethodException} with a detail message.
      *
      * @param      s   the detail message.
      */
--- a/src/java.base/share/classes/java/lang/NumberFormatException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/NumberFormatException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -40,14 +40,14 @@
     static final long serialVersionUID = -2848938806368998894L;
 
     /**
-     * Constructs a <code>NumberFormatException</code> with no detail message.
+     * Constructs a {@code NumberFormatException} with no detail message.
      */
     public NumberFormatException () {
         super();
     }
 
     /**
-     * Constructs a <code>NumberFormatException</code> with the
+     * Constructs a {@code NumberFormatException} with the
      * specified detail message.
      *
      * @param   s   the detail message.
--- a/src/java.base/share/classes/java/lang/Runnable.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/Runnable.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2013, 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
@@ -26,23 +26,23 @@
 package java.lang;
 
 /**
- * The <code>Runnable</code> interface should be implemented by any
+ * The {@code Runnable} interface should be implemented by any
  * class whose instances are intended to be executed by a thread. The
- * class must define a method of no arguments called <code>run</code>.
+ * class must define a method of no arguments called {@code run}.
  * <p>
  * This interface is designed to provide a common protocol for objects that
  * wish to execute code while they are active. For example,
- * <code>Runnable</code> is implemented by class <code>Thread</code>.
+ * {@code Runnable} is implemented by class {@code Thread}.
  * Being active simply means that a thread has been started and has not
  * yet been stopped.
  * <p>
- * In addition, <code>Runnable</code> provides the means for a class to be
- * active while not subclassing <code>Thread</code>. A class that implements
- * <code>Runnable</code> can run without subclassing <code>Thread</code>
- * by instantiating a <code>Thread</code> instance and passing itself in
- * as the target.  In most cases, the <code>Runnable</code> interface should
- * be used if you are only planning to override the <code>run()</code>
- * method and no other <code>Thread</code> methods.
+ * In addition, {@code Runnable} provides the means for a class to be
+ * active while not subclassing {@code Thread}. A class that implements
+ * {@code Runnable} can run without subclassing {@code Thread}
+ * by instantiating a {@code Thread} instance and passing itself in
+ * as the target.  In most cases, the {@code Runnable} interface should
+ * be used if you are only planning to override the {@code run()}
+ * method and no other {@code Thread} methods.
  * This is important because classes should not be subclassed
  * unless the programmer intends on modifying or enhancing the fundamental
  * behavior of the class.
@@ -55,12 +55,12 @@
 @FunctionalInterface
 public interface Runnable {
     /**
-     * When an object implementing interface <code>Runnable</code> is used
+     * When an object implementing interface {@code Runnable} is used
      * to create a thread, starting the thread causes the object's
-     * <code>run</code> method to be called in that separately executing
+     * {@code run} method to be called in that separately executing
      * thread.
      * <p>
-     * The general contract of the method <code>run</code> is that it may
+     * The general contract of the method {@code run} is that it may
      * take any action whatsoever.
      *
      * @see     java.lang.Thread#run()
--- a/src/java.base/share/classes/java/lang/RuntimePermission.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/RuntimePermission.java	Wed Sep 25 22:40:41 2019 +0200
@@ -180,7 +180,7 @@
  *
  * <tr>
  *   <th scope="row">stopThread</th>
- *   <td>Stopping of threads via calls to the Thread <code>stop</code>
+ *   <td>Stopping of threads via calls to the Thread {@code stop}
  * method</td>
  *   <td>This allows code to stop any thread in the system provided that it is
  * already granted permission to access that thread.
@@ -191,9 +191,9 @@
  * <tr>
  *   <th scope="row">modifyThreadGroup</th>
  *   <td>modification of thread groups, e.g., via calls to ThreadGroup
- * <code>destroy</code>, <code>getParent</code>, <code>resume</code>,
- * <code>setDaemon</code>, <code>setMaxPriority</code>, <code>stop</code>,
- * and <code>suspend</code> methods</td>
+ * {@code destroy}, {@code getParent}, {@code resume},
+ * {@code setDaemon}, {@code setMaxPriority}, {@code stop},
+ * and {@code suspend} methods</td>
  *   <td>This allows an attacker to create thread groups and
  * set their run priority.</td>
  * </tr>
@@ -246,8 +246,8 @@
  * <tr>
  *   <th scope="row">accessClassInPackage.{package name}</th>
  *   <td>Access to the specified package via a class loader's
- * <code>loadClass</code> method when that class loader calls
- * the SecurityManager <code>checkPackageAccess</code> method</td>
+ * {@code loadClass} method when that class loader calls
+ * the SecurityManager {@code checkPackageAccess} method</td>
  *   <td>This gives code access to classes in packages
  * to which it normally does not have access. Malicious code
  * may use these classes to help in its attempt to compromise
@@ -257,12 +257,12 @@
  * <tr>
  *   <th scope="row">defineClassInPackage.{package name}</th>
  *   <td>Definition of classes in the specified package, via a class
- * loader's <code>defineClass</code> method when that class loader calls
- * the SecurityManager <code>checkPackageDefinition</code> method.</td>
+ * loader's {@code defineClass} method when that class loader calls
+ * the SecurityManager {@code checkPackageDefinition} method.</td>
  *   <td>This grants code permission to define a class
  * in a particular package. This is dangerous because malicious
  * code with this permission may define rogue classes in
- * trusted packages like <code>java.security</code> or <code>java.lang</code>,
+ * trusted packages like {@code java.security} or {@code java.lang},
  * for example.</td>
  * </tr>
  *
@@ -412,8 +412,8 @@
      *
      * @param name the name of the RuntimePermission.
      *
-     * @throws NullPointerException if <code>name</code> is <code>null</code>.
-     * @throws IllegalArgumentException if <code>name</code> is empty.
+     * @throws NullPointerException if {@code name} is {@code null}.
+     * @throws IllegalArgumentException if {@code name} is empty.
      */
 
     public RuntimePermission(String name)
@@ -429,8 +429,8 @@
      * @param name the name of the RuntimePermission.
      * @param actions should be null.
      *
-     * @throws NullPointerException if <code>name</code> is <code>null</code>.
-     * @throws IllegalArgumentException if <code>name</code> is empty.
+     * @throws NullPointerException if {@code name} is {@code null}.
+     * @throws IllegalArgumentException if {@code name} is empty.
      */
 
     public RuntimePermission(String name, String actions)
--- a/src/java.base/share/classes/java/lang/SecurityManager.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/SecurityManager.java	Wed Sep 25 22:40:41 2019 +0200
@@ -60,11 +60,11 @@
  * operation to be performed. The
  * application can allow or disallow the operation.
  * <p>
- * The <code>SecurityManager</code> class contains many methods with
- * names that begin with the word <code>check</code>. These methods
+ * The {@code SecurityManager} class contains many methods with
+ * names that begin with the word {@code check}. These methods
  * are called by various methods in the Java libraries before those
  * methods perform certain potentially sensitive operations. The
- * invocation of such a <code>check</code> method typically looks like this:
+ * invocation of such a {@code check} method typically looks like this:
  * <blockquote><pre>
  *     SecurityManager security = System.getSecurityManager();
  *     if (security != null) {
@@ -75,7 +75,7 @@
  * The security manager is thereby given an opportunity to prevent
  * completion of the operation by throwing an exception. A security
  * manager routine simply returns if the operation is permitted, but
- * throws a <code>SecurityException</code> if the operation is not
+ * throws a {@code SecurityException} if the operation is not
  * permitted.
  * <p>
  * Environments using a security manager will typically set the security
@@ -185,16 +185,16 @@
  *
  * <p>
  * If a requested access is allowed,
- * <code>checkPermission</code> returns quietly. If denied, a
- * <code>SecurityException</code> is thrown.
+ * {@code checkPermission} returns quietly. If denied, a
+ * {@code SecurityException} is thrown.
  * <p>
  * The default implementation of each of the other
- * <code>check</code> methods in <code>SecurityManager</code> is to
- * call the <code>SecurityManager checkPermission</code> method
+ * {@code check} methods in {@code SecurityManager} is to
+ * call the {@code SecurityManager checkPermission} method
  * to determine if the calling thread has permission to perform the requested
  * operation.
  * <p>
- * Note that the <code>checkPermission</code> method with
+ * Note that the {@code checkPermission} method with
  * just a single permission argument always performs security checks
  * within the context of the currently executing thread.
  * Sometimes a security check that should be made within a given context
@@ -205,7 +205,7 @@
  * java.lang.Object) checkPermission}
  * method that includes a context argument are provided
  * for this situation. The
- * <code>getSecurityContext</code> method returns a "snapshot"
+ * {@code getSecurityContext} method returns a "snapshot"
  * of the current calling context. (The default implementation
  * returns an AccessControlContext object.) A sample call is
  * the following:
@@ -217,14 +217,14 @@
  * </pre>
  *
  * <p>
- * The <code>checkPermission</code> method
+ * The {@code checkPermission} method
  * that takes a context object in addition to a permission
  * makes access decisions based on that context,
  * rather than on that of the current execution thread.
  * Code within a different context can thus call that method,
  * passing the permission and the
  * previously-saved context object. A sample call, using the
- * SecurityManager <code>sm</code> obtained as in the previous example,
+ * SecurityManager {@code sm} obtained as in the previous example,
  * is the following:
  *
  * <pre>
@@ -234,21 +234,21 @@
  * <p>Permissions fall into these categories: File, Socket, Net,
  * Security, Runtime, Property, AWT, Reflect, and Serializable.
  * The classes managing these various
- * permission categories are <code>java.io.FilePermission</code>,
- * <code>java.net.SocketPermission</code>,
- * <code>java.net.NetPermission</code>,
- * <code>java.security.SecurityPermission</code>,
- * <code>java.lang.RuntimePermission</code>,
- * <code>java.util.PropertyPermission</code>,
- * <code>java.awt.AWTPermission</code>,
- * <code>java.lang.reflect.ReflectPermission</code>, and
- * <code>java.io.SerializablePermission</code>.
+ * permission categories are {@code java.io.FilePermission},
+ * {@code java.net.SocketPermission},
+ * {@code java.net.NetPermission},
+ * {@code java.security.SecurityPermission},
+ * {@code java.lang.RuntimePermission},
+ * {@code java.util.PropertyPermission},
+ * {@code java.awt.AWTPermission},
+ * {@code java.lang.reflect.ReflectPermission}, and
+ * {@code java.io.SerializablePermission}.
  *
  * <p>All but the first two (FilePermission and SocketPermission) are
- * subclasses of <code>java.security.BasicPermission</code>, which itself
+ * subclasses of {@code java.security.BasicPermission}, which itself
  * is an abstract subclass of the
  * top-level class for permissions, which is
- * <code>java.security.Permission</code>. BasicPermission defines the
+ * {@code java.security.Permission}. BasicPermission defines the
  * functionality needed for all permissions that contain a name
  * that follows the hierarchical property naming convention
  * (for example, "exitVM", "setFactory", "queuePrintJob", etc).
@@ -259,16 +259,16 @@
  *
  * <p>FilePermission and SocketPermission are subclasses of the
  * top-level class for permissions
- * (<code>java.security.Permission</code>). Classes like these
+ * ({@code java.security.Permission}). Classes like these
  * that have a more complicated name syntax than that used by
  * BasicPermission subclass directly from Permission rather than from
  * BasicPermission. For example,
- * for a <code>java.io.FilePermission</code> object, the permission name is
+ * for a {@code java.io.FilePermission} object, the permission name is
  * the path name of a file (or directory).
  *
  * <p>Some of the permission classes have an "actions" list that tells
  * the actions that are permitted for the object.  For example,
- * for a <code>java.io.FilePermission</code> object, the actions list
+ * for a {@code java.io.FilePermission} object, the actions list
  * (such as "read, write") specifies which actions are granted for the
  * specified file (or for files in the specified directory).
  *
@@ -276,7 +276,7 @@
  * ones that contain a name but no actions list; you either have the
  * named permission or you don't.
  *
- * <p>Note: There is also a <code>java.security.AllPermission</code>
+ * <p>Note: There is also a {@code java.security.AllPermission}
  * permission that implies all permissions. It exists to simplify the work
  * of system administrators who might need to perform multiple
  * tasks that require all (or numerous) permissions.
@@ -285,7 +285,7 @@
  * Permissions in the Java Development Kit (JDK)}
  * for permission-related information.
  * This document includes a table listing the various SecurityManager
- * <code>check</code> methods and the permission(s) the default
+ * {@code check} methods and the permission(s) the default
  * implementation of each such method requires.
  * It also contains a table of the methods
  * that require permissions, and for each such method tells
@@ -322,17 +322,17 @@
     private boolean initialized = false;
 
     /**
-     * Constructs a new <code>SecurityManager</code>.
+     * Constructs a new {@code SecurityManager}.
      *
      * <p> If there is a security manager already installed, this method first
-     * calls the security manager's <code>checkPermission</code> method
-     * with the <code>RuntimePermission("createSecurityManager")</code>
+     * calls the security manager's {@code checkPermission} method
+     * with the {@code RuntimePermission("createSecurityManager")}
      * permission to ensure the calling thread has permission to create a new
      * security manager.
-     * This may result in throwing a <code>SecurityException</code>.
+     * This may result in throwing a {@code SecurityException}.
      *
      * @throws     java.lang.SecurityException if a security manager already
-     *             exists and its <code>checkPermission</code> method
+     *             exists and its {@code checkPermission} method
      *             doesn't allow creation of a new security manager.
      * @see        java.lang.System#getSecurityManager()
      * @see        #checkPermission(java.security.Permission) checkPermission
@@ -355,8 +355,8 @@
      * Returns the current execution stack as an array of classes.
      * <p>
      * The length of the array is the number of methods on the execution
-     * stack. The element at index <code>0</code> is the class of the
-     * currently executing method, the element at index <code>1</code> is
+     * stack. The element at index {@code 0} is the class of the
+     * currently executing method, the element at index {@code 1} is
      * the class of that method's caller, and so on.
      *
      * @return  the execution stack.
@@ -366,15 +366,15 @@
     /**
      * Creates an object that encapsulates the current execution
      * environment. The result of this method is used, for example, by the
-     * three-argument <code>checkConnect</code> method and by the
-     * two-argument <code>checkRead</code> method.
+     * three-argument {@code checkConnect} method and by the
+     * two-argument {@code checkRead} method.
      * These methods are needed because a trusted method may be called
      * on to read a file or open a socket on behalf of another method.
      * The trusted method needs to determine if the other (possibly
      * untrusted) method would be allowed to perform the operation on its
      * own.
      * <p> The default implementation of this method is to return
-     * an <code>AccessControlContext</code> object.
+     * an {@code AccessControlContext} object.
      *
      * @return  an implementation-dependent object that encapsulates
      *          sufficient information about the current execution environment
@@ -390,18 +390,18 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the requested
+     * Throws a {@code SecurityException} if the requested
      * access, specified by the given permission, is not permitted based
      * on the security policy currently in effect.
      * <p>
-     * This method calls <code>AccessController.checkPermission</code>
+     * This method calls {@code AccessController.checkPermission}
      * with the given permission.
      *
      * @param     perm   the requested permission.
      * @throws    SecurityException if access is not permitted based on
      *            the current security policy.
      * @throws    NullPointerException if the permission argument is
-     *            <code>null</code>.
+     *            {@code null}.
      * @since     1.2
      */
     public void checkPermission(Permission perm) {
@@ -409,32 +409,32 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the
+     * Throws a {@code SecurityException} if the
      * specified security context is denied access to the resource
      * specified by the given permission.
      * The context must be a security
      * context returned by a previous call to
-     * <code>getSecurityContext</code> and the access control
+     * {@code getSecurityContext} and the access control
      * decision is based upon the configured security policy for
      * that security context.
      * <p>
-     * If <code>context</code> is an instance of
-     * <code>AccessControlContext</code> then the
-     * <code>AccessControlContext.checkPermission</code> method is
+     * If {@code context} is an instance of
+     * {@code AccessControlContext} then the
+     * {@code AccessControlContext.checkPermission} method is
      * invoked with the specified permission.
      * <p>
-     * If <code>context</code> is not an instance of
-     * <code>AccessControlContext</code> then a
-     * <code>SecurityException</code> is thrown.
+     * If {@code context} is not an instance of
+     * {@code AccessControlContext} then a
+     * {@code SecurityException} is thrown.
      *
      * @param      perm      the specified permission
      * @param      context   a system-dependent security context.
      * @throws     SecurityException  if the specified security context
-     *             is not an instance of <code>AccessControlContext</code>
-     *             (e.g., is <code>null</code>), or is denied access to the
+     *             is not an instance of {@code AccessControlContext}
+     *             (e.g., is {@code null}), or is denied access to the
      *             resource specified by the given permission.
      * @throws     NullPointerException if the permission argument is
-     *             <code>null</code>.
+     *             {@code null}.
      * @see        java.lang.SecurityManager#getSecurityContext()
      * @see java.security.AccessControlContext#checkPermission(java.security.Permission)
      * @since      1.2
@@ -448,15 +448,15 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the
+     * Throws a {@code SecurityException} if the
      * calling thread is not allowed to create a new class loader.
      * <p>
-     * This method calls <code>checkPermission</code> with the
-     * <code>RuntimePermission("createClassLoader")</code>
+     * This method calls {@code checkPermission} with the
+     * {@code RuntimePermission("createClassLoader")}
      * permission.
      * <p>
      * If you override this method, then you should make a call to
-     * <code>super.checkCreateClassLoader</code>
+     * {@code super.checkCreateClassLoader}
      * at the point the overridden method would normally throw an
      * exception.
      *
@@ -486,31 +486,31 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the
+     * Throws a {@code SecurityException} if the
      * calling thread is not allowed to modify the thread argument.
      * <p>
      * This method is invoked for the current security manager by the
-     * <code>stop</code>, <code>suspend</code>, <code>resume</code>,
-     * <code>setPriority</code>, <code>setName</code>, and
-     * <code>setDaemon</code> methods of class <code>Thread</code>.
+     * {@code stop}, {@code suspend}, {@code resume},
+     * {@code setPriority}, {@code setName}, and
+     * {@code setDaemon} methods of class {@code Thread}.
      * <p>
      * If the thread argument is a system thread (belongs to
-     * the thread group with a <code>null</code> parent) then
-     * this method calls <code>checkPermission</code> with the
-     * <code>RuntimePermission("modifyThread")</code> permission.
+     * the thread group with a {@code null} parent) then
+     * this method calls {@code checkPermission} with the
+     * {@code RuntimePermission("modifyThread")} permission.
      * If the thread argument is <i>not</i> a system thread,
      * this method just returns silently.
      * <p>
      * Applications that want a stricter policy should override this
      * method. If this method is overridden, the method that overrides
      * it should additionally check to see if the calling thread has the
-     * <code>RuntimePermission("modifyThread")</code> permission, and
+     * {@code RuntimePermission("modifyThread")} permission, and
      * if so, return silently. This is to ensure that code granted
      * that permission (such as the JDK itself) is allowed to
      * manipulate any thread.
      * <p>
      * If this method is overridden, then
-     * <code>super.checkAccess</code> should
+     * {@code super.checkAccess} should
      * be called by the first statement in the overridden method, or the
      * equivalent security check should be placed in the overridden method.
      *
@@ -518,7 +518,7 @@
      * @throws     SecurityException  if the calling thread does not have
      *             permission to modify the thread.
      * @throws     NullPointerException if the thread argument is
-     *             <code>null</code>.
+     *             {@code null}.
      * @see        java.lang.Thread#resume() resume
      * @see        java.lang.Thread#setDaemon(boolean) setDaemon
      * @see        java.lang.Thread#setName(java.lang.String) setName
@@ -538,32 +538,32 @@
         }
     }
     /**
-     * Throws a <code>SecurityException</code> if the
+     * Throws a {@code SecurityException} if the
      * calling thread is not allowed to modify the thread group argument.
      * <p>
      * This method is invoked for the current security manager when a
      * new child thread or child thread group is created, and by the
-     * <code>setDaemon</code>, <code>setMaxPriority</code>,
-     * <code>stop</code>, <code>suspend</code>, <code>resume</code>, and
-     * <code>destroy</code> methods of class <code>ThreadGroup</code>.
+     * {@code setDaemon}, {@code setMaxPriority},
+     * {@code stop}, {@code suspend}, {@code resume}, and
+     * {@code destroy} methods of class {@code ThreadGroup}.
      * <p>
      * If the thread group argument is the system thread group (
-     * has a <code>null</code> parent) then
-     * this method calls <code>checkPermission</code> with the
-     * <code>RuntimePermission("modifyThreadGroup")</code> permission.
+     * has a {@code null} parent) then
+     * this method calls {@code checkPermission} with the
+     * {@code RuntimePermission("modifyThreadGroup")} permission.
      * If the thread group argument is <i>not</i> the system thread group,
      * this method just returns silently.
      * <p>
      * Applications that want a stricter policy should override this
      * method. If this method is overridden, the method that overrides
      * it should additionally check to see if the calling thread has the
-     * <code>RuntimePermission("modifyThreadGroup")</code> permission, and
+     * {@code RuntimePermission("modifyThreadGroup")} permission, and
      * if so, return silently. This is to ensure that code granted
      * that permission (such as the JDK itself) is allowed to
      * manipulate any thread.
      * <p>
      * If this method is overridden, then
-     * <code>super.checkAccess</code> should
+     * {@code super.checkAccess} should
      * be called by the first statement in the overridden method, or the
      * equivalent security check should be placed in the overridden method.
      *
@@ -571,7 +571,7 @@
      * @throws     SecurityException  if the calling thread does not have
      *             permission to modify the thread group.
      * @throws     NullPointerException if the thread group argument is
-     *             <code>null</code>.
+     *             {@code null}.
      * @see        java.lang.ThreadGroup#destroy() destroy
      * @see        java.lang.ThreadGroup#resume() resume
      * @see        java.lang.ThreadGroup#setDaemon(boolean) setDaemon
@@ -592,20 +592,20 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the
+     * Throws a {@code SecurityException} if the
      * calling thread is not allowed to cause the Java Virtual Machine to
      * halt with the specified status code.
      * <p>
      * This method is invoked for the current security manager by the
-     * <code>exit</code> method of class <code>Runtime</code>. A status
-     * of <code>0</code> indicates success; other values indicate various
+     * {@code exit} method of class {@code Runtime}. A status
+     * of {@code 0} indicates success; other values indicate various
      * errors.
      * <p>
-     * This method calls <code>checkPermission</code> with the
-     * <code>RuntimePermission("exitVM."+status)</code> permission.
+     * This method calls {@code checkPermission} with the
+     * {@code RuntimePermission("exitVM."+status)} permission.
      * <p>
      * If you override this method, then you should make a call to
-     * <code>super.checkExit</code>
+     * {@code super.checkExit}
      * at the point the overridden method would normally throw an
      * exception.
      *
@@ -621,28 +621,28 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the
+     * Throws a {@code SecurityException} if the
      * calling thread is not allowed to create a subprocess.
      * <p>
      * This method is invoked for the current security manager by the
-     * <code>exec</code> methods of class <code>Runtime</code>.
+     * {@code exec} methods of class {@code Runtime}.
      * <p>
-     * This method calls <code>checkPermission</code> with the
-     * <code>FilePermission(cmd,"execute")</code> permission
+     * This method calls {@code checkPermission} with the
+     * {@code FilePermission(cmd,"execute")} permission
      * if cmd is an absolute path, otherwise it calls
-     * <code>checkPermission</code> with
+     * {@code checkPermission} with
      * <code>FilePermission("&lt;&lt;ALL FILES&gt;&gt;","execute")</code>.
      * <p>
      * If you override this method, then you should make a call to
-     * <code>super.checkExec</code>
+     * {@code super.checkExec}
      * at the point the overridden method would normally throw an
      * exception.
      *
      * @param      cmd   the specified system command.
      * @throws     SecurityException if the calling thread does not have
      *             permission to create a subprocess.
-     * @throws     NullPointerException if the <code>cmd</code> argument is
-     *             <code>null</code>.
+     * @throws     NullPointerException if the {@code cmd} argument is
+     *             {@code null}.
      * @see     java.lang.Runtime#exec(java.lang.String)
      * @see     java.lang.Runtime#exec(java.lang.String, java.lang.String[])
      * @see     java.lang.Runtime#exec(java.lang.String[])
@@ -661,28 +661,28 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the
+     * Throws a {@code SecurityException} if the
      * calling thread is not allowed to dynamic link the library code
      * specified by the string argument file. The argument is either a
      * simple library name or a complete filename.
      * <p>
      * This method is invoked for the current security manager by
-     * methods <code>load</code> and <code>loadLibrary</code> of class
-     * <code>Runtime</code>.
+     * methods {@code load} and {@code loadLibrary} of class
+     * {@code Runtime}.
      * <p>
-     * This method calls <code>checkPermission</code> with the
-     * <code>RuntimePermission("loadLibrary."+lib)</code> permission.
+     * This method calls {@code checkPermission} with the
+     * {@code RuntimePermission("loadLibrary."+lib)} permission.
      * <p>
      * If you override this method, then you should make a call to
-     * <code>super.checkLink</code>
+     * {@code super.checkLink}
      * at the point the overridden method would normally throw an
      * exception.
      *
      * @param      lib   the name of the library.
      * @throws     SecurityException if the calling thread does not have
      *             permission to dynamically link the library.
-     * @throws     NullPointerException if the <code>lib</code> argument is
-     *             <code>null</code>.
+     * @throws     NullPointerException if the {@code lib} argument is
+     *             {@code null}.
      * @see        java.lang.Runtime#load(java.lang.String)
      * @see        java.lang.Runtime#loadLibrary(java.lang.String)
      * @see        #checkPermission(java.security.Permission) checkPermission
@@ -695,16 +695,16 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the
+     * Throws a {@code SecurityException} if the
      * calling thread is not allowed to read from the specified file
      * descriptor.
      * <p>
-     * This method calls <code>checkPermission</code> with the
-     * <code>RuntimePermission("readFileDescriptor")</code>
+     * This method calls {@code checkPermission} with the
+     * {@code RuntimePermission("readFileDescriptor")}
      * permission.
      * <p>
      * If you override this method, then you should make a call to
-     * <code>super.checkRead</code>
+     * {@code super.checkRead}
      * at the point the overridden method would normally throw an
      * exception.
      *
@@ -712,7 +712,7 @@
      * @throws     SecurityException  if the calling thread does not have
      *             permission to access the specified file descriptor.
      * @throws     NullPointerException if the file descriptor argument is
-     *             <code>null</code>.
+     *             {@code null}.
      * @see        java.io.FileDescriptor
      * @see        #checkPermission(java.security.Permission) checkPermission
      */
@@ -724,23 +724,23 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the
+     * Throws a {@code SecurityException} if the
      * calling thread is not allowed to read the file specified by the
      * string argument.
      * <p>
-     * This method calls <code>checkPermission</code> with the
-     * <code>FilePermission(file,"read")</code> permission.
+     * This method calls {@code checkPermission} with the
+     * {@code FilePermission(file,"read")} permission.
      * <p>
      * If you override this method, then you should make a call to
-     * <code>super.checkRead</code>
+     * {@code super.checkRead}
      * at the point the overridden method would normally throw an
      * exception.
      *
      * @param      file   the system-dependent file name.
      * @throws     SecurityException if the calling thread does not have
      *             permission to access the specified file.
-     * @throws     NullPointerException if the <code>file</code> argument is
-     *             <code>null</code>.
+     * @throws     NullPointerException if the {@code file} argument is
+     *             {@code null}.
      * @see        #checkPermission(java.security.Permission) checkPermission
      */
     public void checkRead(String file) {
@@ -749,32 +749,32 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the
+     * Throws a {@code SecurityException} if the
      * specified security context is not allowed to read the file
      * specified by the string argument. The context must be a security
      * context returned by a previous call to
-     * <code>getSecurityContext</code>.
-     * <p> If <code>context</code> is an instance of
-     * <code>AccessControlContext</code> then the
-     * <code>AccessControlContext.checkPermission</code> method will
-     * be invoked with the <code>FilePermission(file,"read")</code> permission.
-     * <p> If <code>context</code> is not an instance of
-     * <code>AccessControlContext</code> then a
-     * <code>SecurityException</code> is thrown.
+     * {@code getSecurityContext}.
+     * <p> If {@code context} is an instance of
+     * {@code AccessControlContext} then the
+     * {@code AccessControlContext.checkPermission} method will
+     * be invoked with the {@code FilePermission(file,"read")} permission.
+     * <p> If {@code context} is not an instance of
+     * {@code AccessControlContext} then a
+     * {@code SecurityException} is thrown.
      * <p>
      * If you override this method, then you should make a call to
-     * <code>super.checkRead</code>
+     * {@code super.checkRead}
      * at the point the overridden method would normally throw an
      * exception.
      *
      * @param      file      the system-dependent filename.
      * @param      context   a system-dependent security context.
      * @throws     SecurityException  if the specified security context
-     *             is not an instance of <code>AccessControlContext</code>
-     *             (e.g., is <code>null</code>), or does not have permission
+     *             is not an instance of {@code AccessControlContext}
+     *             (e.g., is {@code null}), or does not have permission
      *             to read the specified file.
-     * @throws     NullPointerException if the <code>file</code> argument is
-     *             <code>null</code>.
+     * @throws     NullPointerException if the {@code file} argument is
+     *             {@code null}.
      * @see        java.lang.SecurityManager#getSecurityContext()
      * @see        java.security.AccessControlContext#checkPermission(java.security.Permission)
      */
@@ -785,16 +785,16 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the
+     * Throws a {@code SecurityException} if the
      * calling thread is not allowed to write to the specified file
      * descriptor.
      * <p>
-     * This method calls <code>checkPermission</code> with the
-     * <code>RuntimePermission("writeFileDescriptor")</code>
+     * This method calls {@code checkPermission} with the
+     * {@code RuntimePermission("writeFileDescriptor")}
      * permission.
      * <p>
      * If you override this method, then you should make a call to
-     * <code>super.checkWrite</code>
+     * {@code super.checkWrite}
      * at the point the overridden method would normally throw an
      * exception.
      *
@@ -802,7 +802,7 @@
      * @throws    SecurityException  if the calling thread does not have
      *             permission to access the specified file descriptor.
      * @throws     NullPointerException if the file descriptor argument is
-     *             <code>null</code>.
+     *             {@code null}.
      * @see        java.io.FileDescriptor
      * @see        #checkPermission(java.security.Permission) checkPermission
      */
@@ -815,23 +815,23 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the
+     * Throws a {@code SecurityException} if the
      * calling thread is not allowed to write to the file specified by
      * the string argument.
      * <p>
-     * This method calls <code>checkPermission</code> with the
-     * <code>FilePermission(file,"write")</code> permission.
+     * This method calls {@code checkPermission} with the
+     * {@code FilePermission(file,"write")} permission.
      * <p>
      * If you override this method, then you should make a call to
-     * <code>super.checkWrite</code>
+     * {@code super.checkWrite}
      * at the point the overridden method would normally throw an
      * exception.
      *
      * @param      file   the system-dependent filename.
      * @throws     SecurityException  if the calling thread does not
      *             have permission to access the specified file.
-     * @throws     NullPointerException if the <code>file</code> argument is
-     *             <code>null</code>.
+     * @throws     NullPointerException if the {@code file} argument is
+     *             {@code null}.
      * @see        #checkPermission(java.security.Permission) checkPermission
      */
     public void checkWrite(String file) {
@@ -840,25 +840,25 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the
+     * Throws a {@code SecurityException} if the
      * calling thread is not allowed to delete the specified file.
      * <p>
      * This method is invoked for the current security manager by the
-     * <code>delete</code> method of class <code>File</code>.
+     * {@code delete} method of class {@code File}.
      * <p>
-     * This method calls <code>checkPermission</code> with the
-     * <code>FilePermission(file,"delete")</code> permission.
+     * This method calls {@code checkPermission} with the
+     * {@code FilePermission(file,"delete")} permission.
      * <p>
      * If you override this method, then you should make a call to
-     * <code>super.checkDelete</code>
+     * {@code super.checkDelete}
      * at the point the overridden method would normally throw an
      * exception.
      *
      * @param      file   the system-dependent filename.
      * @throws     SecurityException if the calling thread does not
      *             have permission to delete the file.
-     * @throws     NullPointerException if the <code>file</code> argument is
-     *             <code>null</code>.
+     * @throws     NullPointerException if the {@code file} argument is
+     *             {@code null}.
      * @see        java.io.File#delete()
      * @see        #checkPermission(java.security.Permission) checkPermission
      */
@@ -868,22 +868,22 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the
+     * Throws a {@code SecurityException} if the
      * calling thread is not allowed to open a socket connection to the
      * specified host and port number.
      * <p>
-     * A port number of <code>-1</code> indicates that the calling
+     * A port number of {@code -1} indicates that the calling
      * method is attempting to determine the IP address of the specified
      * host name.
      * <p>
-     * This method calls <code>checkPermission</code> with the
-     * <code>SocketPermission(host+":"+port,"connect")</code> permission if
+     * This method calls {@code checkPermission} with the
+     * {@code SocketPermission(host+":"+port,"connect")} permission if
      * the port is not equal to -1. If the port is equal to -1, then
-     * it calls <code>checkPermission</code> with the
-     * <code>SocketPermission(host,"resolve")</code> permission.
+     * it calls {@code checkPermission} with the
+     * {@code SocketPermission(host,"resolve")} permission.
      * <p>
      * If you override this method, then you should make a call to
-     * <code>super.checkConnect</code>
+     * {@code super.checkConnect}
      * at the point the overridden method would normally throw an
      * exception.
      *
@@ -891,9 +891,9 @@
      * @param      port   the protocol port to connect to.
      * @throws     SecurityException  if the calling thread does not have
      *             permission to open a socket connection to the specified
-     *               <code>host</code> and <code>port</code>.
-     * @throws     NullPointerException if the <code>host</code> argument is
-     *             <code>null</code>.
+     *               {@code host} and {@code port}.
+     * @throws     NullPointerException if the {@code host} argument is
+     *             {@code null}.
      * @see        #checkPermission(java.security.Permission) checkPermission
      */
     public void checkConnect(String host, int port) {
@@ -913,28 +913,28 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the
+     * Throws a {@code SecurityException} if the
      * specified security context is not allowed to open a socket
      * connection to the specified host and port number.
      * <p>
-     * A port number of <code>-1</code> indicates that the calling
+     * A port number of {@code -1} indicates that the calling
      * method is attempting to determine the IP address of the specified
      * host name.
-     * <p> If <code>context</code> is not an instance of
-     * <code>AccessControlContext</code> then a
-     * <code>SecurityException</code> is thrown.
+     * <p> If {@code context} is not an instance of
+     * {@code AccessControlContext} then a
+     * {@code SecurityException} is thrown.
      * <p>
      * Otherwise, the port number is checked. If it is not equal
-     * to -1, the <code>context</code>'s <code>checkPermission</code>
+     * to -1, the {@code context}'s {@code checkPermission}
      * method is called with a
-     * <code>SocketPermission(host+":"+port,"connect")</code> permission.
+     * {@code SocketPermission(host+":"+port,"connect")} permission.
      * If the port is equal to -1, then
-     * the <code>context</code>'s <code>checkPermission</code> method
+     * the {@code context}'s {@code checkPermission} method
      * is called with a
-     * <code>SocketPermission(host,"resolve")</code> permission.
+     * {@code SocketPermission(host,"resolve")} permission.
      * <p>
      * If you override this method, then you should make a call to
-     * <code>super.checkConnect</code>
+     * {@code super.checkConnect}
      * at the point the overridden method would normally throw an
      * exception.
      *
@@ -942,12 +942,12 @@
      * @param      port      the protocol port to connect to.
      * @param      context   a system-dependent security context.
      * @throws     SecurityException if the specified security context
-     *             is not an instance of <code>AccessControlContext</code>
-     *             (e.g., is <code>null</code>), or does not have permission
+     *             is not an instance of {@code AccessControlContext}
+     *             (e.g., is {@code null}), or does not have permission
      *             to open a socket connection to the specified
-     *             <code>host</code> and <code>port</code>.
-     * @throws     NullPointerException if the <code>host</code> argument is
-     *             <code>null</code>.
+     *             {@code host} and {@code port}.
+     * @throws     NullPointerException if the {@code host} argument is
+     *             {@code null}.
      * @see        java.lang.SecurityManager#getSecurityContext()
      * @see        java.security.AccessControlContext#checkPermission(java.security.Permission)
      */
@@ -969,15 +969,15 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the
+     * Throws a {@code SecurityException} if the
      * calling thread is not allowed to wait for a connection request on
      * the specified local port number.
      * <p>
-     * This method calls <code>checkPermission</code> with the
-     * <code>SocketPermission("localhost:"+port,"listen")</code>.
+     * This method calls {@code checkPermission} with the
+     * {@code SocketPermission("localhost:"+port,"listen")}.
      * <p>
      * If you override this method, then you should make a call to
-     * <code>super.checkListen</code>
+     * {@code super.checkListen}
      * at the point the overridden method would normally throw an
      * exception.
      *
@@ -992,18 +992,18 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the
+     * Throws a {@code SecurityException} if the
      * calling thread is not permitted to accept a socket connection from
      * the specified host and port number.
      * <p>
      * This method is invoked for the current security manager by the
-     * <code>accept</code> method of class <code>ServerSocket</code>.
+     * {@code accept} method of class {@code ServerSocket}.
      * <p>
-     * This method calls <code>checkPermission</code> with the
-     * <code>SocketPermission(host+":"+port,"accept")</code> permission.
+     * This method calls {@code checkPermission} with the
+     * {@code SocketPermission(host+":"+port,"accept")} permission.
      * <p>
      * If you override this method, then you should make a call to
-     * <code>super.checkAccept</code>
+     * {@code super.checkAccept}
      * at the point the overridden method would normally throw an
      * exception.
      *
@@ -1011,8 +1011,8 @@
      * @param      port   the port number of the socket connection.
      * @throws     SecurityException  if the calling thread does not have
      *             permission to accept the connection.
-     * @throws     NullPointerException if the <code>host</code> argument is
-     *             <code>null</code>.
+     * @throws     NullPointerException if the {@code host} argument is
+     *             {@code null}.
      * @see        java.net.ServerSocket#accept()
      * @see        #checkPermission(java.security.Permission) checkPermission
      */
@@ -1028,16 +1028,16 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the
+     * Throws a {@code SecurityException} if the
      * calling thread is not allowed to use
      * (join/leave/send/receive) IP multicast.
      * <p>
-     * This method calls <code>checkPermission</code> with the
+     * This method calls {@code checkPermission} with the
      * <code>java.net.SocketPermission(maddr.getHostAddress(),
      * "accept,connect")</code> permission.
      * <p>
      * If you override this method, then you should make a call to
-     * <code>super.checkMulticast</code>
+     * {@code super.checkMulticast}
      * at the point the overridden method would normally throw an
      * exception.
      *
@@ -1045,7 +1045,7 @@
      * @throws     SecurityException  if the calling thread is not allowed to
      *  use (join/leave/send/receive) IP multicast.
      * @throws     NullPointerException if the address argument is
-     *             <code>null</code>.
+     *             {@code null}.
      * @since      1.1
      * @see        #checkPermission(java.security.Permission) checkPermission
      */
@@ -1059,16 +1059,16 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the
+     * Throws a {@code SecurityException} if the
      * calling thread is not allowed to use
      * (join/leave/send/receive) IP multicast.
      * <p>
-     * This method calls <code>checkPermission</code> with the
+     * This method calls {@code checkPermission} with the
      * <code>java.net.SocketPermission(maddr.getHostAddress(),
      * "accept,connect")</code> permission.
      * <p>
      * If you override this method, then you should make a call to
-     * <code>super.checkMulticast</code>
+     * {@code super.checkMulticast}
      * at the point the overridden method would normally throw an
      * exception.
      *
@@ -1079,7 +1079,7 @@
      * @throws     SecurityException  if the calling thread is not allowed to
      *  use (join/leave/send/receive) IP multicast.
      * @throws     NullPointerException if the address argument is
-     *             <code>null</code>.
+     *             {@code null}.
      * @since      1.1
      * @deprecated Use #checkPermission(java.security.Permission) instead
      * @see        #checkPermission(java.security.Permission) checkPermission
@@ -1095,18 +1095,18 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the
+     * Throws a {@code SecurityException} if the
      * calling thread is not allowed to access or modify the system
      * properties.
      * <p>
-     * This method is used by the <code>getProperties</code> and
-     * <code>setProperties</code> methods of class <code>System</code>.
+     * This method is used by the {@code getProperties} and
+     * {@code setProperties} methods of class {@code System}.
      * <p>
-     * This method calls <code>checkPermission</code> with the
-     * <code>PropertyPermission("*", "read,write")</code> permission.
+     * This method calls {@code checkPermission} with the
+     * {@code PropertyPermission("*", "read,write")} permission.
      * <p>
      * If you override this method, then you should make a call to
-     * <code>super.checkPropertiesAccess</code>
+     * {@code super.checkPropertiesAccess}
      * at the point the overridden method would normally throw an
      * exception.
      *
@@ -1122,18 +1122,18 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the
+     * Throws a {@code SecurityException} if the
      * calling thread is not allowed to access the system property with
-     * the specified <code>key</code> name.
+     * the specified {@code key} name.
      * <p>
-     * This method is used by the <code>getProperty</code> method of
-     * class <code>System</code>.
+     * This method is used by the {@code getProperty} method of
+     * class {@code System}.
      * <p>
-     * This method calls <code>checkPermission</code> with the
-     * <code>PropertyPermission(key, "read")</code> permission.
+     * This method calls {@code checkPermission} with the
+     * {@code PropertyPermission(key, "read")} permission.
      * <p>
      * If you override this method, then you should make a call to
-     * <code>super.checkPropertyAccess</code>
+     * {@code super.checkPropertyAccess}
      * at the point the overridden method would normally throw an
      * exception.
      *
@@ -1141,9 +1141,9 @@
      *
      * @throws     SecurityException  if the calling thread does not have
      *             permission to access the specified system property.
-     * @throws     NullPointerException if the <code>key</code> argument is
-     *             <code>null</code>.
-     * @throws     IllegalArgumentException if <code>key</code> is empty.
+     * @throws     NullPointerException if the {@code key} argument is
+     *             {@code null}.
+     * @throws     IllegalArgumentException if {@code key} is empty.
      *
      * @see        java.lang.System#getProperty(java.lang.String)
      * @see        #checkPermission(java.security.Permission) checkPermission
@@ -1154,15 +1154,15 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the
+     * Throws a {@code SecurityException} if the
      * calling thread is not allowed to initiate a print job request.
      * <p>
      * This method calls
-     * <code>checkPermission</code> with the
-     * <code>RuntimePermission("queuePrintJob")</code> permission.
+     * {@code checkPermission} with the
+     * {@code RuntimePermission("queuePrintJob")} permission.
      * <p>
      * If you override this method, then you should make a call to
-     * <code>super.checkPrintJobAccess</code>
+     * {@code super.checkPrintJobAccess}
      * at the point the overridden method would normally throw an
      * exception.
      *
@@ -1461,16 +1461,16 @@
     }
 
     /**
-     * Throws a <code>SecurityException</code> if the
+     * Throws a {@code SecurityException} if the
      * calling thread is not allowed to set the socket factory used by
-     * <code>ServerSocket</code> or <code>Socket</code>, or the stream
-     * handler factory used by <code>URL</code>.
+     * {@code ServerSocket} or {@code Socket}, or the stream
+     * handler factory used by {@code URL}.
      * <p>
-     * This method calls <code>checkPermission</code> with the
-     * <code>RuntimePermission("setFactory")</code> permission.
+     * This method calls {@code checkPermission} with the
+     * {@code RuntimePermission("setFactory")} permission.
      * <p>
      * If you override this method, then you should make a call to
-     * <code>super.checkSetFactory</code>
+     * {@code super.checkSetFactory}
      * at the point the overridden method would normally throw an
      * exception.
      *
@@ -1494,8 +1494,8 @@
      * <p> If the requested permission is allowed, this method returns
      * quietly. If denied, a SecurityException is raised.
      *
-     * <p> This method creates a <code>SecurityPermission</code> object for
-     * the given permission target name and calls <code>checkPermission</code>
+     * <p> This method creates a {@code SecurityPermission} object for
+     * the given permission target name and calls {@code checkPermission}
      * with it.
      *
      * <p> See the documentation for
@@ -1503,16 +1503,16 @@
      * a list of possible permission target names.
      *
      * <p> If you override this method, then you should make a call to
-     * <code>super.checkSecurityAccess</code>
+     * {@code super.checkSecurityAccess}
      * at the point the overridden method would normally throw an
      * exception.
      *
-     * @param target the target name of the <code>SecurityPermission</code>.
+     * @param target the target name of the {@code SecurityPermission}.
      *
      * @throws    SecurityException if the calling thread does not have
      * permission for the requested access.
-     * @throws    NullPointerException if <code>target</code> is null.
-     * @throws    IllegalArgumentException if <code>target</code> is empty.
+     * @throws    NullPointerException if {@code target} is null.
+     * @throws    IllegalArgumentException if {@code target} is empty.
      *
      * @since   1.1
      * @see        #checkPermission(java.security.Permission) checkPermission
--- a/src/java.base/share/classes/java/lang/StackOverflowError.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/StackOverflowError.java	Wed Sep 25 22:40:41 2019 +0200
@@ -38,14 +38,14 @@
     private static final long serialVersionUID = 8609175038441759607L;
 
     /**
-     * Constructs a <code>StackOverflowError</code> with no detail message.
+     * Constructs a {@code StackOverflowError} with no detail message.
      */
     public StackOverflowError() {
         super();
     }
 
     /**
-     * Constructs a <code>StackOverflowError</code> with the specified
+     * Constructs a {@code StackOverflowError} with the specified
      * detail message.
      *
      * @param   s   the detail message.
--- a/src/java.base/share/classes/java/lang/UnknownError.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/UnknownError.java	Wed Sep 25 22:40:41 2019 +0200
@@ -38,14 +38,14 @@
     private static final long serialVersionUID = 2524784860676771849L;
 
     /**
-     * Constructs an <code>UnknownError</code> with no detail message.
+     * Constructs an {@code UnknownError} with no detail message.
      */
     public UnknownError() {
         super();
     }
 
     /**
-     * Constructs an <code>UnknownError</code> with the specified detail
+     * Constructs an {@code UnknownError} with the specified detail
      * message.
      *
      * @param   s   the detail message.
--- a/src/java.base/share/classes/java/lang/UnsatisfiedLinkError.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/UnsatisfiedLinkError.java	Wed Sep 25 22:40:41 2019 +0200
@@ -27,7 +27,7 @@
 
 /**
  * Thrown if the Java Virtual Machine cannot find an appropriate
- * native-language definition of a method declared <code>native</code>.
+ * native-language definition of a method declared {@code native}.
  *
  * @author unascribed
  * @see     java.lang.Runtime
@@ -39,14 +39,14 @@
     private static final long serialVersionUID = -4019343241616879428L;
 
     /**
-     * Constructs an <code>UnsatisfiedLinkError</code> with no detail message.
+     * Constructs an {@code UnsatisfiedLinkError} with no detail message.
      */
     public UnsatisfiedLinkError() {
         super();
     }
 
     /**
-     * Constructs an <code>UnsatisfiedLinkError</code> with the
+     * Constructs an {@code UnsatisfiedLinkError} with the
      * specified detail message.
      *
      * @param   s   the detail message.
--- a/src/java.base/share/classes/java/lang/UnsupportedClassVersionError.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/UnsupportedClassVersionError.java	Wed Sep 25 22:40:41 2019 +0200
@@ -38,7 +38,7 @@
     private static final long serialVersionUID = -7123279212883497373L;
 
     /**
-     * Constructs a <code>UnsupportedClassVersionError</code>
+     * Constructs a {@code UnsupportedClassVersionError}
      * with no detail message.
      */
     public UnsupportedClassVersionError() {
@@ -46,7 +46,7 @@
     }
 
     /**
-     * Constructs a <code>UnsupportedClassVersionError</code> with
+     * Constructs a {@code UnsupportedClassVersionError} with
      * the specified detail message.
      *
      * @param   s   the detail message.
--- a/src/java.base/share/classes/java/lang/UnsupportedOperationException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/UnsupportedOperationException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -56,7 +56,7 @@
      * Constructs a new exception with the specified detail message and
      * cause.
      *
-     * <p>Note that the detail message associated with <code>cause</code> is
+     * <p>Note that the detail message associated with {@code cause} is
      * <i>not</i> automatically incorporated in this exception's detail
      * message.
      *
--- a/src/java.base/share/classes/java/lang/VerifyError.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/VerifyError.java	Wed Sep 25 22:40:41 2019 +0200
@@ -39,14 +39,14 @@
     private static final long serialVersionUID = 7001962396098498785L;
 
     /**
-     * Constructs an <code>VerifyError</code> with no detail message.
+     * Constructs an {@code VerifyError} with no detail message.
      */
     public VerifyError() {
         super();
     }
 
     /**
-     * Constructs an <code>VerifyError</code> with the specified detail message.
+     * Constructs an {@code VerifyError} with the specified detail message.
      *
      * @param   s   the detail message.
      */
--- a/src/java.base/share/classes/java/lang/VirtualMachineError.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/VirtualMachineError.java	Wed Sep 25 22:40:41 2019 +0200
@@ -38,14 +38,14 @@
     private static final long serialVersionUID = 4161983926571568670L;
 
     /**
-     * Constructs a <code>VirtualMachineError</code> with no detail message.
+     * Constructs a {@code VirtualMachineError} with no detail message.
      */
     public VirtualMachineError() {
         super();
     }
 
     /**
-     * Constructs a <code>VirtualMachineError</code> with the specified
+     * Constructs a {@code VirtualMachineError} with the specified
      * detail message.
      *
      * @param   message   the detail message.
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1042,7 +1042,7 @@
      * <td style="text-align:center">IAE</td>
      * </tr>
      * <tr>
-     * <td>{@code ANY.in(X)}, for inaccessible <code>X</code></td>
+     * <td>{@code ANY.in(X)}, for inaccessible {@code X}</td>
      * <td></td>
      * <td></td>
      * <td></td>
--- a/src/java.base/share/classes/java/lang/invoke/package-info.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/invoke/package-info.java	Wed Sep 25 22:40:41 2019 +0200
@@ -216,22 +216,22 @@
  * <tbody>
  * <tr><th scope="row" style="font-weight:normal; vertical-align:top">*</th><td>
  *     <ul style="list-style:none; padding-left: 0; margin:0">
- *     <li><code>CallSite bootstrap(Lookup caller, String name, MethodType type, Object... args)</code>
- *     <li><code>CallSite bootstrap(Object... args)</code>
- *     <li><code>CallSite bootstrap(Object caller, Object... nameAndTypeWithArgs)</code>
+ *     <li>{@code CallSite bootstrap(Lookup caller, String name, MethodType type, Object... args)}
+ *     <li>{@code CallSite bootstrap(Object... args)}
+ *     <li>{@code CallSite bootstrap(Object caller, Object... nameAndTypeWithArgs)}
  *     </ul></td></tr>
  * <tr><th scope="row" style="font-weight:normal; vertical-align:top">0</th><td>
  *     <ul style="list-style:none; padding-left: 0; margin:0">
- *     <li><code>CallSite bootstrap(Lookup caller, String name, MethodType type)</code>
- *     <li><code>CallSite bootstrap(Lookup caller, Object... nameAndType)</code>
+ *     <li>{@code CallSite bootstrap(Lookup caller, String name, MethodType type)}
+ *     <li>{@code CallSite bootstrap(Lookup caller, Object... nameAndType)}
  *     </ul></td></tr>
  * <tr><th scope="row" style="font-weight:normal; vertical-align:top">1</th><td>
- *     <code>CallSite bootstrap(Lookup caller, String name, MethodType type, Object arg)</code></td></tr>
+ *     {@code CallSite bootstrap(Lookup caller, String name, MethodType type, Object arg)}</td></tr>
  * <tr><th scope="row" style="font-weight:normal; vertical-align:top">2</th><td>
  *     <ul style="list-style:none; padding-left: 0; margin:0">
- *     <li><code>CallSite bootstrap(Lookup caller, String name, MethodType type, Object... args)</code>
- *     <li><code>CallSite bootstrap(Lookup caller, String name, MethodType type, String... args)</code>
- *     <li><code>CallSite bootstrap(Lookup caller, String name, MethodType type, String x, int y)</code>
+ *     <li>{@code CallSite bootstrap(Lookup caller, String name, MethodType type, Object... args)}
+ *     <li>{@code CallSite bootstrap(Lookup caller, String name, MethodType type, String... args)}
+ *     <li>{@code CallSite bootstrap(Lookup caller, String name, MethodType type, String x, int y)}
  *     </ul></td></tr>
  * </tbody>
  * </table>
--- a/src/java.base/share/classes/java/lang/ref/Reference.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/lang/ref/Reference.java	Wed Sep 25 22:40:41 2019 +0200
@@ -323,10 +323,10 @@
     /**
      * Returns this reference object's referent.  If this reference object has
      * been cleared, either by the program or by the garbage collector, then
-     * this method returns <code>null</code>.
+     * this method returns {@code null}.
      *
      * @return   The object to which this reference refers, or
-     *           <code>null</code> if this reference object has been cleared
+     *           {@code null} if this reference object has been cleared
      */
     @HotSpotIntrinsicCandidate
     public T get() {
@@ -350,9 +350,9 @@
      * Tells whether or not this reference object has been enqueued, either by
      * the program or by the garbage collector.  If this reference object was
      * not registered with a queue when it was created, then this method will
-     * always return <code>false</code>.
+     * always return {@code false}.
      *
-     * @return   <code>true</code> if and only if this reference object has
+     * @return   {@code true} if and only if this reference object has
      *           been enqueued
      */
     public boolean isEnqueued() {
@@ -366,8 +366,8 @@
      * <p> This method is invoked only by Java code; when the garbage collector
      * enqueues references it does so directly, without invoking this method.
      *
-     * @return   <code>true</code> if this reference object was successfully
-     *           enqueued; <code>false</code> if it was already enqueued or if
+     * @return   {@code true} if this reference object was successfully
+     *           enqueued; {@code false} if it was already enqueued or if
      *           it was not registered with a queue when it was created
      */
     public boolean enqueue() {
--- a/src/java.base/share/classes/java/nio/charset/Charset-X-Coder.java.template	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/nio/charset/Charset-X-Coder.java.template	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -455,7 +455,14 @@
     /**
      * Returns the maximum number of $otype$s that will be produced for each
      * $itype$ of input.  This value may be used to compute the worst-case size
-     * of the output buffer required for a given input sequence.
+     * of the output buffer required for a given input sequence. This value
+     * accounts for any necessary content-independent prefix or suffix
+#if[encoder]
+     * $otype$s, such as byte-order marks.
+#end[encoder]
+#if[decoder]
+     * $otype$s.
+#end[decoder]
      *
      * @return  The maximum number of $otype$s that will be produced per
      *          $itype$ of input
--- a/src/java.base/share/classes/java/security/Provider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/security/Provider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1255,9 +1255,9 @@
         }
         synchronized (this) {
             ensureLegacyParsed();
-        }
-        if (legacyMap != null && !legacyMap.isEmpty()) {
-            return legacyMap.get(key);
+            if (legacyMap != null && !legacyMap.isEmpty()) {
+                return legacyMap.get(key);
+            }
         }
         return null;
     }
--- a/src/java.base/share/classes/java/text/AttributedString.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/AttributedString.java	Wed Sep 25 22:40:41 2019 +0200
@@ -117,7 +117,7 @@
     /**
      * Constructs an AttributedString instance with the given text.
      * @param text The text for this attributed string.
-     * @throws    NullPointerException if <code>text</code> is null.
+     * @throws    NullPointerException if {@code text} is null.
      */
     public AttributedString(String text) {
         if (text == null) {
@@ -130,8 +130,8 @@
      * Constructs an AttributedString instance with the given text and attributes.
      * @param text The text for this attributed string.
      * @param attributes The attributes that apply to the entire string.
-     * @throws    NullPointerException if <code>text</code> or
-     *            <code>attributes</code> is null.
+     * @throws    NullPointerException if {@code text} or
+     *            {@code attributes} is null.
      * @throws    IllegalArgumentException if the text has length 0
      * and the attributes parameter is not an empty Map (attributes
      * cannot be applied to a 0-length range).
@@ -171,7 +171,7 @@
      * Constructs an AttributedString instance with the given attributed
      * text represented by AttributedCharacterIterator.
      * @param text The text for this attributed string.
-     * @throws    NullPointerException if <code>text</code> is null.
+     * @throws    NullPointerException if {@code text} is null.
      */
     public AttributedString(AttributedCharacterIterator text) {
         // If performance is critical, this constructor should be
@@ -192,7 +192,7 @@
      * @param beginIndex Index of the first character of the range.
      * @param endIndex Index of the character following the last character
      * of the range.
-     * @throws    NullPointerException if <code>text</code> is null.
+     * @throws    NullPointerException if {@code text} is null.
      * @throws    IllegalArgumentException if the subrange given by
      * beginIndex and endIndex is out of the text range.
      * @see java.text.Annotation
@@ -220,7 +220,7 @@
      * @param attributes Specifies attributes to be extracted
      * from the text. If null is specified, all available attributes will
      * be used.
-     * @throws    NullPointerException if <code>text</code> is null.
+     * @throws    NullPointerException if {@code text} is null.
      * @throws    IllegalArgumentException if the subrange given by
      * beginIndex and endIndex is out of the text range.
      * @see java.text.Annotation
@@ -307,7 +307,7 @@
      * Adds an attribute to the entire string.
      * @param attribute the attribute key
      * @param value the value of the attribute; may be null
-     * @throws    NullPointerException if <code>attribute</code> is null.
+     * @throws    NullPointerException if {@code attribute} is null.
      * @throws    IllegalArgumentException if the AttributedString has length 0
      * (attributes cannot be applied to a 0-length range).
      */
@@ -331,7 +331,7 @@
      * @param value The value of the attribute. May be null.
      * @param beginIndex Index of the first character of the range.
      * @param endIndex Index of the character following the last character of the range.
-     * @throws    NullPointerException if <code>attribute</code> is null.
+     * @throws    NullPointerException if {@code attribute} is null.
      * @throws    IllegalArgumentException if beginIndex is less than 0, endIndex is
      * greater than the length of the string, or beginIndex and endIndex together don't
      * define a non-empty subrange of the string.
@@ -356,7 +356,7 @@
      * @param beginIndex Index of the first character of the range.
      * @param endIndex Index of the character following the last
      * character of the range.
-     * @throws    NullPointerException if <code>attributes</code> is null.
+     * @throws    NullPointerException if {@code attributes} is null.
      * @throws    IllegalArgumentException if beginIndex is less than
      * 0, endIndex is greater than the length of the string, or
      * beginIndex and endIndex together don't define a non-empty
--- a/src/java.base/share/classes/java/text/Bidi.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/Bidi.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, 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
@@ -261,7 +261,7 @@
 
     /**
      * Return the level of the nth logical run in this line.
-     * @param run the index of the run, between 0 and <code>getRunCount()</code>
+     * @param run the index of the run, between 0 and {@code getRunCount()}
      * @return the level of the run
      */
     public int getRunLevel(int run) {
@@ -271,7 +271,7 @@
     /**
      * Return the index of the character at the start of the nth logical run in this line, as
      * an offset from the start of the line.
-     * @param run the index of the run, between 0 and <code>getRunCount()</code>
+     * @param run the index of the run, between 0 and {@code getRunCount()}
      * @return the start of the run
      */
     public int getRunStart(int run) {
@@ -282,7 +282,7 @@
      * Return the index of the character past the end of the nth logical run in this line, as
      * an offset from the start of the line.  For example, this will return the length
      * of the line for the last run on the line.
-     * @param run the index of the run, between 0 and <code>getRunCount()</code>
+     * @param run the index of the run, between 0 and {@code getRunCount()}
      * @return limit the limit of the run
      */
     public int getRunLimit(int run) {
@@ -308,11 +308,11 @@
      * Reorder the objects in the array into visual order based on their levels.
      * This is a utility function to use when you have a collection of objects
      * representing runs of text in logical order, each run containing text
-     * at a single level.  The elements at <code>index</code> from
-     * <code>objectStart</code> up to <code>objectStart + count</code>
+     * at a single level.  The elements at {@code index} from
+     * {@code objectStart} up to {@code objectStart + count}
      * in the objects array will be reordered into visual order assuming
      * each run of text has the level indicated by the corresponding element
-     * in the levels array (at <code>index - objectStart + levelStart</code>).
+     * in the levels array (at {@code index - objectStart + levelStart}).
      *
      * @param levels an array representing the bidi level of each object
      * @param levelStart the start position in the levels array
--- a/src/java.base/share/classes/java/text/BreakIterator.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/BreakIterator.java	Wed Sep 25 22:40:41 2019 +0200
@@ -48,23 +48,23 @@
 
 
 /**
- * The <code>BreakIterator</code> class implements methods for finding
- * the location of boundaries in text. Instances of <code>BreakIterator</code>
+ * The {@code BreakIterator} class implements methods for finding
+ * the location of boundaries in text. Instances of {@code BreakIterator}
  * maintain a current position and scan over text
  * returning the index of characters where boundaries occur.
- * Internally, <code>BreakIterator</code> scans text using a
- * <code>CharacterIterator</code>, and is thus able to scan text held
- * by any object implementing that protocol. A <code>StringCharacterIterator</code>
- * is used to scan <code>String</code> objects passed to <code>setText</code>.
+ * Internally, {@code BreakIterator} scans text using a
+ * {@code CharacterIterator}, and is thus able to scan text held
+ * by any object implementing that protocol. A {@code StringCharacterIterator}
+ * is used to scan {@code String} objects passed to {@code setText}.
  *
  * <p>
  * You use the factory methods provided by this class to create
  * instances of various types of break iterators. In particular,
- * use <code>getWordInstance</code>, <code>getLineInstance</code>,
- * <code>getSentenceInstance</code>, and <code>getCharacterInstance</code>
- * to create <code>BreakIterator</code>s that perform
+ * use {@code getWordInstance}, {@code getLineInstance},
+ * {@code getSentenceInstance}, and {@code getCharacterInstance}
+ * to create {@code BreakIterator}s that perform
  * word, line, sentence, and character boundary analysis respectively.
- * A single <code>BreakIterator</code> can work only on one unit
+ * A single {@code BreakIterator} can work only on one unit
  * (word, line, sentence, and so on). You must use a different iterator
  * for each unit boundary analysis you wish to perform.
  *
@@ -100,7 +100,7 @@
  * differ between languages.
  *
  * <p>
- * The <code>BreakIterator</code> instances returned by the factory methods
+ * The {@code BreakIterator} instances returned by the factory methods
  * of this class are intended for use with natural languages only, not for
  * programming language text. It is however possible to define subclasses
  * that tokenize a programming language.
@@ -274,31 +274,31 @@
     /**
      * Returns the nth boundary from the current boundary. If either
      * the first or last text boundary has been reached, it returns
-     * <code>BreakIterator.DONE</code> and the current position is set to either
+     * {@code BreakIterator.DONE} and the current position is set to either
      * the first or last text boundary depending on which one is reached. Otherwise,
      * the iterator's current position is set to the new boundary.
      * For example, if the iterator's current position is the mth text boundary
      * and three more boundaries exist from the current boundary to the last text
      * boundary, the next(2) call will return m + 2. The new text position is set
      * to the (m + 2)th text boundary. A next(4) call would return
-     * <code>BreakIterator.DONE</code> and the last text boundary would become the
+     * {@code BreakIterator.DONE} and the last text boundary would become the
      * new text position.
      * @param n which boundary to return.  A value of 0
      * does nothing.  Negative values move to previous boundaries
      * and positive values move to later boundaries.
      * @return The character index of the nth boundary from the current position
-     * or <code>BreakIterator.DONE</code> if either first or last text boundary
+     * or {@code BreakIterator.DONE} if either first or last text boundary
      * has been reached.
      */
     public abstract int next(int n);
 
     /**
      * Returns the boundary following the current boundary. If the current boundary
-     * is the last text boundary, it returns <code>BreakIterator.DONE</code> and
+     * is the last text boundary, it returns {@code BreakIterator.DONE} and
      * the iterator's current position is unchanged. Otherwise, the iterator's
      * current position is set to the boundary following the current boundary.
      * @return The character index of the next text boundary or
-     * <code>BreakIterator.DONE</code> if the current boundary is the last text
+     * {@code BreakIterator.DONE} if the current boundary is the last text
      * boundary.
      * Equivalent to next(1).
      * @see #next(int)
@@ -307,11 +307,11 @@
 
     /**
      * Returns the boundary preceding the current boundary. If the current boundary
-     * is the first text boundary, it returns <code>BreakIterator.DONE</code> and
+     * is the first text boundary, it returns {@code BreakIterator.DONE} and
      * the iterator's current position is unchanged. Otherwise, the iterator's
      * current position is set to the boundary preceding the current boundary.
      * @return The character index of the previous text boundary or
-     * <code>BreakIterator.DONE</code> if the current boundary is the first text
+     * {@code BreakIterator.DONE} if the current boundary is the first text
      * boundary.
      */
     public abstract int previous();
@@ -319,13 +319,13 @@
     /**
      * Returns the first boundary following the specified character offset. If the
      * specified offset equals to the last text boundary, it returns
-     * <code>BreakIterator.DONE</code> and the iterator's current position is unchanged.
+     * {@code BreakIterator.DONE} and the iterator's current position is unchanged.
      * Otherwise, the iterator's current position is set to the returned boundary.
      * The value returned is always greater than the offset or the value
-     * <code>BreakIterator.DONE</code>.
+     * {@code BreakIterator.DONE}.
      * @param offset the character offset to begin scanning.
      * @return The first boundary after the specified offset or
-     * <code>BreakIterator.DONE</code> if the last text boundary is passed in
+     * {@code BreakIterator.DONE} if the last text boundary is passed in
      * as the offset.
      * @throws     IllegalArgumentException if the specified offset is less than
      * the first text boundary or greater than the last text boundary.
@@ -335,13 +335,13 @@
     /**
      * Returns the last boundary preceding the specified character offset. If the
      * specified offset equals to the first text boundary, it returns
-     * <code>BreakIterator.DONE</code> and the iterator's current position is unchanged.
+     * {@code BreakIterator.DONE} and the iterator's current position is unchanged.
      * Otherwise, the iterator's current position is set to the returned boundary.
      * The value returned is always less than the offset or the value
-     * <code>BreakIterator.DONE</code>.
+     * {@code BreakIterator.DONE}.
      * @param offset the character offset to begin scanning.
      * @return The last boundary before the specified offset or
-     * <code>BreakIterator.DONE</code> if the first text boundary is passed in
+     * {@code BreakIterator.DONE} if the first text boundary is passed in
      * as the offset.
      * @throws      IllegalArgumentException if the specified offset is less than
      * the first text boundary or greater than the last text boundary.
@@ -361,8 +361,8 @@
     /**
      * Returns true if the specified character offset is a text boundary.
      * @param offset the character offset to check.
-     * @return <code>true</code> if "offset" is a boundary position,
-     * <code>false</code> otherwise.
+     * @return {@code true} if "offset" is a boundary position,
+     * {@code false} otherwise.
      * @throws      IllegalArgumentException if the specified offset is less than
      * the first text boundary or greater than the last text boundary.
      * @since 1.2
@@ -390,7 +390,7 @@
      * Returns character index of the text boundary that was most
      * recently returned by next(), next(int), previous(), first(), last(),
      * following(int) or preceding(int). If any of these methods returns
-     * <code>BreakIterator.DONE</code> because either first or last text boundary
+     * {@code BreakIterator.DONE} because either first or last text boundary
      * has been reached, it returns the first or last text boundary depending on
      * which one is reached.
      * @return The text boundary returned from the above methods, first or last
@@ -437,7 +437,7 @@
     private static final SoftReference<BreakIteratorCache>[] iterCache = (SoftReference<BreakIteratorCache>[]) new SoftReference<?>[4];
 
     /**
-     * Returns a new <code>BreakIterator</code> instance
+     * Returns a new {@code BreakIterator} instance
      * for <a href="BreakIterator.html#word">word breaks</a>
      * for the {@linkplain Locale#getDefault() default locale}.
      * @return A break iterator for word breaks
@@ -448,12 +448,12 @@
     }
 
     /**
-     * Returns a new <code>BreakIterator</code> instance
+     * Returns a new {@code BreakIterator} instance
      * for <a href="BreakIterator.html#word">word breaks</a>
      * for the given locale.
      * @param locale the desired locale
      * @return A break iterator for word breaks
-     * @throws    NullPointerException if <code>locale</code> is null
+     * @throws    NullPointerException if {@code locale} is null
      */
     public static BreakIterator getWordInstance(Locale locale)
     {
@@ -461,7 +461,7 @@
     }
 
     /**
-     * Returns a new <code>BreakIterator</code> instance
+     * Returns a new {@code BreakIterator} instance
      * for <a href="BreakIterator.html#line">line breaks</a>
      * for the {@linkplain Locale#getDefault() default locale}.
      * @return A break iterator for line breaks
@@ -472,12 +472,12 @@
     }
 
     /**
-     * Returns a new <code>BreakIterator</code> instance
+     * Returns a new {@code BreakIterator} instance
      * for <a href="BreakIterator.html#line">line breaks</a>
      * for the given locale.
      * @param locale the desired locale
      * @return A break iterator for line breaks
-     * @throws    NullPointerException if <code>locale</code> is null
+     * @throws    NullPointerException if {@code locale} is null
      */
     public static BreakIterator getLineInstance(Locale locale)
     {
@@ -485,7 +485,7 @@
     }
 
     /**
-     * Returns a new <code>BreakIterator</code> instance
+     * Returns a new {@code BreakIterator} instance
      * for <a href="BreakIterator.html#character">character breaks</a>
      * for the {@linkplain Locale#getDefault() default locale}.
      * @return A break iterator for character breaks
@@ -496,12 +496,12 @@
     }
 
     /**
-     * Returns a new <code>BreakIterator</code> instance
+     * Returns a new {@code BreakIterator} instance
      * for <a href="BreakIterator.html#character">character breaks</a>
      * for the given locale.
      * @param locale the desired locale
      * @return A break iterator for character breaks
-     * @throws    NullPointerException if <code>locale</code> is null
+     * @throws    NullPointerException if {@code locale} is null
      */
     public static BreakIterator getCharacterInstance(Locale locale)
     {
@@ -509,7 +509,7 @@
     }
 
     /**
-     * Returns a new <code>BreakIterator</code> instance
+     * Returns a new {@code BreakIterator} instance
      * for <a href="BreakIterator.html#sentence">sentence breaks</a>
      * for the {@linkplain Locale#getDefault() default locale}.
      * @return A break iterator for sentence breaks
@@ -520,12 +520,12 @@
     }
 
     /**
-     * Returns a new <code>BreakIterator</code> instance
+     * Returns a new {@code BreakIterator} instance
      * for <a href="BreakIterator.html#sentence">sentence breaks</a>
      * for the given locale.
      * @param locale the desired locale
      * @return A break iterator for sentence breaks
-     * @throws    NullPointerException if <code>locale</code> is null
+     * @throws    NullPointerException if {@code locale} is null
      */
     public static BreakIterator getSentenceInstance(Locale locale)
     {
@@ -580,16 +580,16 @@
 
     /**
      * Returns an array of all locales for which the
-     * <code>get*Instance</code> methods of this class can return
+     * {@code get*Instance} methods of this class can return
      * localized instances.
      * The returned array represents the union of locales supported by the Java
      * runtime and by installed
      * {@link java.text.spi.BreakIteratorProvider BreakIteratorProvider} implementations.
-     * It must contain at least a <code>Locale</code>
+     * It must contain at least a {@code Locale}
      * instance equal to {@link java.util.Locale#US Locale.US}.
      *
      * @return An array of locales for which localized
-     *         <code>BreakIterator</code> instances are available.
+     *         {@code BreakIterator} instances are available.
      */
     public static synchronized Locale[] getAvailableLocales()
     {
--- a/src/java.base/share/classes/java/text/CharacterIteratorFieldDelegate.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/CharacterIteratorFieldDelegate.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2012, 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
@@ -28,16 +28,16 @@
 
 /**
  * CharacterIteratorFieldDelegate combines the notifications from a Format
- * into a resulting <code>AttributedCharacterIterator</code>. The resulting
- * <code>AttributedCharacterIterator</code> can be retrieved by way of
- * the <code>getIterator</code> method.
+ * into a resulting {@code AttributedCharacterIterator}. The resulting
+ * {@code AttributedCharacterIterator} can be retrieved by way of
+ * the {@code getIterator} method.
  *
  */
 class CharacterIteratorFieldDelegate implements Format.FieldDelegate {
     /**
-     * Array of AttributeStrings. Whenever <code>formatted</code> is invoked
+     * Array of AttributeStrings. Whenever {@code formatted} is invoked
      * for a region > size, a new instance of AttributedString is added to
-     * attributedStrings. Subsequent invocations of <code>formatted</code>
+     * attributedStrings. Subsequent invocations of {@code formatted}
      * for existing regions result in invoking addAttribute on the existing
      * AttributedStrings.
      */
@@ -98,7 +98,7 @@
     }
 
     /**
-     * Returns an <code>AttributedCharacterIterator</code> that can be used
+     * Returns an {@code AttributedCharacterIterator} that can be used
      * to iterate over the resulting formatted String.
      *
      * @pararm string Result of formatting.
--- a/src/java.base/share/classes/java/text/ChoiceFormat.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/ChoiceFormat.java	Wed Sep 25 22:40:41 2019 +0200
@@ -44,8 +44,8 @@
 import java.util.Arrays;
 
 /**
- * A <code>ChoiceFormat</code> allows you to attach a format to a range of numbers.
- * It is generally used in a <code>MessageFormat</code> for handling plurals.
+ * A {@code ChoiceFormat} allows you to attach a format to a range of numbers.
+ * It is generally used in a {@code MessageFormat} for handling plurals.
  * The choice is specified with an ascending list of doubles, where each item
  * specifies a half-open interval up to the next item:
  * <blockquote>
@@ -60,15 +60,15 @@
  *
  * <p>
  * <strong>Note:</strong>
- * <code>ChoiceFormat</code> differs from the other <code>Format</code>
- * classes in that you create a <code>ChoiceFormat</code> object with a
- * constructor (not with a <code>getInstance</code> style factory
- * method). The factory methods aren't necessary because <code>ChoiceFormat</code>
+ * {@code ChoiceFormat} differs from the other {@code Format}
+ * classes in that you create a {@code ChoiceFormat} object with a
+ * constructor (not with a {@code getInstance} style factory
+ * method). The factory methods aren't necessary because {@code ChoiceFormat}
  * doesn't require any complex setup for a given locale. In fact,
- * <code>ChoiceFormat</code> doesn't implement any locale specific behavior.
+ * {@code ChoiceFormat} doesn't implement any locale specific behavior.
  *
  * <p>
- * When creating a <code>ChoiceFormat</code>, you must specify an array of formats
+ * When creating a {@code ChoiceFormat}, you must specify an array of formats
  * and an array of limits. The length of these arrays must be the same.
  * For example,
  * <ul>
@@ -78,7 +78,7 @@
  * <li>
  *     <em>limits</em> = {0, 1, ChoiceFormat.nextDouble(1)}<br>
  *     <em>formats</em> = {"no files", "one file", "many files"}<br>
- *     (<code>nextDouble</code> can be used to get the next higher double, to
+ *     ({@code nextDouble} can be used to get the next higher double, to
  *     make the half-open interval.)
  * </ul>
  *
@@ -381,7 +381,7 @@
 
     /**
      * Specialization of format. This method really calls
-     * <code>format(double, StringBuffer, FieldPosition)</code>
+     * {@code format(double, StringBuffer, FieldPosition)}
      * thus the range of longs that are supported is only equal to
      * the range that can be stored by double. This will never be
      * a practical limitation.
@@ -542,16 +542,16 @@
 
     /**
      * A list of lower bounds for the choices.  The formatter will return
-     * <code>choiceFormats[i]</code> if the number being formatted is greater than or equal to
-     * <code>choiceLimits[i]</code> and less than <code>choiceLimits[i+1]</code>.
+     * {@code choiceFormats[i]} if the number being formatted is greater than or equal to
+     * {@code choiceLimits[i]} and less than {@code choiceLimits[i+1]}.
      * @serial
      */
     private double[] choiceLimits;
 
     /**
      * A list of choice strings.  The formatter will return
-     * <code>choiceFormats[i]</code> if the number being formatted is greater than or equal to
-     * <code>choiceLimits[i]</code> and less than <code>choiceLimits[i+1]</code>.
+     * {@code choiceFormats[i]} if the number being formatted is greater than or equal to
+     * {@code choiceLimits[i]} and less than {@code choiceLimits[i+1]}.
      * @serial
      */
     private String[] choiceFormats;
--- a/src/java.base/share/classes/java/text/CollationElementIterator.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/CollationElementIterator.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, 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
@@ -44,7 +44,7 @@
 import sun.text.normalizer.NormalizerBase;
 
 /**
- * The <code>CollationElementIterator</code> class is used as an iterator
+ * The {@code CollationElementIterator} class is used as an iterator
  * to walk through each character of an international string. Use the iterator
  * to return the ordering priority of the positioned character. The ordering
  * priority of a character, which we refer to as a key, defines how a character
@@ -68,9 +68,9 @@
  * The key of a character is an integer composed of primary order(short),
  * secondary order(byte), and tertiary order(byte). Java strictly defines
  * the size and signedness of its primitive data types. Therefore, the static
- * functions <code>primaryOrder</code>, <code>secondaryOrder</code>, and
- * <code>tertiaryOrder</code> return <code>int</code>, <code>short</code>,
- * and <code>short</code> respectively to ensure the correctness of the key
+ * functions {@code primaryOrder}, {@code secondaryOrder}, and
+ * {@code tertiaryOrder} return {@code int}, {@code short},
+ * and {@code short} respectively to ensure the correctness of the key
  * value.
  *
  * <p>
@@ -90,16 +90,16 @@
  * </blockquote>
  *
  * <p>
- * <code>CollationElementIterator.next</code> returns the collation order
+ * {@code CollationElementIterator.next} returns the collation order
  * of the next character. A collation order consists of primary order,
  * secondary order and tertiary order. The data type of the collation
  * order is <strong>int</strong>. The first 16 bits of a collation order
  * is its primary order; the next 8 bits is the secondary order and the
  * last 8 bits is the tertiary order.
  *
- * <p><b>Note:</b> <code>CollationElementIterator</code> is a part of
- * <code>RuleBasedCollator</code> implementation. It is only usable
- * with <code>RuleBasedCollator</code> instances.
+ * <p><b>Note:</b> {@code CollationElementIterator} is a part of
+ * {@code RuleBasedCollator} implementation. It is only usable
+ * with {@code RuleBasedCollator} instances.
  *
  * @see                Collator
  * @see                RuleBasedCollator
--- a/src/java.base/share/classes/java/text/CollationKey.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/CollationKey.java	Wed Sep 25 22:40:41 2019 +0200
@@ -39,34 +39,34 @@
 package java.text;
 
 /**
- * A <code>CollationKey</code> represents a <code>String</code> under the
- * rules of a specific <code>Collator</code> object. Comparing two
- * <code>CollationKey</code>s returns the relative order of the
- * <code>String</code>s they represent. Using <code>CollationKey</code>s
- * to compare <code>String</code>s is generally faster than using
- * <code>Collator.compare</code>. Thus, when the <code>String</code>s
+ * A {@code CollationKey} represents a {@code String} under the
+ * rules of a specific {@code Collator} object. Comparing two
+ * {@code CollationKey}s returns the relative order of the
+ * {@code String}s they represent. Using {@code CollationKey}s
+ * to compare {@code String}s is generally faster than using
+ * {@code Collator.compare}. Thus, when the {@code String}s
  * must be compared multiple times, for example when sorting a list
- * of <code>String</code>s. It's more efficient to use <code>CollationKey</code>s.
+ * of {@code String}s. It's more efficient to use {@code CollationKey}s.
  *
  * <p>
- * You can not create <code>CollationKey</code>s directly. Rather,
- * generate them by calling <code>Collator.getCollationKey</code>.
- * You can only compare <code>CollationKey</code>s generated from
- * the same <code>Collator</code> object.
+ * You can not create {@code CollationKey}s directly. Rather,
+ * generate them by calling {@code Collator.getCollationKey}.
+ * You can only compare {@code CollationKey}s generated from
+ * the same {@code Collator} object.
  *
  * <p>
- * Generating a <code>CollationKey</code> for a <code>String</code>
- * involves examining the entire <code>String</code>
+ * Generating a {@code CollationKey} for a {@code String}
+ * involves examining the entire {@code String}
  * and converting it to series of bits that can be compared bitwise. This
  * allows fast comparisons once the keys are generated. The cost of generating
- * keys is recouped in faster comparisons when <code>String</code>s need
+ * keys is recouped in faster comparisons when {@code String}s need
  * to be compared many times. On the other hand, the result of a comparison
- * is often determined by the first couple of characters of each <code>String</code>.
- * <code>Collator.compare</code> examines only as many characters as it needs which
+ * is often determined by the first couple of characters of each {@code String}.
+ * {@code Collator.compare} examines only as many characters as it needs which
  * allows it to be faster when doing single comparisons.
  * <p>
- * The following example shows how <code>CollationKey</code>s might be used
- * to sort a list of <code>String</code>s.
+ * The following example shows how {@code CollationKey}s might be used
+ * to sort a list of {@code String}s.
  * <blockquote>
  * <pre>{@code
  * // Create an array of CollationKeys for the Strings to be sorted.
--- a/src/java.base/share/classes/java/text/Collator.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/Collator.java	Wed Sep 25 22:40:41 2019 +0200
@@ -49,28 +49,28 @@
 
 
 /**
- * The <code>Collator</code> class performs locale-sensitive
- * <code>String</code> comparison. You use this class to build
+ * The {@code Collator} class performs locale-sensitive
+ * {@code String} comparison. You use this class to build
  * searching and sorting routines for natural language text.
  *
  * <p>
- * <code>Collator</code> is an abstract base class. Subclasses
+ * {@code Collator} is an abstract base class. Subclasses
  * implement specific collation strategies. One subclass,
- * <code>RuleBasedCollator</code>, is currently provided with
+ * {@code RuleBasedCollator}, is currently provided with
  * the Java Platform and is applicable to a wide set of languages. Other
  * subclasses may be created to handle more specialized needs.
  *
  * <p>
  * Like other locale-sensitive classes, you can use the static
- * factory method, <code>getInstance</code>, to obtain the appropriate
- * <code>Collator</code> object for a given locale. You will only need
- * to look at the subclasses of <code>Collator</code> if you need
+ * factory method, {@code getInstance}, to obtain the appropriate
+ * {@code Collator} object for a given locale. You will only need
+ * to look at the subclasses of {@code Collator} if you need
  * to understand the details of a particular collation strategy or
  * if you need to modify that strategy.
  *
  * <p>
  * The following example shows how to compare two strings using
- * the <code>Collator</code> for the default locale.
+ * the {@code Collator} for the default locale.
  * <blockquote>
  * <pre>{@code
  * // Compare two strings in the default locale
@@ -83,10 +83,10 @@
  * </blockquote>
  *
  * <p>
- * You can set a <code>Collator</code>'s <em>strength</em> property
+ * You can set a {@code Collator}'s <em>strength</em> property
  * to determine the level of difference considered significant in
- * comparisons. Four strengths are provided: <code>PRIMARY</code>,
- * <code>SECONDARY</code>, <code>TERTIARY</code>, and <code>IDENTICAL</code>.
+ * comparisons. Four strengths are provided: {@code PRIMARY},
+ * {@code SECONDARY}, {@code TERTIARY}, and {@code IDENTICAL}.
  * The exact assignment of strengths to language features is
  * locale dependent.  For example, in Czech, "e" and "f" are considered
  * primary differences, while "e" and "&#283;" are secondary differences,
@@ -104,19 +104,19 @@
  * </pre>
  * </blockquote>
  * <p>
- * For comparing <code>String</code>s exactly once, the <code>compare</code>
+ * For comparing {@code String}s exactly once, the {@code compare}
  * method provides the best performance. When sorting a list of
- * <code>String</code>s however, it is generally necessary to compare each
- * <code>String</code> multiple times. In this case, <code>CollationKey</code>s
- * provide better performance. The <code>CollationKey</code> class converts
- * a <code>String</code> to a series of bits that can be compared bitwise
- * against other <code>CollationKey</code>s. A <code>CollationKey</code> is
- * created by a <code>Collator</code> object for a given <code>String</code>.
+ * {@code String}s however, it is generally necessary to compare each
+ * {@code String} multiple times. In this case, {@code CollationKey}s
+ * provide better performance. The {@code CollationKey} class converts
+ * a {@code String} to a series of bits that can be compared bitwise
+ * against other {@code CollationKey}s. A {@code CollationKey} is
+ * created by a {@code Collator} object for a given {@code String}.
  * <br>
- * <strong>Note:</strong> <code>CollationKey</code>s from different
- * <code>Collator</code>s can not be compared. See the class description
+ * <strong>Note:</strong> {@code CollationKey}s from different
+ * {@code Collator}s can not be compared. See the class description
  * for {@link CollationKey}
- * for an example using <code>CollationKey</code>s.
+ * for an example using {@code CollationKey}s.
  *
  * @see         RuleBasedCollator
  * @see         CollationKey
@@ -291,7 +291,7 @@
      * to, or greater than the second.
      * <p>
      * This implementation merely returns
-     *  <code> compare((String)o1, (String)o2) </code>.
+     *  {@code  compare((String)o1, (String)o2) }.
      *
      * @return a negative integer, zero, or a positive integer as the
      *         first argument is less than, equal to, or greater than the
@@ -416,7 +416,7 @@
 
     /**
      * Returns an array of all locales for which the
-     * <code>getInstance</code> methods of this class can return
+     * {@code getInstance} methods of this class can return
      * localized instances.
      * The returned array represents the union of locales supported
      * by the Java runtime and by installed
@@ -425,7 +425,7 @@
      * {@link java.util.Locale#US Locale.US}.
      *
      * @return An array of locales for which localized
-     *         <code>Collator</code> instances are available.
+     *         {@code Collator} instances are available.
      */
     public static synchronized Locale[] getAvailableLocales() {
         LocaleServiceProviderPool pool =
--- a/src/java.base/share/classes/java/text/DateFormat.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/DateFormat.java	Wed Sep 25 22:40:41 2019 +0200
@@ -58,7 +58,7 @@
  * formats and parses dates or time in a language-independent manner.
  * The date/time formatting subclass, such as {@link SimpleDateFormat}, allows for
  * formatting (i.e., date &rarr; text), parsing (text &rarr; date), and
- * normalization.  The date is represented as a <code>Date</code> object or
+ * normalization.  The date is represented as a {@code Date} object or
  * as the milliseconds since January 1, 1970, 00:00:00 GMT.
  *
  * <p>{@code DateFormat} provides many class methods for obtaining default date/time
@@ -185,15 +185,15 @@
      *
      * <p>Subclasses should initialize this field to a {@link Calendar}
      * appropriate for the {@link Locale} associated with this
-     * <code>DateFormat</code>.
+     * {@code DateFormat}.
      * @serial
      */
     protected Calendar calendar;
 
     /**
-     * The number formatter that <code>DateFormat</code> uses to format numbers
+     * The number formatter that {@code DateFormat} uses to format numbers
      * in dates and times.  Subclasses should initialize this to a number format
-     * appropriate for the locale associated with this <code>DateFormat</code>.
+     * appropriate for the locale associated with this {@code DateFormat}.
      * @serial
      */
     protected NumberFormat numberFormat;
@@ -383,8 +383,8 @@
      * See the {@link #parse(String, ParsePosition)} method for more information
      * on date parsing.
      *
-     * @param source A <code>String</code> whose beginning should be parsed.
-     * @return A <code>Date</code> parsed from the string.
+     * @param source A {@code String} whose beginning should be parsed.
+     * @return A {@code Date} parsed from the string.
      * @throws    ParseException if the beginning of the specified string
      *            cannot be parsed.
      */
@@ -427,26 +427,26 @@
     public abstract Date parse(String source, ParsePosition pos);
 
     /**
-     * Parses text from a string to produce a <code>Date</code>.
+     * Parses text from a string to produce a {@code Date}.
      * <p>
      * The method attempts to parse text starting at the index given by
-     * <code>pos</code>.
-     * If parsing succeeds, then the index of <code>pos</code> is updated
+     * {@code pos}.
+     * If parsing succeeds, then the index of {@code pos} is updated
      * to the index after the last character used (parsing does not necessarily
      * use all characters up to the end of the string), and the parsed
-     * date is returned. The updated <code>pos</code> can be used to
+     * date is returned. The updated {@code pos} can be used to
      * indicate the starting point for the next call to this method.
-     * If an error occurs, then the index of <code>pos</code> is not
-     * changed, the error index of <code>pos</code> is set to the index of
+     * If an error occurs, then the index of {@code pos} is not
+     * changed, the error index of {@code pos} is set to the index of
      * the character where the error occurred, and null is returned.
      * <p>
      * See the {@link #parse(String, ParsePosition)} method for more information
      * on date parsing.
      *
-     * @param source A <code>String</code>, part of which should be parsed.
-     * @param pos A <code>ParsePosition</code> object with index and error
+     * @param source A {@code String}, part of which should be parsed.
+     * @param pos A {@code ParsePosition} object with index and error
      *            index information as described above.
-     * @return A <code>Date</code> parsed from the string. In case of
+     * @return A {@code Date} parsed from the string. In case of
      *         error, returns null.
      * @throws NullPointerException if {@code source} or {@code pos} is null.
      */
@@ -628,16 +628,16 @@
 
     /**
      * Returns an array of all locales for which the
-     * <code>get*Instance</code> methods of this class can return
+     * {@code get*Instance} methods of this class can return
      * localized instances.
      * The returned array represents the union of locales supported by the Java
      * runtime and by installed
      * {@link java.text.spi.DateFormatProvider DateFormatProvider} implementations.
-     * It must contain at least a <code>Locale</code> instance equal to
+     * It must contain at least a {@code Locale} instance equal to
      * {@link java.util.Locale#US Locale.US}.
      *
      * @return An array of locales for which localized
-     *         <code>DateFormat</code> instances are available.
+     *         {@code DateFormat} instances are available.
      */
     public static Locale[] getAvailableLocales()
     {
@@ -854,9 +854,9 @@
 
     /**
      * Defines constants that are used as attribute keys in the
-     * <code>AttributedCharacterIterator</code> returned
-     * from <code>DateFormat.formatToCharacterIterator</code> and as
-     * field identifiers in <code>FieldPosition</code>.
+     * {@code AttributedCharacterIterator} returned
+     * from {@code DateFormat.formatToCharacterIterator} and as
+     * field identifiers in {@code FieldPosition}.
      * <p>
      * The class also provides two methods to map
      * between its constants and the corresponding Calendar constants.
@@ -881,13 +881,13 @@
         private int calendarField;
 
         /**
-         * Returns the <code>Field</code> constant that corresponds to
-         * the <code>Calendar</code> constant <code>calendarField</code>.
-         * If there is no direct mapping between the <code>Calendar</code>
-         * constant and a <code>Field</code>, null is returned.
+         * Returns the {@code Field} constant that corresponds to
+         * the {@code Calendar} constant {@code calendarField}.
+         * If there is no direct mapping between the {@code Calendar}
+         * constant and a {@code Field}, null is returned.
          *
-         * @throws IllegalArgumentException if <code>calendarField</code> is
-         *         not the value of a <code>Calendar</code> field constant.
+         * @throws IllegalArgumentException if {@code calendarField} is
+         *         not the value of a {@code Calendar} field constant.
          * @param calendarField Calendar field constant
          * @return Field instance representing calendarField.
          * @see java.util.Calendar
@@ -902,14 +902,14 @@
         }
 
         /**
-         * Creates a <code>Field</code>.
+         * Creates a {@code Field}.
          *
-         * @param name the name of the <code>Field</code>
-         * @param calendarField the <code>Calendar</code> constant this
-         *        <code>Field</code> corresponds to; any value, even one
-         *        outside the range of legal <code>Calendar</code> values may
-         *        be used, but <code>-1</code> should be used for values
-         *        that don't correspond to legal <code>Calendar</code> values
+         * @param name the name of the {@code Field}
+         * @param calendarField the {@code Calendar} constant this
+         *        {@code Field} corresponds to; any value, even one
+         *        outside the range of legal {@code Calendar} values may
+         *        be used, but {@code -1} should be used for values
+         *        that don't correspond to legal {@code Calendar} values
          */
         protected Field(String name, int calendarField) {
             super(name);
@@ -924,11 +924,11 @@
         }
 
         /**
-         * Returns the <code>Calendar</code> field associated with this
+         * Returns the {@code Calendar} field associated with this
          * attribute. For example, if this represents the hours field of
-         * a <code>Calendar</code>, this would return
-         * <code>Calendar.HOUR</code>. If there is no corresponding
-         * <code>Calendar</code> constant, this will return -1.
+         * a {@code Calendar}, this would return
+         * {@code Calendar.HOUR}. If there is no corresponding
+         * {@code Calendar} constant, this will return -1.
          *
          * @return Calendar constant for this field
          * @see java.util.Calendar
--- a/src/java.base/share/classes/java/text/DateFormatSymbols.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/DateFormatSymbols.java	Wed Sep 25 22:40:41 2019 +0200
@@ -56,22 +56,22 @@
 import sun.util.locale.provider.TimeZoneNameUtility;
 
 /**
- * <code>DateFormatSymbols</code> is a public class for encapsulating
+ * {@code DateFormatSymbols} is a public class for encapsulating
  * localizable date-time formatting data, such as the names of the
  * months, the names of the days of the week, and the time zone data.
- * <code>SimpleDateFormat</code> uses
- * <code>DateFormatSymbols</code> to encapsulate this information.
+ * {@code SimpleDateFormat} uses
+ * {@code DateFormatSymbols} to encapsulate this information.
  *
  * <p>
- * Typically you shouldn't use <code>DateFormatSymbols</code> directly.
+ * Typically you shouldn't use {@code DateFormatSymbols} directly.
  * Rather, you are encouraged to create a date-time formatter with the
- * <code>DateFormat</code> class's factory methods: <code>getTimeInstance</code>,
- * <code>getDateInstance</code>, or <code>getDateTimeInstance</code>.
- * These methods automatically create a <code>DateFormatSymbols</code> for
+ * {@code DateFormat} class's factory methods: {@code getTimeInstance},
+ * {@code getDateInstance}, or {@code getDateTimeInstance}.
+ * These methods automatically create a {@code DateFormatSymbols} for
  * the formatter so that you don't have to. After the
  * formatter is created, you may modify its format pattern using the
- * <code>setPattern</code> method. For more information about
- * creating formatters using <code>DateFormat</code>'s factory methods,
+ * {@code setPattern} method. For more information about
+ * creating formatters using {@code DateFormat}'s factory methods,
  * see {@link DateFormat}.
  *
  * <p>
@@ -88,16 +88,16 @@
  * the symbols are overridden for the designated region.
  *
  * <p>
- * <code>DateFormatSymbols</code> objects are cloneable. When you obtain
- * a <code>DateFormatSymbols</code> object, feel free to modify the
+ * {@code DateFormatSymbols} objects are cloneable. When you obtain
+ * a {@code DateFormatSymbols} object, feel free to modify the
  * date-time formatting data. For instance, you can replace the localized
  * date-time format pattern characters with the ones that you feel easy
  * to remember. Or you can change the representative cities
  * to your favorite ones.
  *
  * <p>
- * New <code>DateFormatSymbols</code> subclasses may be added to support
- * <code>SimpleDateFormat</code> for date-time formatting for additional locales.
+ * New {@code DateFormatSymbols} subclasses may be added to support
+ * {@code SimpleDateFormat} for date-time formatting for additional locales.
 
  * @see          DateFormat
  * @see          SimpleDateFormat
@@ -159,7 +159,7 @@
 
     /**
      * Era strings. For example: "AD" and "BC".  An array of 2 strings,
-     * indexed by <code>Calendar.BC</code> and <code>Calendar.AD</code>.
+     * indexed by {@code Calendar.BC} and {@code Calendar.AD}.
      * @serial
      */
     String eras[] = null;
@@ -167,7 +167,7 @@
     /**
      * Month strings. For example: "January", "February", etc.  An array
      * of 13 strings (some calendars have 13 months), indexed by
-     * <code>Calendar.JANUARY</code>, <code>Calendar.FEBRUARY</code>, etc.
+     * {@code Calendar.JANUARY}, {@code Calendar.FEBRUARY}, etc.
      * @serial
      */
     String months[] = null;
@@ -175,7 +175,7 @@
     /**
      * Short month strings. For example: "Jan", "Feb", etc.  An array of
      * 13 strings (some calendars have 13 months), indexed by
-     * <code>Calendar.JANUARY</code>, <code>Calendar.FEBRUARY</code>, etc.
+     * {@code Calendar.JANUARY}, {@code Calendar.FEBRUARY}, etc.
 
      * @serial
      */
@@ -183,26 +183,26 @@
 
     /**
      * Weekday strings. For example: "Sunday", "Monday", etc.  An array
-     * of 8 strings, indexed by <code>Calendar.SUNDAY</code>,
-     * <code>Calendar.MONDAY</code>, etc.
-     * The element <code>weekdays[0]</code> is ignored.
+     * of 8 strings, indexed by {@code Calendar.SUNDAY},
+     * {@code Calendar.MONDAY}, etc.
+     * The element {@code weekdays[0]} is ignored.
      * @serial
      */
     String weekdays[] = null;
 
     /**
      * Short weekday strings. For example: "Sun", "Mon", etc.  An array
-     * of 8 strings, indexed by <code>Calendar.SUNDAY</code>,
-     * <code>Calendar.MONDAY</code>, etc.
-     * The element <code>shortWeekdays[0]</code> is ignored.
+     * of 8 strings, indexed by {@code Calendar.SUNDAY},
+     * {@code Calendar.MONDAY}, etc.
+     * The element {@code shortWeekdays[0]} is ignored.
      * @serial
      */
     String shortWeekdays[] = null;
 
     /**
      * AM and PM strings. For example: "AM" and "PM".  An array of
-     * 2 strings, indexed by <code>Calendar.AM</code> and
-     * <code>Calendar.PM</code>.
+     * 2 strings, indexed by {@code Calendar.AM} and
+     * {@code Calendar.PM}.
      * @serial
      */
     String ampms[] = null;
@@ -211,18 +211,18 @@
      * Localized names of time zones in this locale.  This is a
      * two-dimensional array of strings of size <em>n</em> by <em>m</em>,
      * where <em>m</em> is at least 5.  Each of the <em>n</em> rows is an
-     * entry containing the localized names for a single <code>TimeZone</code>.
-     * Each such row contains (with <code>i</code> ranging from
+     * entry containing the localized names for a single {@code TimeZone}.
+     * Each such row contains (with {@code i} ranging from
      * 0..<em>n</em>-1):
      * <ul>
-     * <li><code>zoneStrings[i][0]</code> - time zone ID</li>
-     * <li><code>zoneStrings[i][1]</code> - long name of zone in standard
+     * <li>{@code zoneStrings[i][0]} - time zone ID</li>
+     * <li>{@code zoneStrings[i][1]} - long name of zone in standard
      * time</li>
-     * <li><code>zoneStrings[i][2]</code> - short name of zone in
+     * <li>{@code zoneStrings[i][2]} - short name of zone in
      * standard time</li>
-     * <li><code>zoneStrings[i][3]</code> - long name of zone in daylight
+     * <li>{@code zoneStrings[i][3]} - long name of zone in daylight
      * saving time</li>
-     * <li><code>zoneStrings[i][4]</code> - short name of zone in daylight
+     * <li>{@code zoneStrings[i][4]} - short name of zone in daylight
      * saving time</li>
      * </ul>
      * The zone ID is <em>not</em> localized; it's one of the valid IDs of
@@ -274,8 +274,8 @@
      * wish to use 'u' rather than 'y' to represent years in its date format
      * pattern strings.
      * This string must be exactly 18 characters long, with the index of
-     * the characters described by <code>DateFormat.ERA_FIELD</code>,
-     * <code>DateFormat.YEAR_FIELD</code>, etc.  Thus, if the string were
+     * the characters described by {@code DateFormat.ERA_FIELD},
+     * {@code DateFormat.YEAR_FIELD}, etc.  Thus, if the string were
      * "Xz...", then localized patterns would use 'X' for era and 'z' for year.
      * @serial
      */
@@ -295,16 +295,16 @@
 
     /**
      * Returns an array of all locales for which the
-     * <code>getInstance</code> methods of this class can return
+     * {@code getInstance} methods of this class can return
      * localized instances.
      * The returned array represents the union of locales supported by the
      * Java runtime and by installed
      * {@link java.text.spi.DateFormatSymbolsProvider DateFormatSymbolsProvider}
-     * implementations.  It must contain at least a <code>Locale</code>
+     * implementations.  It must contain at least a {@code Locale}
      * instance equal to {@link java.util.Locale#US Locale.US}.
      *
      * @return An array of locales for which localized
-     *         <code>DateFormatSymbols</code> instances are available.
+     *         {@code DateFormatSymbols} instances are available.
      * @since 1.6
      */
     public static Locale[] getAvailableLocales() {
@@ -314,8 +314,8 @@
     }
 
     /**
-     * Gets the <code>DateFormatSymbols</code> instance for the default
-     * locale.  This method provides access to <code>DateFormatSymbols</code>
+     * Gets the {@code DateFormatSymbols} instance for the default
+     * locale.  This method provides access to {@code DateFormatSymbols}
      * instances for locales supported by the Java runtime itself as well
      * as for those supported by installed
      * {@link java.text.spi.DateFormatSymbolsProvider DateFormatSymbolsProvider}
@@ -324,7 +324,7 @@
      *     getInstance(Locale.getDefault(Locale.Category.FORMAT))}.
      * @see java.util.Locale#getDefault(java.util.Locale.Category)
      * @see java.util.Locale.Category#FORMAT
-     * @return a <code>DateFormatSymbols</code> instance.
+     * @return a {@code DateFormatSymbols} instance.
      * @since 1.6
      */
     public static final DateFormatSymbols getInstance() {
@@ -332,15 +332,15 @@
     }
 
     /**
-     * Gets the <code>DateFormatSymbols</code> instance for the specified
-     * locale.  This method provides access to <code>DateFormatSymbols</code>
+     * Gets the {@code DateFormatSymbols} instance for the specified
+     * locale.  This method provides access to {@code DateFormatSymbols}
      * instances for locales supported by the Java runtime itself as well
      * as for those supported by installed
      * {@link java.text.spi.DateFormatSymbolsProvider DateFormatSymbolsProvider}
      * implementations.
      * @param locale the given locale.
-     * @return a <code>DateFormatSymbols</code> instance.
-     * @throws    NullPointerException if <code>locale</code> is null
+     * @return a {@code DateFormatSymbols} instance.
+     * @throws    NullPointerException if {@code locale} is null
      * @since 1.6
      */
     public static final DateFormatSymbols getInstance(Locale locale) {
@@ -538,18 +538,18 @@
      * The value returned is a
      * two-dimensional array of strings of size <em>n</em> by <em>m</em>,
      * where <em>m</em> is at least 5.  Each of the <em>n</em> rows is an
-     * entry containing the localized names for a single <code>TimeZone</code>.
-     * Each such row contains (with <code>i</code> ranging from
+     * entry containing the localized names for a single {@code TimeZone}.
+     * Each such row contains (with {@code i} ranging from
      * 0..<em>n</em>-1):
      * <ul>
-     * <li><code>zoneStrings[i][0]</code> - time zone ID</li>
-     * <li><code>zoneStrings[i][1]</code> - long name of zone in standard
+     * <li>{@code zoneStrings[i][0]} - time zone ID</li>
+     * <li>{@code zoneStrings[i][1]} - long name of zone in standard
      * time</li>
-     * <li><code>zoneStrings[i][2]</code> - short name of zone in
+     * <li>{@code zoneStrings[i][2]} - short name of zone in
      * standard time</li>
-     * <li><code>zoneStrings[i][3]</code> - long name of zone in daylight
+     * <li>{@code zoneStrings[i][3]} - long name of zone in daylight
      * saving time</li>
-     * <li><code>zoneStrings[i][4]</code> - short name of zone in daylight
+     * <li>{@code zoneStrings[i][4]} - short name of zone in daylight
      * saving time</li>
      * </ul>
      * The zone ID is <em>not</em> localized; it's one of the valid IDs of
@@ -559,7 +559,7 @@
      * daylight saving time, the daylight saving time names should not be used.
      * <p>
      * If {@link #setZoneStrings(String[][]) setZoneStrings} has been called
-     * on this <code>DateFormatSymbols</code> instance, then the strings
+     * on this {@code DateFormatSymbols} instance, then the strings
      * provided by that call are returned. Otherwise, the returned array
      * contains names provided by the Java runtime and by installed
      * {@link java.util.spi.TimeZoneNameProvider TimeZoneNameProvider}
@@ -576,18 +576,18 @@
      * Sets time zone strings.  The argument must be a
      * two-dimensional array of strings of size <em>n</em> by <em>m</em>,
      * where <em>m</em> is at least 5.  Each of the <em>n</em> rows is an
-     * entry containing the localized names for a single <code>TimeZone</code>.
-     * Each such row contains (with <code>i</code> ranging from
+     * entry containing the localized names for a single {@code TimeZone}.
+     * Each such row contains (with {@code i} ranging from
      * 0..<em>n</em>-1):
      * <ul>
-     * <li><code>zoneStrings[i][0]</code> - time zone ID</li>
-     * <li><code>zoneStrings[i][1]</code> - long name of zone in standard
+     * <li>{@code zoneStrings[i][0]} - time zone ID</li>
+     * <li>{@code zoneStrings[i][1]} - long name of zone in standard
      * time</li>
-     * <li><code>zoneStrings[i][2]</code> - short name of zone in
+     * <li>{@code zoneStrings[i][2]} - short name of zone in
      * standard time</li>
-     * <li><code>zoneStrings[i][3]</code> - long name of zone in daylight
+     * <li>{@code zoneStrings[i][3]} - long name of zone in daylight
      * saving time</li>
-     * <li><code>zoneStrings[i][4]</code> - short name of zone in daylight
+     * <li>{@code zoneStrings[i][4]} - short name of zone in daylight
      * saving time</li>
      * </ul>
      * The zone ID is <em>not</em> localized; it's one of the valid IDs of
@@ -597,8 +597,8 @@
      *
      * @param newZoneStrings the new time zone strings.
      * @throws    IllegalArgumentException if the length of any row in
-     *    <code>newZoneStrings</code> is less than 5
-     * @throws    NullPointerException if <code>newZoneStrings</code> is null
+     *    {@code newZoneStrings} is less than 5
+     * @throws    NullPointerException if {@code newZoneStrings} is null
      * @see #getZoneStrings()
      */
     public void setZoneStrings(String[][] newZoneStrings) {
@@ -888,7 +888,7 @@
 
     /**
      * Write out the default serializable data, after ensuring the
-     * <code>zoneStrings</code> field is initialized in order to make
+     * {@code zoneStrings} field is initialized in order to make
      * sure the backward compatibility.
      *
      * @since 1.6
--- a/src/java.base/share/classes/java/text/DigitList.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/DigitList.java	Wed Sep 25 22:40:41 2019 +0200
@@ -439,7 +439,7 @@
      * java.math.RoundingMode class.
      * [bnf]
      * @param maximumDigits the number of digits to keep, from 0 to
-     * <code>count-1</code>.  If 0, then all digits are rounded away, and
+     * {@code count-1}.  If 0, then all digits are rounded away, and
      * this method returns true if a one should be generated (e.g., formatting
      * 0.09 with "#.#").
      * @param alreadyRounded whether or not rounding up has already happened.
@@ -447,7 +447,7 @@
      * an exact decimal representation of the value.
      * @throws    ArithmeticException if rounding is needed with rounding
      *            mode being set to RoundingMode.UNNECESSARY
-     * @return true if digit <code>maximumDigits-1</code> should be
+     * @return true if digit {@code maximumDigits-1} should be
      * incremented
      */
     private boolean shouldRoundUp(int maximumDigits,
--- a/src/java.base/share/classes/java/text/FieldPosition.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/FieldPosition.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, 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
@@ -39,33 +39,33 @@
 package java.text;
 
 /**
- * <code>FieldPosition</code> is a simple class used by <code>Format</code>
+ * {@code FieldPosition} is a simple class used by {@code Format}
  * and its subclasses to identify fields in formatted output. Fields can
  * be identified in two ways:
  * <ul>
  *  <li>By an integer constant, whose names typically end with
- *      <code>_FIELD</code>. The constants are defined in the various
- *      subclasses of <code>Format</code>.
- *  <li>By a <code>Format.Field</code> constant, see <code>ERA_FIELD</code>
- *      and its friends in <code>DateFormat</code> for an example.
+ *      {@code _FIELD}. The constants are defined in the various
+ *      subclasses of {@code Format}.
+ *  <li>By a {@code Format.Field} constant, see {@code ERA_FIELD}
+ *      and its friends in {@code DateFormat} for an example.
  * </ul>
  * <p>
- * <code>FieldPosition</code> keeps track of the position of the
+ * {@code FieldPosition} keeps track of the position of the
  * field within the formatted output with two indices: the index
  * of the first character of the field and the index of the last
  * character of the field.
  *
  * <p>
- * One version of the <code>format</code> method in the various
- * <code>Format</code> classes requires a <code>FieldPosition</code>
- * object as an argument. You use this <code>format</code> method
+ * One version of the {@code format} method in the various
+ * {@code Format} classes requires a {@code FieldPosition}
+ * object as an argument. You use this {@code format} method
  * to perform partial formatting or to get information about the
  * formatted output (such as the position of a field).
  *
  * <p>
  * If you are interested in the positions of all attributes in the
- * formatted string use the <code>Format</code> method
- * <code>formatToCharacterIterator</code>.
+ * formatted string use the {@code Format} method
+ * {@code formatToCharacterIterator}.
  *
  * @author      Mark Davis
  * @since 1.1
@@ -113,9 +113,9 @@
 
     /**
      * Creates a FieldPosition object for the given field constant. Fields are
-     * identified by constants defined in the various <code>Format</code>
+     * identified by constants defined in the various {@code Format}
      * subclasses. This is equivalent to calling
-     * <code>new FieldPosition(attribute, -1)</code>.
+     * {@code new FieldPosition(attribute, -1)}.
      *
      * @param attribute Format.Field constant identifying a field
      * @since 1.4
@@ -125,16 +125,16 @@
     }
 
     /**
-     * Creates a <code>FieldPosition</code> object for the given field.
+     * Creates a {@code FieldPosition} object for the given field.
      * The field is identified by an attribute constant from one of the
-     * <code>Field</code> subclasses as well as an integer field ID
-     * defined by the <code>Format</code> subclasses. <code>Format</code>
-     * subclasses that are aware of <code>Field</code> should give precedence
-     * to <code>attribute</code> and ignore <code>fieldID</code> if
-     * <code>attribute</code> is not null. However, older <code>Format</code>
-     * subclasses may not be aware of <code>Field</code> and rely on
-     * <code>fieldID</code>. If the field has no corresponding integer
-     * constant, <code>fieldID</code> should be -1.
+     * {@code Field} subclasses as well as an integer field ID
+     * defined by the {@code Format} subclasses. {@code Format}
+     * subclasses that are aware of {@code Field} should give precedence
+     * to {@code attribute} and ignore {@code fieldID} if
+     * {@code attribute} is not null. However, older {@code Format}
+     * subclasses may not be aware of {@code Field} and rely on
+     * {@code fieldID}. If the field has no corresponding integer
+     * constant, {@code fieldID} should be -1.
      *
      * @param attribute Format.Field constant identifying a field
      * @param fieldID integer constant identifying a field
@@ -147,7 +147,7 @@
 
     /**
      * Returns the field identifier as an attribute constant
-     * from one of the <code>Field</code> subclasses. May return null if
+     * from one of the {@code Field} subclasses. May return null if
      * the field is specified only by an integer field ID.
      *
      * @return Identifier for the field
@@ -206,7 +206,7 @@
     }
 
     /**
-     * Returns a <code>Format.FieldDelegate</code> instance that is associated
+     * Returns a {@code Format.FieldDelegate} instance that is associated
      * with the FieldPosition. When the delegate is notified of the same
      * field the FieldPosition is associated with, the begin/end will be
      * adjusted.
@@ -258,8 +258,8 @@
 
 
     /**
-     * Return true if the receiver wants a <code>Format.Field</code> value and
-     * <code>attribute</code> is equal to it.
+     * Return true if the receiver wants a {@code Format.Field} value and
+     * {@code attribute} is equal to it.
      */
     private boolean matchesField(Format.Field attribute) {
         if (this.attribute != null) {
@@ -269,9 +269,9 @@
     }
 
     /**
-     * Return true if the receiver wants a <code>Format.Field</code> value and
-     * <code>attribute</code> is equal to it, or true if the receiver
-     * represents an inteter constant and <code>field</code> equals it.
+     * Return true if the receiver wants a {@code Format.Field} value and
+     * {@code attribute} is equal to it, or true if the receiver
+     * represents an inteter constant and {@code field} equals it.
      */
     private boolean matchesField(Format.Field attribute, int field) {
         if (this.attribute != null) {
@@ -289,7 +289,7 @@
     private class Delegate implements Format.FieldDelegate {
         /**
          * Indicates whether the field has been  encountered before. If this
-         * is true, and <code>formatted</code> is invoked, the begin/end
+         * is true, and {@code formatted} is invoked, the begin/end
          * are not updated.
          */
         private boolean encounteredField;
--- a/src/java.base/share/classes/java/text/Format.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/Format.java	Wed Sep 25 22:40:41 2019 +0200
@@ -41,64 +41,64 @@
 import java.io.Serializable;
 
 /**
- * <code>Format</code> is an abstract base class for formatting locale-sensitive
+ * {@code Format} is an abstract base class for formatting locale-sensitive
  * information such as dates, messages, and numbers.
  *
  * <p>
- * <code>Format</code> defines the programming interface for formatting
- * locale-sensitive objects into <code>String</code>s (the
- * <code>format</code> method) and for parsing <code>String</code>s back
- * into objects (the <code>parseObject</code> method).
+ * {@code Format} defines the programming interface for formatting
+ * locale-sensitive objects into {@code String}s (the
+ * {@code format} method) and for parsing {@code String}s back
+ * into objects (the {@code parseObject} method).
  *
  * <p>
- * Generally, a format's <code>parseObject</code> method must be able to parse
- * any string formatted by its <code>format</code> method. However, there may
+ * Generally, a format's {@code parseObject} method must be able to parse
+ * any string formatted by its {@code format} method. However, there may
  * be exceptional cases where this is not possible. For example, a
- * <code>format</code> method might create two adjacent integer numbers with
- * no separator in between, and in this case the <code>parseObject</code> could
+ * {@code format} method might create two adjacent integer numbers with
+ * no separator in between, and in this case the {@code parseObject} could
  * not tell which digits belong to which number.
  *
  * <h2>Subclassing</h2>
  *
  * <p>
- * The Java Platform provides three specialized subclasses of <code>Format</code>--
- * <code>DateFormat</code>, <code>MessageFormat</code>, and
- * <code>NumberFormat</code>--for formatting dates, messages, and numbers,
+ * The Java Platform provides three specialized subclasses of {@code Format}--
+ * {@code DateFormat}, {@code MessageFormat}, and
+ * {@code NumberFormat}--for formatting dates, messages, and numbers,
  * respectively.
  * <p>
  * Concrete subclasses must implement three methods:
  * <ol>
- * <li> <code>format(Object obj, StringBuffer toAppendTo, FieldPosition pos)</code>
- * <li> <code>formatToCharacterIterator(Object obj)</code>
- * <li> <code>parseObject(String source, ParsePosition pos)</code>
+ * <li> {@code format(Object obj, StringBuffer toAppendTo, FieldPosition pos)}
+ * <li> {@code formatToCharacterIterator(Object obj)}
+ * <li> {@code parseObject(String source, ParsePosition pos)}
  * </ol>
  * These general methods allow polymorphic parsing and formatting of objects
- * and are used, for example, by <code>MessageFormat</code>.
- * Subclasses often also provide additional <code>format</code> methods for
- * specific input types as well as <code>parse</code> methods for specific
- * result types. Any <code>parse</code> method that does not take a
- * <code>ParsePosition</code> argument should throw <code>ParseException</code>
+ * and are used, for example, by {@code MessageFormat}.
+ * Subclasses often also provide additional {@code format} methods for
+ * specific input types as well as {@code parse} methods for specific
+ * result types. Any {@code parse} method that does not take a
+ * {@code ParsePosition} argument should throw {@code ParseException}
  * when no text in the required format is at the beginning of the input text.
  *
  * <p>
  * Most subclasses will also implement the following factory methods:
  * <ol>
  * <li>
- * <code>getInstance</code> for getting a useful format object appropriate
+ * {@code getInstance} for getting a useful format object appropriate
  * for the current locale
  * <li>
- * <code>getInstance(Locale)</code> for getting a useful format
+ * {@code getInstance(Locale)} for getting a useful format
  * object appropriate for the specified locale
  * </ol>
  * In addition, some subclasses may also implement other
- * <code>getXxxxInstance</code> methods for more specialized control. For
- * example, the <code>NumberFormat</code> class provides
- * <code>getPercentInstance</code> and <code>getCurrencyInstance</code>
+ * {@code getXxxxInstance} methods for more specialized control. For
+ * example, the {@code NumberFormat} class provides
+ * {@code getPercentInstance} and {@code getCurrencyInstance}
  * methods for getting specialized number formatters.
  *
  * <p>
- * Subclasses of <code>Format</code> that allow programmers to create objects
- * for locales (with <code>getInstance(Locale)</code> for example)
+ * Subclasses of {@code Format} that allow programmers to create objects
+ * for locales (with {@code getInstance(Locale)} for example)
  * must also implement the following class method:
  * <blockquote>
  * <pre>
@@ -112,7 +112,7 @@
  * object which identifies what information is contained in the field and its
  * position in the formatted result. These constants should be named
  * <code><em>item</em>_FIELD</code> where <code><em>item</em></code> identifies
- * the field. For examples of these constants, see <code>ERA_FIELD</code> and its
+ * the field. For examples of these constants, see {@code ERA_FIELD} and its
  * friends in {@link DateFormat}.
  *
  * <h3><a id="synchronization">Synchronization</a></h3>
@@ -162,18 +162,18 @@
     /**
      * Formats an object and appends the resulting text to a given string
      * buffer.
-     * If the <code>pos</code> argument identifies a field used by the format,
+     * If the {@code pos} argument identifies a field used by the format,
      * then its indices are set to the beginning and end of the first such
      * field encountered.
      *
      * @param obj    The object to format
      * @param toAppendTo    where the text is to be appended
-     * @param pos    A <code>FieldPosition</code> identifying a field
+     * @param pos    A {@code FieldPosition} identifying a field
      *               in the formatted text
-     * @return       the string buffer passed in as <code>toAppendTo</code>,
+     * @return       the string buffer passed in as {@code toAppendTo},
      *               with formatted text appended
-     * @throws    NullPointerException if <code>toAppendTo</code> or
-     *            <code>pos</code> is null
+     * @throws    NullPointerException if {@code toAppendTo} or
+     *            {@code pos} is null
      * @throws    IllegalArgumentException if the Format cannot format the given
      *            object
      */
@@ -182,20 +182,20 @@
                     FieldPosition pos);
 
     /**
-     * Formats an Object producing an <code>AttributedCharacterIterator</code>.
-     * You can use the returned <code>AttributedCharacterIterator</code>
+     * Formats an Object producing an {@code AttributedCharacterIterator}.
+     * You can use the returned {@code AttributedCharacterIterator}
      * to build the resulting String, as well as to determine information
      * about the resulting String.
      * <p>
      * Each attribute key of the AttributedCharacterIterator will be of type
-     * <code>Field</code>. It is up to each <code>Format</code> implementation
+     * {@code Field}. It is up to each {@code Format} implementation
      * to define what the legal values are for each attribute in the
-     * <code>AttributedCharacterIterator</code>, but typically the attribute
+     * {@code AttributedCharacterIterator}, but typically the attribute
      * key is also used as the attribute value.
      * <p>The default implementation creates an
-     * <code>AttributedCharacterIterator</code> with no attributes. Subclasses
+     * {@code AttributedCharacterIterator} with no attributes. Subclasses
      * that support fields should override this and create an
-     * <code>AttributedCharacterIterator</code> with meaningful attributes.
+     * {@code AttributedCharacterIterator} with meaningful attributes.
      *
      * @throws    NullPointerException if obj is null.
      * @throws    IllegalArgumentException when the Format cannot format the
@@ -212,20 +212,20 @@
      * Parses text from a string to produce an object.
      * <p>
      * The method attempts to parse text starting at the index given by
-     * <code>pos</code>.
-     * If parsing succeeds, then the index of <code>pos</code> is updated
+     * {@code pos}.
+     * If parsing succeeds, then the index of {@code pos} is updated
      * to the index after the last character used (parsing does not necessarily
      * use all characters up to the end of the string), and the parsed
-     * object is returned. The updated <code>pos</code> can be used to
+     * object is returned. The updated {@code pos} can be used to
      * indicate the starting point for the next call to this method.
-     * If an error occurs, then the index of <code>pos</code> is not
-     * changed, the error index of <code>pos</code> is set to the index of
+     * If an error occurs, then the index of {@code pos} is not
+     * changed, the error index of {@code pos} is set to the index of
      * the character where the error occurred, and null is returned.
      *
-     * @param source A <code>String</code>, part of which should be parsed.
-     * @param pos A <code>ParsePosition</code> object with index and error
+     * @param source A {@code String}, part of which should be parsed.
+     * @param pos A {@code ParsePosition} object with index and error
      *            index information as described above.
-     * @return An <code>Object</code> parsed from the string. In case of
+     * @return An {@code Object} parsed from the string. In case of
      *         error, returns null.
      * @throws NullPointerException if {@code source} or {@code pos} is null.
      */
@@ -235,8 +235,8 @@
      * Parses text from the beginning of the given string to produce an object.
      * The method may not use the entire text of the given string.
      *
-     * @param source A <code>String</code> whose beginning should be parsed.
-     * @return An <code>Object</code> parsed from the string.
+     * @param source A {@code String} whose beginning should be parsed.
+     * @return An {@code Object} parsed from the string.
      * @throws    ParseException if the beginning of the specified string
      *            cannot be parsed.
      * @throws NullPointerException if {@code source} is null.
@@ -271,8 +271,8 @@
     //
 
     /**
-     * Creates an <code>AttributedCharacterIterator</code> for the String
-     * <code>s</code>.
+     * Creates an {@code AttributedCharacterIterator} for the String
+     * {@code s}.
      *
      * @param s String to create AttributedCharacterIterator from
      * @return AttributedCharacterIterator wrapping s
@@ -284,9 +284,9 @@
     }
 
     /**
-     * Creates an <code>AttributedCharacterIterator</code> containing the
+     * Creates an {@code AttributedCharacterIterator} containing the
      * concatenated contents of the passed in
-     * <code>AttributedCharacterIterator</code>s.
+     * {@code AttributedCharacterIterator}s.
      *
      * @param iterators AttributedCharacterIterators used to create resulting
      *                  AttributedCharacterIterators
@@ -302,8 +302,8 @@
 
     /**
      * Returns an AttributedCharacterIterator with the String
-     * <code>string</code> and additional key/value pair <code>key</code>,
-     * <code>value</code>.
+     * {@code string} and additional key/value pair {@code key},
+     * {@code value}.
      *
      * @param string String to create AttributedCharacterIterator from
      * @param key Key for AttributedCharacterIterator
@@ -321,8 +321,8 @@
 
     /**
      * Creates an AttributedCharacterIterator with the contents of
-     * <code>iterator</code> and the additional attribute <code>key</code>
-     * <code>value</code>.
+     * {@code iterator} and the additional attribute {@code key}
+     * {@code value}.
      *
      * @param iterator Initial AttributedCharacterIterator to add arg to
      * @param key Key for AttributedCharacterIterator
@@ -341,9 +341,9 @@
 
     /**
      * Defines constants that are used as attribute keys in the
-     * <code>AttributedCharacterIterator</code> returned
-     * from <code>Format.formatToCharacterIterator</code> and as
-     * field identifiers in <code>FieldPosition</code>.
+     * {@code AttributedCharacterIterator} returned
+     * from {@code Format.formatToCharacterIterator} and as
+     * field identifiers in {@code FieldPosition}.
      *
      * @since 1.4
      */
@@ -365,13 +365,13 @@
 
 
     /**
-     * FieldDelegate is notified by the various <code>Format</code>
+     * FieldDelegate is notified by the various {@code Format}
      * implementations as they are formatting the Objects. This allows for
      * storage of the individual sections of the formatted String for
-     * later use, such as in a <code>FieldPosition</code> or for an
-     * <code>AttributedCharacterIterator</code>.
+     * later use, such as in a {@code FieldPosition} or for an
+     * {@code AttributedCharacterIterator}.
      * <p>
-     * Delegates should NOT assume that the <code>Format</code> will notify
+     * Delegates should NOT assume that the {@code Format} will notify
      * the delegate of fields in any particular order.
      *
      * @see FieldPosition#getFieldDelegate
@@ -381,7 +381,7 @@
         /**
          * Notified when a particular region of the String is formatted. This
          * method will be invoked if there is no corresponding integer field id
-         * matching <code>attr</code>.
+         * matching {@code attr}.
          *
          * @param attr Identifies the field matched
          * @param value Value associated with the field
--- a/src/java.base/share/classes/java/text/MessageFormat.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/MessageFormat.java	Wed Sep 25 22:40:41 2019 +0200
@@ -50,27 +50,27 @@
 
 
 /**
- * <code>MessageFormat</code> provides a means to produce concatenated
+ * {@code MessageFormat} provides a means to produce concatenated
  * messages in a language-neutral way. Use this to construct messages
  * displayed for end users.
  *
  * <p>
- * <code>MessageFormat</code> takes a set of objects, formats them, then
+ * {@code MessageFormat} takes a set of objects, formats them, then
  * inserts the formatted strings into the pattern at the appropriate places.
  *
  * <p>
  * <strong>Note:</strong>
- * <code>MessageFormat</code> differs from the other <code>Format</code>
- * classes in that you create a <code>MessageFormat</code> object with one
- * of its constructors (not with a <code>getInstance</code> style factory
- * method). The factory methods aren't necessary because <code>MessageFormat</code>
+ * {@code MessageFormat} differs from the other {@code Format}
+ * classes in that you create a {@code MessageFormat} object with one
+ * of its constructors (not with a {@code getInstance} style factory
+ * method). The factory methods aren't necessary because {@code MessageFormat}
  * itself doesn't implement locale specific behavior. Any locale specific
  * behavior is defined by the pattern that you provide as well as the
  * subformats used for inserted arguments.
  *
  * <h2><a id="patterns">Patterns and Their Interpretation</a></h2>
  *
- * <code>MessageFormat</code> uses patterns of the following form:
+ * {@code MessageFormat} uses patterns of the following form:
  * <blockquote><pre>
  * <i>MessageFormatPattern:</i>
  *         <i>String</i>
@@ -102,7 +102,7 @@
  * must be represented by doubled single quotes {@code ''} throughout a
  * <i>String</i>.  For example, pattern string <code>"'{''}'"</code> is
  * interpreted as a sequence of <code>'{</code> (start of quoting and a
- * left curly brace), <code>''</code> (a single quote), and
+ * left curly brace), {@code ''} (a single quote), and
  * <code>}'</code> (a right curly brace and end of quoting),
  * <em>not</em> <code>'{'</code> and <code>'}'</code> (quoted left and
  * right curly braces): representing string <code>"{'}"</code>,
@@ -228,8 +228,8 @@
  * static strings will, of course, be obtained from resource bundles.
  * Other parameters will be dynamically determined at runtime.
  * <p>
- * The first example uses the static method <code>MessageFormat.format</code>,
- * which internally creates a <code>MessageFormat</code> for one-time use:
+ * The first example uses the static method {@code MessageFormat.format},
+ * which internally creates a {@code MessageFormat} for one-time use:
  * <blockquote><pre>
  * int planet = 7;
  * String event = "a disturbance in the Force";
@@ -244,7 +244,7 @@
  * </pre></blockquote>
  *
  * <p>
- * The following example creates a <code>MessageFormat</code> instance that
+ * The following example creates a {@code MessageFormat} instance that
  * can be used repeatedly:
  * <blockquote><pre>
  * int fileCount = 1273;
@@ -256,7 +256,7 @@
  *
  * System.out.println(form.format(testArgs));
  * </pre></blockquote>
- * The output with different values for <code>fileCount</code>:
+ * The output with different values for {@code fileCount}:
  * <blockquote><pre>
  * The disk "MyDisk" contains 0 file(s).
  * The disk "MyDisk" contains 1 file(s).
@@ -264,7 +264,7 @@
  * </pre></blockquote>
  *
  * <p>
- * For more sophisticated patterns, you can use a <code>ChoiceFormat</code>
+ * For more sophisticated patterns, you can use a {@code ChoiceFormat}
  * to produce correct forms for singular and plural:
  * <blockquote><pre>
  * MessageFormat form = new MessageFormat("The disk \"{1}\" contains {0}.");
@@ -279,7 +279,7 @@
  *
  * System.out.println(form.format(testArgs));
  * </pre></blockquote>
- * The output with different values for <code>fileCount</code>:
+ * The output with different values for {@code fileCount}:
  * <blockquote><pre>
  * The disk "MyDisk" contains no files.
  * The disk "MyDisk" contains one file.
@@ -287,7 +287,7 @@
  * </pre></blockquote>
  *
  * <p>
- * You can create the <code>ChoiceFormat</code> programmatically, as in the
+ * You can create the {@code ChoiceFormat} programmatically, as in the
  * above example, or by using a pattern. See {@link ChoiceFormat}
  * for more information.
  * <blockquote><pre>{@code
@@ -297,9 +297,9 @@
  *
  * <p>
  * <strong>Note:</strong> As we see above, the string produced
- * by a <code>ChoiceFormat</code> in <code>MessageFormat</code> is treated as special;
+ * by a {@code ChoiceFormat} in {@code MessageFormat} is treated as special;
  * occurrences of '{' are used to indicate subformats, and cause recursion.
- * If you create both a <code>MessageFormat</code> and <code>ChoiceFormat</code>
+ * If you create both a {@code MessageFormat} and {@code ChoiceFormat}
  * programmatically (instead of using the string patterns), then be careful not to
  * produce a format that recurses on itself, which will cause an infinite loop.
  * <p>
@@ -398,8 +398,8 @@
      * <li>to the {@link #applyPattern applyPattern}
      *     and {@link #toPattern toPattern} methods if format elements specify
      *     a format type and therefore have the subformats created in the
-     *     <code>applyPattern</code> method, as well as
-     * <li>to the <code>format</code> and
+     *     {@code applyPattern} method, as well as
+     * <li>to the {@code format} and
      *     {@link #formatToCharacterIterator formatToCharacterIterator} methods
      *     if format elements do not specify a format type and therefore have
      *     the subformats created in the formatting methods.
@@ -596,14 +596,14 @@
 
     /**
      * Sets the formats to use for the values passed into
-     * <code>format</code> methods or returned from <code>parse</code>
-     * methods. The indices of elements in <code>newFormats</code>
+     * {@code format} methods or returned from {@code parse}
+     * methods. The indices of elements in {@code newFormats}
      * correspond to the argument indices used in the previously set
      * pattern string.
-     * The order of formats in <code>newFormats</code> thus corresponds to
-     * the order of elements in the <code>arguments</code> array passed
-     * to the <code>format</code> methods or the result array returned
-     * by the <code>parse</code> methods.
+     * The order of formats in {@code newFormats} thus corresponds to
+     * the order of elements in the {@code arguments} array passed
+     * to the {@code format} methods or the result array returned
+     * by the {@code parse} methods.
      * <p>
      * If an argument index is used for more than one format element
      * in the pattern string, then the corresponding new format is used
@@ -611,10 +611,10 @@
      * for any format element in the pattern string, then the
      * corresponding new format is ignored. If fewer formats are provided
      * than needed, then only the formats for argument indices less
-     * than <code>newFormats.length</code> are replaced.
+     * than {@code newFormats.length} are replaced.
      *
      * @param newFormats the new formats to use
-     * @throws    NullPointerException if <code>newFormats</code> is null
+     * @throws    NullPointerException if {@code newFormats} is null
      * @since 1.4
      */
     public void setFormatsByArgumentIndex(Format[] newFormats) {
@@ -629,24 +629,24 @@
     /**
      * Sets the formats to use for the format elements in the
      * previously set pattern string.
-     * The order of formats in <code>newFormats</code> corresponds to
+     * The order of formats in {@code newFormats} corresponds to
      * the order of format elements in the pattern string.
      * <p>
      * If more formats are provided than needed by the pattern string,
      * the remaining ones are ignored. If fewer formats are provided
-     * than needed, then only the first <code>newFormats.length</code>
+     * than needed, then only the first {@code newFormats.length}
      * formats are replaced.
      * <p>
      * Since the order of format elements in a pattern string often
      * changes during localization, it is generally better to use the
      * {@link #setFormatsByArgumentIndex setFormatsByArgumentIndex}
      * method, which assumes an order of formats corresponding to the
-     * order of elements in the <code>arguments</code> array passed to
-     * the <code>format</code> methods or the result array returned by
-     * the <code>parse</code> methods.
+     * order of elements in the {@code arguments} array passed to
+     * the {@code format} methods or the result array returned by
+     * the {@code parse} methods.
      *
      * @param newFormats the new formats to use
-     * @throws    NullPointerException if <code>newFormats</code> is null
+     * @throws    NullPointerException if {@code newFormats} is null
      */
     public void setFormats(Format[] newFormats) {
         int runsToCopy = newFormats.length;
@@ -663,9 +663,9 @@
      * previously set pattern string that use the given argument
      * index.
      * The argument index is part of the format element definition and
-     * represents an index into the <code>arguments</code> array passed
-     * to the <code>format</code> methods or the result array returned
-     * by the <code>parse</code> methods.
+     * represents an index into the {@code arguments} array passed
+     * to the {@code format} methods or the result array returned
+     * by the {@code parse} methods.
      * <p>
      * If the argument index is used for more than one format element
      * in the pattern string, then the new format is used for all such
@@ -711,14 +711,14 @@
 
     /**
      * Gets the formats used for the values passed into
-     * <code>format</code> methods or returned from <code>parse</code>
+     * {@code format} methods or returned from {@code parse}
      * methods. The indices of elements in the returned array
      * correspond to the argument indices used in the previously set
      * pattern string.
      * The order of formats in the returned array thus corresponds to
-     * the order of elements in the <code>arguments</code> array passed
-     * to the <code>format</code> methods or the result array returned
-     * by the <code>parse</code> methods.
+     * the order of elements in the {@code arguments} array passed
+     * to the {@code format} methods or the result array returned
+     * by the {@code parse} methods.
      * <p>
      * If an argument index is used for more than one format element
      * in the pattern string, then the format used for the last such
@@ -753,9 +753,9 @@
      * changes during localization, it's generally better to use the
      * {@link #getFormatsByArgumentIndex getFormatsByArgumentIndex}
      * method, which assumes an order of formats corresponding to the
-     * order of elements in the <code>arguments</code> array passed to
-     * the <code>format</code> methods or the result array returned by
-     * the <code>parse</code> methods.
+     * order of elements in the {@code arguments} array passed to
+     * the {@code format} methods or the result array returned by
+     * the {@code parse} methods.
      *
      * @return the formats used for the format elements in the pattern
      */
@@ -766,16 +766,16 @@
     }
 
     /**
-     * Formats an array of objects and appends the <code>MessageFormat</code>'s
+     * Formats an array of objects and appends the {@code MessageFormat}'s
      * pattern, with format elements replaced by the formatted objects, to the
-     * provided <code>StringBuffer</code>.
+     * provided {@code StringBuffer}.
      * <p>
      * The text substituted for the individual format elements is derived from
      * the current subformat of the format element and the
-     * <code>arguments</code> element at the format element's argument index
+     * {@code arguments} element at the format element's argument index
      * as indicated by the first matching line of the following table. An
-     * argument is <i>unavailable</i> if <code>arguments</code> is
-     * <code>null</code> or has fewer than argumentIndex+1 elements.
+     * argument is <i>unavailable</i> if {@code arguments} is
+     * {@code null} or has fewer than argumentIndex+1 elements.
      *
      * <table class="plain">
      * <caption style="display:none">Examples of subformat,argument,and formatted text</caption>
@@ -791,36 +791,36 @@
      *       <th scope="row" style="text-weight-normal"><i>unavailable</i>
      *       <td><code>"{" + argumentIndex + "}"</code>
      *    <tr>
-     *       <th scope="row" style="text-weight-normal"><code>null</code>
-     *       <td><code>"null"</code>
+     *       <th scope="row" style="text-weight-normal">{@code null}
+     *       <td>{@code "null"}
      *    <tr>
-     *       <th scope="row" style="text-weight-normal"><code>instanceof ChoiceFormat</code>
+     *       <th scope="row" style="text-weight-normal">{@code instanceof ChoiceFormat}
      *       <th scope="row" style="text-weight-normal"><i>any</i>
      *       <td><code>subformat.format(argument).indexOf('{') &gt;= 0 ?<br>
      *           (new MessageFormat(subformat.format(argument), getLocale())).format(argument) :
      *           subformat.format(argument)</code>
      *    <tr>
-     *       <th scope="row" style="text-weight-normal"><code>!= null</code>
+     *       <th scope="row" style="text-weight-normal">{@code != null}
      *       <th scope="row" style="text-weight-normal"><i>any</i>
-     *       <td><code>subformat.format(argument)</code>
+     *       <td>{@code subformat.format(argument)}
      *    <tr>
-     *       <th scope="row" style="text-weight-normal" rowspan=4><code>null</code>
-     *       <th scope="row" style="text-weight-normal"><code>instanceof Number</code>
-     *       <td><code>NumberFormat.getInstance(getLocale()).format(argument)</code>
+     *       <th scope="row" style="text-weight-normal" rowspan=4>{@code null}
+     *       <th scope="row" style="text-weight-normal">{@code instanceof Number}
+     *       <td>{@code NumberFormat.getInstance(getLocale()).format(argument)}
      *    <tr>
-     *       <th scope="row" style="text-weight-normal"><code>instanceof Date</code>
-     *       <td><code>DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, getLocale()).format(argument)</code>
+     *       <th scope="row" style="text-weight-normal">{@code instanceof Date}
+     *       <td>{@code DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, getLocale()).format(argument)}
      *    <tr>
-     *       <th scope="row" style="text-weight-normal"><code>instanceof String</code>
-     *       <td><code>argument</code>
+     *       <th scope="row" style="text-weight-normal">{@code instanceof String}
+     *       <td>{@code argument}
      *    <tr>
      *       <th scope="row" style="text-weight-normal"><i>any</i>
-     *       <td><code>argument.toString()</code>
+     *       <td>{@code argument.toString()}
      * </tbody>
      * </table>
      * <p>
-     * If <code>pos</code> is non-null, and refers to
-     * <code>Field.ARGUMENT</code>, the location of the first formatted
+     * If {@code pos} is non-null, and refers to
+     * {@code Field.ARGUMENT}, the location of the first formatted
      * string will be returned.
      *
      * @param arguments an array of objects to be formatted and substituted.
@@ -830,7 +830,7 @@
      * @return the string buffer passed in as {@code result}, with formatted
      * text appended
      * @throws    IllegalArgumentException if an argument in the
-     *            <code>arguments</code> array is not of the type
+     *            {@code arguments} array is not of the type
      *            expected by the format element(s) that use it.
      * @throws    NullPointerException if {@code result} is {@code null}
      */
@@ -851,7 +851,7 @@
      * @param arguments object(s) to format
      * @return the formatted string
      * @throws    IllegalArgumentException if the pattern is invalid,
-     *            or if an argument in the <code>arguments</code> array
+     *            or if an argument in the {@code arguments} array
      *            is not of the type expected by the format element(s)
      *            that use it.
      * @throws    NullPointerException if {@code pattern} is {@code null}
@@ -863,9 +863,9 @@
 
     // Overrides
     /**
-     * Formats an array of objects and appends the <code>MessageFormat</code>'s
+     * Formats an array of objects and appends the {@code MessageFormat}'s
      * pattern, with format elements replaced by the formatted objects, to the
-     * provided <code>StringBuffer</code>.
+     * provided {@code StringBuffer}.
      * This is equivalent to
      * <blockquote>
      *     <code>{@link #format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition) format}((Object[]) arguments, result, pos)</code>
@@ -876,7 +876,7 @@
      * @param pos keeps track on the position of the first replaced argument
      *            in the output string.
      * @throws    IllegalArgumentException if an argument in the
-     *            <code>arguments</code> array is not of the type
+     *            {@code arguments} array is not of the type
      *            expected by the format element(s) that use it.
      * @throws    NullPointerException if {@code result} is {@code null}
      */
@@ -888,36 +888,36 @@
 
     /**
      * Formats an array of objects and inserts them into the
-     * <code>MessageFormat</code>'s pattern, producing an
-     * <code>AttributedCharacterIterator</code>.
-     * You can use the returned <code>AttributedCharacterIterator</code>
+     * {@code MessageFormat}'s pattern, producing an
+     * {@code AttributedCharacterIterator}.
+     * You can use the returned {@code AttributedCharacterIterator}
      * to build the resulting String, as well as to determine information
      * about the resulting String.
      * <p>
-     * The text of the returned <code>AttributedCharacterIterator</code> is
+     * The text of the returned {@code AttributedCharacterIterator} is
      * the same that would be returned by
      * <blockquote>
      *     <code>{@link #format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition) format}(arguments, new StringBuffer(), null).toString()</code>
      * </blockquote>
      * <p>
-     * In addition, the <code>AttributedCharacterIterator</code> contains at
+     * In addition, the {@code AttributedCharacterIterator} contains at
      * least attributes indicating where text was generated from an
-     * argument in the <code>arguments</code> array. The keys of these attributes are of
-     * type <code>MessageFormat.Field</code>, their values are
-     * <code>Integer</code> objects indicating the index in the <code>arguments</code>
+     * argument in the {@code arguments} array. The keys of these attributes are of
+     * type {@code MessageFormat.Field}, their values are
+     * {@code Integer} objects indicating the index in the {@code arguments}
      * array of the argument from which the text was generated.
      * <p>
-     * The attributes/value from the underlying <code>Format</code>
-     * instances that <code>MessageFormat</code> uses will also be
-     * placed in the resulting <code>AttributedCharacterIterator</code>.
+     * The attributes/value from the underlying {@code Format}
+     * instances that {@code MessageFormat} uses will also be
+     * placed in the resulting {@code AttributedCharacterIterator}.
      * This allows you to not only find where an argument is placed in the
      * resulting String, but also which fields it contains in turn.
      *
      * @param arguments an array of objects to be formatted and substituted.
      * @return AttributedCharacterIterator describing the formatted value.
-     * @throws    NullPointerException if <code>arguments</code> is null.
+     * @throws    NullPointerException if {@code arguments} is null.
      * @throws    IllegalArgumentException if an argument in the
-     *            <code>arguments</code> array is not of the type
+     *            {@code arguments} array is not of the type
      *            expected by the format element(s) that use it.
      * @since 1.4
      */
@@ -1055,8 +1055,8 @@
      * See the {@link #parse(String, ParsePosition)} method for more information
      * on message parsing.
      *
-     * @param source A <code>String</code> whose beginning should be parsed.
-     * @return An <code>Object</code> array parsed from the string.
+     * @param source A {@code String} whose beginning should be parsed.
+     * @return An {@code Object} array parsed from the string.
      * @throws    ParseException if the beginning of the specified string
      *            cannot be parsed.
      */
@@ -1073,23 +1073,23 @@
      * Parses text from a string to produce an object array.
      * <p>
      * The method attempts to parse text starting at the index given by
-     * <code>pos</code>.
-     * If parsing succeeds, then the index of <code>pos</code> is updated
+     * {@code pos}.
+     * If parsing succeeds, then the index of {@code pos} is updated
      * to the index after the last character used (parsing does not necessarily
      * use all characters up to the end of the string), and the parsed
-     * object array is returned. The updated <code>pos</code> can be used to
+     * object array is returned. The updated {@code pos} can be used to
      * indicate the starting point for the next call to this method.
-     * If an error occurs, then the index of <code>pos</code> is not
-     * changed, the error index of <code>pos</code> is set to the index of
+     * If an error occurs, then the index of {@code pos} is not
+     * changed, the error index of {@code pos} is set to the index of
      * the character where the error occurred, and null is returned.
      * <p>
      * See the {@link #parse(String, ParsePosition)} method for more information
      * on message parsing.
      *
-     * @param source A <code>String</code>, part of which should be parsed.
-     * @param pos A <code>ParsePosition</code> object with index and error
+     * @param source A {@code String}, part of which should be parsed.
+     * @param pos A {@code ParsePosition} object with index and error
      *            index information as described above.
-     * @return An <code>Object</code> array parsed from the string. In case of
+     * @return An {@code Object} array parsed from the string. In case of
      *         error, returns null.
      * @throws NullPointerException if {@code pos} is null.
      */
@@ -1146,8 +1146,8 @@
 
     /**
      * Defines constants that are used as attribute keys in the
-     * <code>AttributedCharacterIterator</code> returned
-     * from <code>MessageFormat.formatToCharacterIterator</code>.
+     * {@code AttributedCharacterIterator} returned
+     * from {@code MessageFormat.formatToCharacterIterator}.
      *
      * @since 1.4
      */
@@ -1188,9 +1188,9 @@
 
         /**
          * Constant identifying a portion of a message that was generated
-         * from an argument passed into <code>formatToCharacterIterator</code>.
-         * The value associated with the key will be an <code>Integer</code>
-         * indicating the index in the <code>arguments</code> array of the
+         * from an argument passed into {@code formatToCharacterIterator}.
+         * The value associated with the key will be an {@code Integer}
+         * indicating the index in the {@code arguments} array of the
          * argument from which the text was generated.
          */
         public static final Field ARGUMENT =
@@ -1237,9 +1237,9 @@
     private int[] argumentNumbers = new int[INITIAL_FORMATS];
 
     /**
-     * One less than the number of entries in <code>offsets</code>.  Can also be thought of
-     * as the index of the highest-numbered element in <code>offsets</code> that is being used.
-     * All of these arrays should have the same number of elements being used as <code>offsets</code>
+     * One less than the number of entries in {@code offsets}.  Can also be thought of
+     * as the index of the highest-numbered element in {@code offsets} that is being used.
+     * All of these arrays should have the same number of elements being used as {@code offsets}
      * does, and so this variable suffices to tell us how many entries are in all of them.
      * @serial
      */
@@ -1254,7 +1254,7 @@
      * the first replaced argument will be set in it.
      *
      * @throws    IllegalArgumentException if an argument in the
-     *            <code>arguments</code> array is not of the type
+     *            {@code arguments} array is not of the type
      *            expected by the format element(s) that use it.
      */
     private StringBuffer subformat(Object[] arguments, StringBuffer result,
@@ -1367,7 +1367,7 @@
 
     /**
      * Convenience method to append all the characters in
-     * <code>iterator</code> to the StringBuffer <code>result</code>.
+     * {@code iterator} to the StringBuffer {@code result}.
      */
     private void append(StringBuffer result, CharacterIterator iterator) {
         if (iterator.first() != CharacterIterator.DONE) {
--- a/src/java.base/share/classes/java/text/Normalizer.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/Normalizer.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2015, 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
@@ -40,10 +40,10 @@
 import sun.text.normalizer.NormalizerBase;
 
 /**
- * This class provides the method <code>normalize</code> which transforms Unicode
+ * This class provides the method {@code normalize} which transforms Unicode
  * text into an equivalent composed or decomposed form, allowing for easier
  * sorting and searching of text.
- * The <code>normalize</code> method supports the standard normalization forms
+ * The {@code normalize} method supports the standard normalization forms
  * described in
  * <a href="http://www.unicode.org/unicode/reports/tr15/tr15-23.html">
  * Unicode Standard Annex #15 &mdash; Unicode Normalization Forms</a>.
@@ -88,12 +88,12 @@
  * into the corresponding semantic characters.  When sorting and searching, you
  * will often want to use these mappings.
  * <p>
- * The <code>normalize</code> method helps solve these problems by transforming
+ * The {@code normalize} method helps solve these problems by transforming
  * text into the canonical composed and decomposed forms as shown in the first
  * example above. In addition, you can have it perform compatibility
  * decompositions so that you can treat compatibility characters the same as
  * their equivalents.
- * Finally, the <code>normalize</code> method rearranges accents into the
+ * Finally, the {@code normalize} method rearranges accents into the
  * proper canonical order, so that you do not have to worry about accent
  * rearrangement on your own.
  * <p>
@@ -152,7 +152,7 @@
      *                   {@link java.text.Normalizer.Form#NFKC},
      *                   {@link java.text.Normalizer.Form#NFKD}
      * @return The normalized String
-     * @throws NullPointerException If <code>src</code> or <code>form</code>
+     * @throws NullPointerException If {@code src} or {@code form}
      * is null.
      */
     public static String normalize(CharSequence src, Form form) {
@@ -169,7 +169,7 @@
      *                   {@link java.text.Normalizer.Form#NFKD}
      * @return true if the sequence of char values is normalized;
      * false otherwise.
-     * @throws NullPointerException If <code>src</code> or <code>form</code>
+     * @throws NullPointerException If {@code src} or {@code form}
      * is null.
      */
     public static boolean isNormalized(CharSequence src, Form form) {
--- a/src/java.base/share/classes/java/text/NumberFormat.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/NumberFormat.java	Wed Sep 25 22:40:41 2019 +0200
@@ -56,13 +56,13 @@
 import sun.util.locale.provider.LocaleServiceProviderPool;
 
 /**
- * <code>NumberFormat</code> is the abstract base class for all number
+ * {@code NumberFormat} is the abstract base class for all number
  * formats. This class provides the interface for formatting and parsing
- * numbers. <code>NumberFormat</code> also provides methods for determining
+ * numbers. {@code NumberFormat} also provides methods for determining
  * which locales have number formats, and what their names are.
  *
  * <p>
- * <code>NumberFormat</code> helps you to format and parse numbers for any locale.
+ * {@code NumberFormat} helps you to format and parse numbers for any locale.
  * Your code can be completely independent of the locale conventions for
  * decimal points, thousands-separators, or even the particular decimal
  * digits used, or whether the number format is even decimal.
@@ -88,7 +88,7 @@
  * }</pre>
  * </blockquote>
  * To format a number for a different Locale, specify it in the
- * call to <code>getInstance</code>.
+ * call to {@code getInstance}.
  * <blockquote>
  * <pre>{@code
  * NumberFormat nf = NumberFormat.getInstance(Locale.FRENCH);
@@ -107,25 +107,25 @@
  * myNumber = nf.parse(myString);
  * }</pre>
  * </blockquote>
- * Use <code>getInstance</code> or <code>getNumberInstance</code> to get the
- * normal number format. Use <code>getIntegerInstance</code> to get an
- * integer number format. Use <code>getCurrencyInstance</code> to get the
+ * Use {@code getInstance} or {@code getNumberInstance} to get the
+ * normal number format. Use {@code getIntegerInstance} to get an
+ * integer number format. Use {@code getCurrencyInstance} to get the
  * currency number format. Use {@code getCompactNumberInstance} to get the
  * compact number format to format a number in shorter form. For example,
  * {@code 2000} can be formatted as {@code "2K"} in
- * {@link java.util.Locale#US US locale}. Use <code>getPercentInstance</code>
+ * {@link java.util.Locale#US US locale}. Use {@code getPercentInstance}
  * to get a format for displaying percentages. With this format, a fraction
  * like 0.53 is displayed as 53%.
  *
  * <p>
  * You can also control the display of numbers with such methods as
- * <code>setMinimumFractionDigits</code>.
+ * {@code setMinimumFractionDigits}.
  * If you want even more control over the format or parsing,
  * or want to give your users more control,
- * you can try casting the <code>NumberFormat</code> you get from the factory methods
+ * you can try casting the {@code NumberFormat} you get from the factory methods
  * to a {@code DecimalFormat} or {@code CompactNumberFormat} depending on
  * the factory method used. This will work for the vast majority of locales;
- * just remember to put it in a <code>try</code> block in case you encounter
+ * just remember to put it in a {@code try} block in case you encounter
  * an unusual one.
  *
  * <p>
@@ -149,8 +149,8 @@
  * point, use setParseIntegerOnly.
  *
  * <p>
- * You can also use forms of the <code>parse</code> and <code>format</code>
- * methods with <code>ParsePosition</code> and <code>FieldPosition</code> to
+ * You can also use forms of the {@code parse} and {@code format}
+ * methods with {@code ParsePosition} and {@code FieldPosition} to
  * allow you to:
  * <ul>
  * <li> progressively parse through pieces of a string
@@ -159,15 +159,15 @@
  * For example, you can align numbers in two ways:
  * <ol>
  * <li> If you are using a monospaced font with spacing for alignment,
- *      you can pass the <code>FieldPosition</code> in your format call, with
- *      <code>field</code> = <code>INTEGER_FIELD</code>. On output,
- *      <code>getEndIndex</code> will be set to the offset between the
+ *      you can pass the {@code FieldPosition} in your format call, with
+ *      {@code field} = {@code INTEGER_FIELD}. On output,
+ *      {@code getEndIndex} will be set to the offset between the
  *      last character of the integer and the decimal. Add
  *      (desiredSpaceCount - getEndIndex) spaces at the front of the string.
  *
  * <li> If you are using proportional fonts,
  *      instead of padding with spaces, measure the width
- *      of the string in pixels from the start to <code>getEndIndex</code>.
+ *      of the string in pixels from the start to {@code getEndIndex}.
  *      Then move the pen by
  *      (desiredPixelWidth - widthToAlignmentPoint) before drawing the text.
  *      It also works where there is no decimal, but possibly additional
@@ -238,17 +238,17 @@
      * <p>
      * This implementation extracts the number's value using
      * {@link java.lang.Number#longValue()} for all integral type values that
-     * can be converted to <code>long</code> without loss of information,
-     * including <code>BigInteger</code> values with a
+     * can be converted to {@code long} without loss of information,
+     * including {@code BigInteger} values with a
      * {@link java.math.BigInteger#bitLength() bit length} of less than 64,
      * and {@link java.lang.Number#doubleValue()} for all other types. It
      * then calls
      * {@link #format(long,java.lang.StringBuffer,java.text.FieldPosition)}
      * or {@link #format(double,java.lang.StringBuffer,java.text.FieldPosition)}.
      * This may result in loss of magnitude information and precision for
-     * <code>BigInteger</code> and <code>BigDecimal</code> values.
+     * {@code BigInteger} and {@code BigDecimal} values.
      * @param number     the number to format
-     * @param toAppendTo the <code>StringBuffer</code> to which the formatted
+     * @param toAppendTo the {@code StringBuffer} to which the formatted
      *                   text is to be appended
      * @param pos        keeps track on the position of the field within the
      *                   returned string. For example, for formatting a number
@@ -258,11 +258,11 @@
      *                   and end index of {@code fieldPosition} will be set
      *                   to 0 and 9, respectively for the output string
      *                   {@code 1,234,567.89}.
-     * @return           the value passed in as <code>toAppendTo</code>
-     * @throws           IllegalArgumentException if <code>number</code> is
-     *                   null or not an instance of <code>Number</code>.
-     * @throws           NullPointerException if <code>toAppendTo</code> or
-     *                   <code>pos</code> is null
+     * @return           the value passed in as {@code toAppendTo}
+     * @throws           IllegalArgumentException if {@code number} is
+     *                   null or not an instance of {@code Number}.
+     * @throws           NullPointerException if {@code toAppendTo} or
+     *                   {@code pos} is null
      * @throws           ArithmeticException if rounding is needed with rounding
      *                   mode being set to RoundingMode.UNNECESSARY
      * @see              java.text.FieldPosition
@@ -285,26 +285,26 @@
     }
 
     /**
-     * Parses text from a string to produce a <code>Number</code>.
+     * Parses text from a string to produce a {@code Number}.
      * <p>
      * The method attempts to parse text starting at the index given by
-     * <code>pos</code>.
-     * If parsing succeeds, then the index of <code>pos</code> is updated
+     * {@code pos}.
+     * If parsing succeeds, then the index of {@code pos} is updated
      * to the index after the last character used (parsing does not necessarily
      * use all characters up to the end of the string), and the parsed
-     * number is returned. The updated <code>pos</code> can be used to
+     * number is returned. The updated {@code pos} can be used to
      * indicate the starting point for the next call to this method.
-     * If an error occurs, then the index of <code>pos</code> is not
-     * changed, the error index of <code>pos</code> is set to the index of
+     * If an error occurs, then the index of {@code pos} is not
+     * changed, the error index of {@code pos} is set to the index of
      * the character where the error occurred, and null is returned.
      * <p>
      * See the {@link #parse(String, ParsePosition)} method for more information
      * on number parsing.
      *
-     * @param source A <code>String</code>, part of which should be parsed.
-     * @param pos A <code>ParsePosition</code> object with index and error
+     * @param source A {@code String}, part of which should be parsed.
+     * @param pos A {@code ParsePosition} object with index and error
      *            index information as described above.
-     * @return A <code>Number</code> parsed from the string. In case of
+     * @return A {@code Number} parsed from the string. In case of
      *         error, returns null.
      * @throws NullPointerException if {@code source} or {@code pos} is null.
      */
@@ -422,8 +422,8 @@
      * See the {@link #parse(String, ParsePosition)} method for more information
      * on number parsing.
      *
-     * @param source A <code>String</code> whose beginning should be parsed.
-     * @return A <code>Number</code> parsed from the string.
+     * @param source A {@code String} whose beginning should be parsed.
+     * @return A {@code Number} parsed from the string.
      * @throws    ParseException if the beginning of the specified string
      *            cannot be parsed.
      */
@@ -677,16 +677,16 @@
 
     /**
      * Returns an array of all locales for which the
-     * <code>get*Instance</code> methods of this class can return
+     * {@code get*Instance} methods of this class can return
      * localized instances.
      * The returned array represents the union of locales supported by the Java
      * runtime and by installed
      * {@link java.text.spi.NumberFormatProvider NumberFormatProvider} implementations.
-     * It must contain at least a <code>Locale</code> instance equal to
+     * It must contain at least a {@code Locale} instance equal to
      * {@link java.util.Locale#US Locale.US}.
      *
      * @return An array of locales for which localized
-     *         <code>NumberFormat</code> instances are available.
+     *         {@code NumberFormat} instances are available.
      */
     public static Locale[] getAvailableLocales() {
         LocaleServiceProviderPool pool =
@@ -888,9 +888,9 @@
      * {@link #setCurrency(java.util.Currency) setCurrency}.
      * <p>
      * The default implementation throws
-     * <code>UnsupportedOperationException</code>.
+     * {@code UnsupportedOperationException}.
      *
-     * @return the currency used by this number format, or <code>null</code>
+     * @return the currency used by this number format, or {@code null}
      * @throws    UnsupportedOperationException if the number format class
      * doesn't implement currency formatting
      * @since 1.4
@@ -905,12 +905,12 @@
      * number of fraction digits used by the number format.
      * <p>
      * The default implementation throws
-     * <code>UnsupportedOperationException</code>.
+     * {@code UnsupportedOperationException}.
      *
      * @param currency the new currency to be used by this number format
      * @throws    UnsupportedOperationException if the number format class
      * doesn't implement currency formatting
-     * @throws    NullPointerException if <code>currency</code> is null
+     * @throws    NullPointerException if {@code currency} is null
      * @since 1.4
      */
     public void setCurrency(Currency currency) {
@@ -926,7 +926,7 @@
      *
      * @throws    UnsupportedOperationException The default implementation
      *     always throws this exception
-     * @return The <code>RoundingMode</code> used for this NumberFormat.
+     * @return The {@code RoundingMode} used for this NumberFormat.
      * @see #setRoundingMode(RoundingMode)
      * @since 1.6
      */
@@ -943,8 +943,8 @@
      *
      * @throws    UnsupportedOperationException The default implementation
      *     always throws this exception
-     * @throws    NullPointerException if <code>roundingMode</code> is null
-     * @param roundingMode The <code>RoundingMode</code> to be used
+     * @throws    NullPointerException if {@code roundingMode} is null
+     * @param roundingMode The {@code RoundingMode} to be used
      * @see #getRoundingMode()
      * @since 1.6
      */
@@ -996,20 +996,20 @@
     /**
      * First, read in the default serializable data.
      *
-     * Then, if <code>serialVersionOnStream</code> is less than 1, indicating that
+     * Then, if {@code serialVersionOnStream} is less than 1, indicating that
      * the stream was written by JDK 1.1,
-     * set the <code>int</code> fields such as <code>maximumIntegerDigits</code>
-     * to be equal to the <code>byte</code> fields such as <code>maxIntegerDigits</code>,
-     * since the <code>int</code> fields were not present in JDK 1.1.
+     * set the {@code int} fields such as {@code maximumIntegerDigits}
+     * to be equal to the {@code byte} fields such as {@code maxIntegerDigits},
+     * since the {@code int} fields were not present in JDK 1.1.
      * Finally, set serialVersionOnStream back to the maximum allowed value so that
      * default serialization will work properly if this object is streamed out again.
      *
-     * <p>If <code>minimumIntegerDigits</code> is greater than
-     * <code>maximumIntegerDigits</code> or <code>minimumFractionDigits</code>
-     * is greater than <code>maximumFractionDigits</code>, then the stream data
-     * is invalid and this method throws an <code>InvalidObjectException</code>.
+     * <p>If {@code minimumIntegerDigits} is greater than
+     * {@code maximumIntegerDigits} or {@code minimumFractionDigits}
+     * is greater than {@code maximumFractionDigits}, then the stream data
+     * is invalid and this method throws an {@code InvalidObjectException}.
      * In addition, if any of these values is negative, then this method throws
-     * an <code>InvalidObjectException</code>.
+     * an {@code InvalidObjectException}.
      *
      * @since 1.2
      */
@@ -1035,9 +1035,9 @@
 
     /**
      * Write out the default serializable data, after first setting
-     * the <code>byte</code> fields such as <code>maxIntegerDigits</code> to be
-     * equal to the <code>int</code> fields such as <code>maximumIntegerDigits</code>
-     * (or to <code>Byte.MAX_VALUE</code>, whichever is smaller), for compatibility
+     * the {@code byte} fields such as {@code maxIntegerDigits} to be
+     * equal to the {@code int} fields such as {@code maximumIntegerDigits}
+     * (or to {@code Byte.MAX_VALUE}, whichever is smaller), for compatibility
      * with the JDK 1.1 version of the stream format.
      *
      * @since 1.2
@@ -1076,16 +1076,16 @@
 
     /**
      * The maximum number of digits allowed in the integer portion of a
-     * number.  <code>maxIntegerDigits</code> must be greater than or equal to
-     * <code>minIntegerDigits</code>.
+     * number.  {@code maxIntegerDigits} must be greater than or equal to
+     * {@code minIntegerDigits}.
      * <p>
      * <strong>Note:</strong> This field exists only for serialization
      * compatibility with JDK 1.1.  In Java platform 2 v1.2 and higher, the new
-     * <code>int</code> field <code>maximumIntegerDigits</code> is used instead.
-     * When writing to a stream, <code>maxIntegerDigits</code> is set to
-     * <code>maximumIntegerDigits</code> or <code>Byte.MAX_VALUE</code>,
+     * {@code int} field {@code maximumIntegerDigits} is used instead.
+     * When writing to a stream, {@code maxIntegerDigits} is set to
+     * {@code maximumIntegerDigits} or {@code Byte.MAX_VALUE},
      * whichever is smaller.  When reading from a stream, this field is used
-     * only if <code>serialVersionOnStream</code> is less than 1.
+     * only if {@code serialVersionOnStream} is less than 1.
      *
      * @serial
      * @see #getMaximumIntegerDigits
@@ -1094,16 +1094,16 @@
 
     /**
      * The minimum number of digits allowed in the integer portion of a
-     * number.  <code>minimumIntegerDigits</code> must be less than or equal to
-     * <code>maximumIntegerDigits</code>.
+     * number.  {@code minimumIntegerDigits} must be less than or equal to
+     * {@code maximumIntegerDigits}.
      * <p>
      * <strong>Note:</strong> This field exists only for serialization
      * compatibility with JDK 1.1.  In Java platform 2 v1.2 and higher, the new
-     * <code>int</code> field <code>minimumIntegerDigits</code> is used instead.
-     * When writing to a stream, <code>minIntegerDigits</code> is set to
-     * <code>minimumIntegerDigits</code> or <code>Byte.MAX_VALUE</code>,
+     * {@code int} field {@code minimumIntegerDigits} is used instead.
+     * When writing to a stream, {@code minIntegerDigits} is set to
+     * {@code minimumIntegerDigits} or {@code Byte.MAX_VALUE},
      * whichever is smaller.  When reading from a stream, this field is used
-     * only if <code>serialVersionOnStream</code> is less than 1.
+     * only if {@code serialVersionOnStream} is less than 1.
      *
      * @serial
      * @see #getMinimumIntegerDigits
@@ -1112,16 +1112,16 @@
 
     /**
      * The maximum number of digits allowed in the fractional portion of a
-     * number.  <code>maximumFractionDigits</code> must be greater than or equal to
-     * <code>minimumFractionDigits</code>.
+     * number.  {@code maximumFractionDigits} must be greater than or equal to
+     * {@code minimumFractionDigits}.
      * <p>
      * <strong>Note:</strong> This field exists only for serialization
      * compatibility with JDK 1.1.  In Java platform 2 v1.2 and higher, the new
-     * <code>int</code> field <code>maximumFractionDigits</code> is used instead.
-     * When writing to a stream, <code>maxFractionDigits</code> is set to
-     * <code>maximumFractionDigits</code> or <code>Byte.MAX_VALUE</code>,
+     * {@code int} field {@code maximumFractionDigits} is used instead.
+     * When writing to a stream, {@code maxFractionDigits} is set to
+     * {@code maximumFractionDigits} or {@code Byte.MAX_VALUE},
      * whichever is smaller.  When reading from a stream, this field is used
-     * only if <code>serialVersionOnStream</code> is less than 1.
+     * only if {@code serialVersionOnStream} is less than 1.
      *
      * @serial
      * @see #getMaximumFractionDigits
@@ -1130,16 +1130,16 @@
 
     /**
      * The minimum number of digits allowed in the fractional portion of a
-     * number.  <code>minimumFractionDigits</code> must be less than or equal to
-     * <code>maximumFractionDigits</code>.
+     * number.  {@code minimumFractionDigits} must be less than or equal to
+     * {@code maximumFractionDigits}.
      * <p>
      * <strong>Note:</strong> This field exists only for serialization
      * compatibility with JDK 1.1.  In Java platform 2 v1.2 and higher, the new
-     * <code>int</code> field <code>minimumFractionDigits</code> is used instead.
-     * When writing to a stream, <code>minFractionDigits</code> is set to
-     * <code>minimumFractionDigits</code> or <code>Byte.MAX_VALUE</code>,
+     * {@code int} field {@code minimumFractionDigits} is used instead.
+     * When writing to a stream, {@code minFractionDigits} is set to
+     * {@code minimumFractionDigits} or {@code Byte.MAX_VALUE},
      * whichever is smaller.  When reading from a stream, this field is used
-     * only if <code>serialVersionOnStream</code> is less than 1.
+     * only if {@code serialVersionOnStream} is less than 1.
      *
      * @serial
      * @see #getMinimumFractionDigits
@@ -1158,8 +1158,8 @@
 
     /**
      * The maximum number of digits allowed in the integer portion of a
-     * number.  <code>maximumIntegerDigits</code> must be greater than or equal to
-     * <code>minimumIntegerDigits</code>.
+     * number.  {@code maximumIntegerDigits} must be greater than or equal to
+     * {@code minimumIntegerDigits}.
      *
      * @serial
      * @since 1.2
@@ -1169,8 +1169,8 @@
 
     /**
      * The minimum number of digits allowed in the integer portion of a
-     * number.  <code>minimumIntegerDigits</code> must be less than or equal to
-     * <code>maximumIntegerDigits</code>.
+     * number.  {@code minimumIntegerDigits} must be less than or equal to
+     * {@code maximumIntegerDigits}.
      *
      * @serial
      * @since 1.2
@@ -1180,8 +1180,8 @@
 
     /**
      * The maximum number of digits allowed in the fractional portion of a
-     * number.  <code>maximumFractionDigits</code> must be greater than or equal to
-     * <code>minimumFractionDigits</code>.
+     * number.  {@code maximumFractionDigits} must be greater than or equal to
+     * {@code minimumFractionDigits}.
      *
      * @serial
      * @since 1.2
@@ -1191,8 +1191,8 @@
 
     /**
      * The minimum number of digits allowed in the fractional portion of a
-     * number.  <code>minimumFractionDigits</code> must be less than or equal to
-     * <code>maximumFractionDigits</code>.
+     * number.  {@code minimumFractionDigits} must be less than or equal to
+     * {@code maximumFractionDigits}.
      *
      * @serial
      * @since 1.2
@@ -1203,21 +1203,21 @@
     static final int currentSerialVersion = 1;
 
     /**
-     * Describes the version of <code>NumberFormat</code> present on the stream.
+     * Describes the version of {@code NumberFormat} present on the stream.
      * Possible values are:
      * <ul>
      * <li><b>0</b> (or uninitialized): the JDK 1.1 version of the stream format.
-     *     In this version, the <code>int</code> fields such as
-     *     <code>maximumIntegerDigits</code> were not present, and the <code>byte</code>
-     *     fields such as <code>maxIntegerDigits</code> are used instead.
+     *     In this version, the {@code int} fields such as
+     *     {@code maximumIntegerDigits} were not present, and the {@code byte}
+     *     fields such as {@code maxIntegerDigits} are used instead.
      *
      * <li><b>1</b>: the 1.2 version of the stream format.  The values of the
-     *     <code>byte</code> fields such as <code>maxIntegerDigits</code> are ignored,
-     *     and the <code>int</code> fields such as <code>maximumIntegerDigits</code>
+     *     {@code byte} fields such as {@code maxIntegerDigits} are ignored,
+     *     and the {@code int} fields such as {@code maximumIntegerDigits}
      *     are used instead.
      * </ul>
-     * When streaming out a <code>NumberFormat</code>, the most recent format
-     * (corresponding to the highest allowable <code>serialVersionOnStream</code>)
+     * When streaming out a {@code NumberFormat}, the most recent format
+     * (corresponding to the highest allowable {@code serialVersionOnStream})
      * is always written.
      *
      * @serial
@@ -1236,9 +1236,9 @@
     //
     /**
      * Defines constants that are used as attribute keys in the
-     * <code>AttributedCharacterIterator</code> returned
-     * from <code>NumberFormat.formatToCharacterIterator</code> and as
-     * field identifiers in <code>FieldPosition</code>.
+     * {@code AttributedCharacterIterator} returned
+     * from {@code NumberFormat.formatToCharacterIterator} and as
+     * field identifiers in {@code FieldPosition}.
      *
      * @since 1.4
      */
--- a/src/java.base/share/classes/java/text/ParsePosition.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/ParsePosition.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, 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
@@ -40,14 +40,14 @@
 
 
 /**
- * <code>ParsePosition</code> is a simple class used by <code>Format</code>
+ * {@code ParsePosition} is a simple class used by {@code Format}
  * and its subclasses to keep track of the current position during parsing.
- * The <code>parseObject</code> method in the various <code>Format</code>
- * classes requires a <code>ParsePosition</code> object as an argument.
+ * The {@code parseObject} method in the various {@code Format}
+ * classes requires a {@code ParsePosition} object as an argument.
  *
  * <p>
  * By design, as you parse through a string with different formats,
- * you can use the same <code>ParsePosition</code>, since the index parameter
+ * you can use the same {@code ParsePosition}, since the index parameter
  * records the current position.
  *
  * @author      Mark Davis
--- a/src/java.base/share/classes/java/text/RuleBasedCollator.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/RuleBasedCollator.java	Wed Sep 25 22:40:41 2019 +0200
@@ -43,14 +43,14 @@
 import java.util.Locale;
 
 /**
- * The <code>RuleBasedCollator</code> class is a concrete subclass of
- * <code>Collator</code> that provides a simple, data-driven, table
+ * The {@code RuleBasedCollator} class is a concrete subclass of
+ * {@code Collator} that provides a simple, data-driven, table
  * collator.  With this class you can create a customized table-based
- * <code>Collator</code>.  <code>RuleBasedCollator</code> maps
+ * {@code Collator}.  {@code RuleBasedCollator} maps
  * characters to sort keys.
  *
  * <p>
- * <code>RuleBasedCollator</code> has the following restrictions
+ * {@code RuleBasedCollator} has the following restrictions
  * for efficiency (other subclasses may be used for more complex languages) :
  * <ol>
  * <li>If a special collation rule controlled by a &lt;modifier&gt; is
@@ -75,7 +75,7 @@
  *        [0021-002F, 003A-0040, 005B-0060, 007B-007E]). If those
  *        characters are desired, you can put them in single quotes
  *        (e.g. ampersand =&gt; '&amp;'). Note that unquoted white space characters
- *        are ignored; e.g. <code>b c</code> is treated as <code>bc</code>.
+ *        are ignored; e.g. {@code b c} is treated as {@code bc}.
  *    <LI><strong>Modifier</strong>: There are currently two modifiers that
  *        turn on special collation rules.
  *        <UL>
@@ -146,7 +146,7 @@
  *
  * <p><strong>Normalization and Accents</strong>
  * <p>
- * <code>RuleBasedCollator</code> automatically processes its rule table to
+ * {@code RuleBasedCollator} automatically processes its rule table to
  * include both pre-composed and combining-character versions of
  * accented characters.  Even if the provided rule string contains only
  * base characters and separate combining accent characters, the pre-composed
@@ -175,8 +175,8 @@
  *         text-argument) is not already in the sequence.
  *         (e.g. "a &lt; b &amp; e &lt; f")
  * </UL>
- * If you produce one of these errors, a <code>RuleBasedCollator</code> throws
- * a <code>ParseException</code>.
+ * If you produce one of these errors, a {@code RuleBasedCollator} throws
+ * a {@code ParseException}.
  *
  * <p><strong>Examples</strong>
  * <p>Simple:     "&lt; a &lt; b &lt; c &lt; d"
@@ -191,9 +191,9 @@
  *                      aa, AA"
  *
  * <p>
- * To create a <code>RuleBasedCollator</code> object with specialized
- * rules tailored to your needs, you construct the <code>RuleBasedCollator</code>
- * with the rules contained in a <code>String</code> object. For example:
+ * To create a {@code RuleBasedCollator} object with specialized
+ * rules tailored to your needs, you construct the {@code RuleBasedCollator}
+ * with the rules contained in a {@code String} object. For example:
  * <blockquote>
  * <pre>
  * String simple = "&lt; a&lt; b&lt; c&lt; d";
@@ -218,7 +218,7 @@
  * <p>
  * A new collation rules string can be created by concatenating rules
  * strings. For example, the rules returned by {@link #getRules()} could
- * be concatenated to combine multiple <code>RuleBasedCollator</code>s.
+ * be concatenated to combine multiple {@code RuleBasedCollator}s.
  *
  * <p>
  * The following example demonstrates how to change the order of
@@ -350,7 +350,7 @@
      * than, greater than or equal to another string in a language.
      * This can be overridden in a subclass.
      *
-     * @throws    NullPointerException if <code>source</code> or <code>target</code> is null.
+     * @throws    NullPointerException if {@code source} or {@code target} is null.
      */
     public synchronized int compare(String source, String target)
     {
--- a/src/java.base/share/classes/java/text/SimpleDateFormat.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/SimpleDateFormat.java	Wed Sep 25 22:40:41 2019 +0200
@@ -58,19 +58,19 @@
 import sun.util.locale.provider.TimeZoneNameUtility;
 
 /**
- * <code>SimpleDateFormat</code> is a concrete class for formatting and
+ * {@code SimpleDateFormat} is a concrete class for formatting and
  * parsing dates in a locale-sensitive manner. It allows for formatting
  * (date &rarr; text), parsing (text &rarr; date), and normalization.
  *
  * <p>
- * <code>SimpleDateFormat</code> allows you to start by choosing
+ * {@code SimpleDateFormat} allows you to start by choosing
  * any user-defined patterns for date-time formatting. However, you
  * are encouraged to create a date-time formatter with either
- * <code>getTimeInstance</code>, <code>getDateInstance</code>, or
- * <code>getDateTimeInstance</code> in <code>DateFormat</code>. Each
+ * {@code getTimeInstance}, {@code getDateInstance}, or
+ * {@code getDateTimeInstance} in {@code DateFormat}. Each
  * of these class methods can return a date/time formatter initialized
  * with a default format pattern. You may modify the format pattern
- * using the <code>applyPattern</code> methods as desired.
+ * using the {@code applyPattern} methods as desired.
  * For more information on using these methods, see
  * {@link DateFormat}.
  *
@@ -79,19 +79,19 @@
  * Date and time formats are specified by <em>date and time pattern</em>
  * strings.
  * Within date and time pattern strings, unquoted letters from
- * <code>'A'</code> to <code>'Z'</code> and from <code>'a'</code> to
- * <code>'z'</code> are interpreted as pattern letters representing the
+ * {@code 'A'} to {@code 'Z'} and from {@code 'a'} to
+ * {@code 'z'} are interpreted as pattern letters representing the
  * components of a date or time string.
- * Text can be quoted using single quotes (<code>'</code>) to avoid
+ * Text can be quoted using single quotes ({@code '}) to avoid
  * interpretation.
- * <code>"''"</code> represents a single quote.
+ * {@code "''"} represents a single quote.
  * All other characters are not interpreted; they're simply copied into the
  * output string during formatting or matched against the input string
  * during parsing.
  * <p>
  * The following pattern letters are defined (all other characters from
- * <code>'A'</code> to <code>'Z'</code> and from <code>'a'</code> to
- * <code>'z'</code> are reserved):
+ * {@code 'A'} to {@code 'Z'} and from {@code 'a'} to
+ * {@code 'z'} are reserved):
  * <blockquote>
  * <table class="striped">
  * <caption style="display:none">Chart shows pattern letters, date/time component, presentation, and examples.</caption>
@@ -104,120 +104,120 @@
  * </thead>
  * <tbody>
  *     <tr>
- *         <th scope="row"><code>G</code>
+ *         <th scope="row">{@code G}
  *         <td>Era designator
  *         <td><a href="#text">Text</a>
- *         <td><code>AD</code>
+ *         <td>{@code AD}
  *     <tr>
- *         <th scope="row"><code>y</code>
+ *         <th scope="row">{@code y}
  *         <td>Year
  *         <td><a href="#year">Year</a>
- *         <td><code>1996</code>; <code>96</code>
+ *         <td>{@code 1996}; {@code 96}
  *     <tr>
- *         <th scope="row"><code>Y</code>
+ *         <th scope="row">{@code Y}
  *         <td>Week year
  *         <td><a href="#year">Year</a>
- *         <td><code>2009</code>; <code>09</code>
+ *         <td>{@code 2009}; {@code 09}
  *     <tr>
- *         <th scope="row"><code>M</code>
+ *         <th scope="row">{@code M}
  *         <td>Month in year (context sensitive)
  *         <td><a href="#month">Month</a>
- *         <td><code>July</code>; <code>Jul</code>; <code>07</code>
+ *         <td>{@code July}; {@code Jul}; {@code 07}
  *     <tr>
- *         <th scope="row"><code>L</code>
+ *         <th scope="row">{@code L}
  *         <td>Month in year (standalone form)
  *         <td><a href="#month">Month</a>
- *         <td><code>July</code>; <code>Jul</code>; <code>07</code>
+ *         <td>{@code July}; {@code Jul}; {@code 07}
  *     <tr>
- *         <th scope="row"><code>w</code>
+ *         <th scope="row">{@code w}
  *         <td>Week in year
  *         <td><a href="#number">Number</a>
- *         <td><code>27</code>
+ *         <td>{@code 27}
  *     <tr>
- *         <th scope="row"><code>W</code>
+ *         <th scope="row">{@code W}
  *         <td>Week in month
  *         <td><a href="#number">Number</a>
- *         <td><code>2</code>
+ *         <td>{@code 2}
  *     <tr>
- *         <th scope="row"><code>D</code>
+ *         <th scope="row">{@code D}
  *         <td>Day in year
  *         <td><a href="#number">Number</a>
- *         <td><code>189</code>
+ *         <td>{@code 189}
  *     <tr>
- *         <th scope="row"><code>d</code>
+ *         <th scope="row">{@code d}
  *         <td>Day in month
  *         <td><a href="#number">Number</a>
- *         <td><code>10</code>
+ *         <td>{@code 10}
  *     <tr>
- *         <th scope="row"><code>F</code>
+ *         <th scope="row">{@code F}
  *         <td>Day of week in month
  *         <td><a href="#number">Number</a>
- *         <td><code>2</code>
+ *         <td>{@code 2}
  *     <tr>
- *         <th scope="row"><code>E</code>
+ *         <th scope="row">{@code E}
  *         <td>Day name in week
  *         <td><a href="#text">Text</a>
- *         <td><code>Tuesday</code>; <code>Tue</code>
+ *         <td>{@code Tuesday}; {@code Tue}
  *     <tr>
- *         <th scope="row"><code>u</code>
+ *         <th scope="row">{@code u}
  *         <td>Day number of week (1 = Monday, ..., 7 = Sunday)
  *         <td><a href="#number">Number</a>
- *         <td><code>1</code>
+ *         <td>{@code 1}
  *     <tr>
- *         <th scope="row"><code>a</code>
+ *         <th scope="row">{@code a}
  *         <td>Am/pm marker
  *         <td><a href="#text">Text</a>
- *         <td><code>PM</code>
+ *         <td>{@code PM}
  *     <tr>
- *         <th scope="row"><code>H</code>
+ *         <th scope="row">{@code H}
  *         <td>Hour in day (0-23)
  *         <td><a href="#number">Number</a>
- *         <td><code>0</code>
+ *         <td>{@code 0}
  *     <tr>
- *         <th scope="row"><code>k</code>
+ *         <th scope="row">{@code k}
  *         <td>Hour in day (1-24)
  *         <td><a href="#number">Number</a>
- *         <td><code>24</code>
+ *         <td>{@code 24}
  *     <tr>
- *         <th scope="row"><code>K</code>
+ *         <th scope="row">{@code K}
  *         <td>Hour in am/pm (0-11)
  *         <td><a href="#number">Number</a>
- *         <td><code>0</code>
+ *         <td>{@code 0}
  *     <tr>
- *         <th scope="row"><code>h</code>
+ *         <th scope="row">{@code h}
  *         <td>Hour in am/pm (1-12)
  *         <td><a href="#number">Number</a>
- *         <td><code>12</code>
+ *         <td>{@code 12}
  *     <tr>
- *         <th scope="row"><code>m</code>
+ *         <th scope="row">{@code m}
  *         <td>Minute in hour
  *         <td><a href="#number">Number</a>
- *         <td><code>30</code>
+ *         <td>{@code 30}
  *     <tr>
- *         <th scope="row"><code>s</code>
+ *         <th scope="row">{@code s}
  *         <td>Second in minute
  *         <td><a href="#number">Number</a>
- *         <td><code>55</code>
+ *         <td>{@code 55}
  *     <tr>
- *         <th scope="row"><code>S</code>
+ *         <th scope="row">{@code S}
  *         <td>Millisecond
  *         <td><a href="#number">Number</a>
- *         <td><code>978</code>
+ *         <td>{@code 978}
  *     <tr>
- *         <th scope="row"><code>z</code>
+ *         <th scope="row">{@code z}
  *         <td>Time zone
  *         <td><a href="#timezone">General time zone</a>
- *         <td><code>Pacific Standard Time</code>; <code>PST</code>; <code>GMT-08:00</code>
+ *         <td>{@code Pacific Standard Time}; {@code PST}; {@code GMT-08:00}
  *     <tr>
- *         <th scope="row"><code>Z</code>
+ *         <th scope="row">{@code Z}
  *         <td>Time zone
  *         <td><a href="#rfc822timezone">RFC 822 time zone</a>
- *         <td><code>-0800</code>
+ *         <td>{@code -0800}
  *     <tr>
- *         <th scope="row"><code>X</code>
+ *         <th scope="row">{@code X}
  *         <td>Time zone
  *         <td><a href="#iso8601timezone">ISO 8601 time zone</a>
- *         <td><code>-08</code>; <code>-0800</code>;  <code>-08:00</code>
+ *         <td>{@code -08}; {@code -0800};  {@code -08:00}
  * </tbody>
  * </table>
  * </blockquote>
@@ -247,11 +247,11 @@
  *         digits. So using the pattern "MM/dd/yyyy", "01/11/12" parses to
  *         Jan 11, 12 A.D.
  *     <li>For parsing with the abbreviated year pattern ("y" or "yy"),
- *         <code>SimpleDateFormat</code> must interpret the abbreviated year
+ *         {@code SimpleDateFormat} must interpret the abbreviated year
  *         relative to some century.  It does this by adjusting dates to be
- *         within 80 years before and 20 years after the time the <code>SimpleDateFormat</code>
+ *         within 80 years before and 20 years after the time the {@code SimpleDateFormat}
  *         instance is created. For example, using a pattern of "MM/dd/yy" and a
- *         <code>SimpleDateFormat</code> instance created on Jan 1, 1997,  the string
+ *         {@code SimpleDateFormat} instance created on Jan 1, 1997,  the string
  *         "01/11/12" would be interpreted as Jan 11, 2012 while the string "05/04/64"
  *         would be interpreted as May 4, 1964.
  *         During parsing, only strings consisting of exactly two digits, as defined by
@@ -303,16 +303,16 @@
  *     following syntax is used:
  *     <pre>
  *     <a id="GMTOffsetTimeZone"><i>GMTOffsetTimeZone:</i></a>
- *             <code>GMT</code> <i>Sign</i> <i>Hours</i> <code>:</code> <i>Minutes</i>
+ *             {@code GMT} <i>Sign</i> <i>Hours</i> {@code :} <i>Minutes</i>
  *     <i>Sign:</i> one of
- *             <code>+ -</code>
+ *             {@code + -}
  *     <i>Hours:</i>
  *             <i>Digit</i>
  *             <i>Digit</i> <i>Digit</i>
  *     <i>Minutes:</i>
  *             <i>Digit</i> <i>Digit</i>
  *     <i>Digit:</i> one of
- *             <code>0 1 2 3 4 5 6 7 8 9</code></pre>
+ *             {@code 0 1 2 3 4 5 6 7 8 9}</pre>
  *     <i>Hours</i> must be between 0 and 23, and <i>Minutes</i> must be between
  *     00 and 59. The format is locale independent and digits must be taken
  *     from the Basic Latin block of the Unicode standard.
@@ -364,10 +364,10 @@
  *     SimpleDateFormat} or {@linkplain #applyPattern(String) applying a
  *     pattern}.
  * </ul>
- * <code>SimpleDateFormat</code> also supports <em>localized date and time
+ * {@code SimpleDateFormat} also supports <em>localized date and time
  * pattern</em> strings. In these strings, the pattern letters described above
  * may be replaced with other, locale dependent, pattern letters.
- * <code>SimpleDateFormat</code> does not deal with the localization of text
+ * {@code SimpleDateFormat} does not deal with the localization of text
  * other than the pattern letters; that's up to the client of the class.
  *
  * <h3>Examples</h3>
@@ -385,38 +385,38 @@
  * </thead>
  * <tbody>
  *     <tr>
- *         <th scope="row"><code>"yyyy.MM.dd G 'at' HH:mm:ss z"</code>
- *         <td><code>2001.07.04 AD at 12:08:56 PDT</code>
+ *         <th scope="row">{@code "yyyy.MM.dd G 'at' HH:mm:ss z"}
+ *         <td>{@code 2001.07.04 AD at 12:08:56 PDT}
  *     <tr>
- *         <th scope="row"><code>"EEE, MMM d, ''yy"</code>
- *         <td><code>Wed, Jul 4, '01</code>
+ *         <th scope="row">{@code "EEE, MMM d, ''yy"}
+ *         <td>{@code Wed, Jul 4, '01}
  *     <tr>
- *         <th scope="row"><code>"h:mm a"</code>
- *         <td><code>12:08 PM</code>
+ *         <th scope="row">{@code "h:mm a"}
+ *         <td>{@code 12:08 PM}
  *     <tr>
- *         <th scope="row"><code>"hh 'o''clock' a, zzzz"</code>
- *         <td><code>12 o'clock PM, Pacific Daylight Time</code>
+ *         <th scope="row">{@code "hh 'o''clock' a, zzzz"}
+ *         <td>{@code 12 o'clock PM, Pacific Daylight Time}
  *     <tr>
- *         <th scope="row"><code>"K:mm a, z"</code>
- *         <td><code>0:08 PM, PDT</code>
+ *         <th scope="row">{@code "K:mm a, z"}
+ *         <td>{@code 0:08 PM, PDT}
  *     <tr>
- *         <th scope="row"><code>"yyyyy.MMMMM.dd GGG hh:mm aaa"</code>
- *         <td><code>02001.July.04 AD 12:08 PM</code>
+ *         <th scope="row">{@code "yyyyy.MMMMM.dd GGG hh:mm aaa"}
+ *         <td>{@code 02001.July.04 AD 12:08 PM}
  *     <tr>
- *         <th scope="row"><code>"EEE, d MMM yyyy HH:mm:ss Z"</code>
- *         <td><code>Wed, 4 Jul 2001 12:08:56 -0700</code>
+ *         <th scope="row">{@code "EEE, d MMM yyyy HH:mm:ss Z"}
+ *         <td>{@code Wed, 4 Jul 2001 12:08:56 -0700}
  *     <tr>
- *         <th scope="row"><code>"yyMMddHHmmssZ"</code>
- *         <td><code>010704120856-0700</code>
+ *         <th scope="row">{@code "yyMMddHHmmssZ"}
+ *         <td>{@code 010704120856-0700}
  *     <tr>
- *         <th scope="row"><code>"yyyy-MM-dd'T'HH:mm:ss.SSSZ"</code>
- *         <td><code>2001-07-04T12:08:56.235-0700</code>
+ *         <th scope="row">{@code "yyyy-MM-dd'T'HH:mm:ss.SSSZ"}
+ *         <td>{@code 2001-07-04T12:08:56.235-0700}
  *     <tr>
- *         <th scope="row"><code>"yyyy-MM-dd'T'HH:mm:ss.SSSXXX"</code>
- *         <td><code>2001-07-04T12:08:56.235-07:00</code>
+ *         <th scope="row">{@code "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"}
+ *         <td>{@code 2001-07-04T12:08:56.235-07:00}
  *     <tr>
- *         <th scope="row"><code>"YYYY-'W'ww-u"</code>
- *         <td><code>2001-W27-3</code>
+ *         <th scope="row">{@code "YYYY-'W'ww-u"}
+ *         <td>{@code 2001-W27-3}
  * </tbody>
  * </table>
  * </blockquote>
@@ -453,12 +453,12 @@
      * The version of the serialized data on the stream.  Possible values:
      * <ul>
      * <li><b>0</b> or not present on stream: JDK 1.1.3.  This version
-     * has no <code>defaultCenturyStart</code> on stream.
+     * has no {@code defaultCenturyStart} on stream.
      * <li><b>1</b> JDK 1.1.4 or later.  This version adds
-     * <code>defaultCenturyStart</code>.
+     * {@code defaultCenturyStart}.
      * </ul>
      * When streaming out this class, the most recent format
-     * and the highest allowable <code>serialVersionOnStream</code>
+     * and the highest allowable {@code serialVersionOnStream}
      * is written.
      * @serial
      * @since 1.1.4
@@ -523,7 +523,7 @@
 
     /**
      * We map dates with two-digit years into the century starting at
-     * <code>defaultCenturyStart</code>, which may be any date.  May
+     * {@code defaultCenturyStart}, which may be any date.  May
      * not be null.
      * @serial
      * @since 1.1.4
@@ -546,8 +546,8 @@
 
     /**
      * The Locale used to instantiate this
-     * <code>SimpleDateFormat</code>. The value may be null if this object
-     * has been created by an older <code>SimpleDateFormat</code> and
+     * {@code SimpleDateFormat}. The value may be null if this object
+     * has been created by an older {@code SimpleDateFormat} and
      * deserialized.
      *
      * @serial
@@ -556,7 +556,7 @@
     private Locale locale;
 
     /**
-     * Indicates whether this <code>SimpleDateFormat</code> should use
+     * Indicates whether this {@code SimpleDateFormat} should use
      * the DateFormatSymbols. If true, the format and parse methods
      * use the DateFormatSymbols values. If false, the format and
      * parse methods call Calendar.getDisplayName or
@@ -565,7 +565,7 @@
     transient boolean useDateFormatSymbols;
 
     /**
-     * Constructs a <code>SimpleDateFormat</code> using the default pattern and
+     * Constructs a {@code SimpleDateFormat} using the default pattern and
      * date format symbols for the default
      * {@link java.util.Locale.Category#FORMAT FORMAT} locale.
      * <b>Note:</b> This constructor may not support all locales.
@@ -579,7 +579,7 @@
     }
 
     /**
-     * Constructs a <code>SimpleDateFormat</code> using the given pattern and
+     * Constructs a {@code SimpleDateFormat} using the given pattern and
      * the default date format symbols for the default
      * {@link java.util.Locale.Category#FORMAT FORMAT} locale.
      * <b>Note:</b> This constructor may not support all locales.
@@ -601,7 +601,7 @@
     }
 
     /**
-     * Constructs a <code>SimpleDateFormat</code> using the given pattern and
+     * Constructs a {@code SimpleDateFormat} using the given pattern and
      * the default date format symbols for the given locale.
      * <b>Note:</b> This constructor may not support all locales.
      * For full coverage, use the factory methods in the {@link DateFormat}
@@ -626,7 +626,7 @@
     }
 
     /**
-     * Constructs a <code>SimpleDateFormat</code> using the given pattern and
+     * Constructs a {@code SimpleDateFormat} using the given pattern and
      * date format symbols.
      *
      * @param pattern the pattern describing the date and time format
@@ -916,7 +916,7 @@
      * to begin on the date the user specifies.
      *
      * @param startDate During parsing, two digit years will be placed in the range
-     * <code>startDate</code> to <code>startDate + 100 years</code>.
+     * {@code startDate} to {@code startDate + 100 years}.
      * @see #get2DigitYearStart
      * @throws NullPointerException if {@code startDate} is {@code null}.
      * @since 1.2
@@ -939,8 +939,8 @@
     }
 
     /**
-     * Formats the given <code>Date</code> into a date/time string and appends
-     * the result to the given <code>StringBuffer</code>.
+     * Formats the given {@code Date} into a date/time string and appends
+     * the result to the given {@code StringBuffer}.
      *
      * @param date the date-time value to be formatted into a date-time string.
      * @param toAppendTo where the new date-time text is to be appended.
@@ -1003,13 +1003,13 @@
     }
 
     /**
-     * Formats an Object producing an <code>AttributedCharacterIterator</code>.
-     * You can use the returned <code>AttributedCharacterIterator</code>
+     * Formats an Object producing an {@code AttributedCharacterIterator}.
+     * You can use the returned {@code AttributedCharacterIterator}
      * to build the resulting String, as well as to determine information
      * about the resulting String.
      * <p>
      * Each attribute key of the AttributedCharacterIterator will be of type
-     * <code>DateFormat.Field</code>, with the corresponding attribute value
+     * {@code DateFormat.Field}, with the corresponding attribute value
      * being the same as the attribute key.
      *
      * @throws    NullPointerException if obj is null.
@@ -1427,17 +1427,17 @@
 
 
     /**
-     * Parses text from a string to produce a <code>Date</code>.
+     * Parses text from a string to produce a {@code Date}.
      * <p>
      * The method attempts to parse text starting at the index given by
-     * <code>pos</code>.
-     * If parsing succeeds, then the index of <code>pos</code> is updated
+     * {@code pos}.
+     * If parsing succeeds, then the index of {@code pos} is updated
      * to the index after the last character used (parsing does not necessarily
      * use all characters up to the end of the string), and the parsed
-     * date is returned. The updated <code>pos</code> can be used to
+     * date is returned. The updated {@code pos} can be used to
      * indicate the starting point for the next call to this method.
-     * If an error occurs, then the index of <code>pos</code> is not
-     * changed, the error index of <code>pos</code> is set to the index of
+     * If an error occurs, then the index of {@code pos} is not
+     * changed, the error index of {@code pos} is set to the index of
      * the character where the error occurred, and null is returned.
      *
      * <p>This parsing operation uses the {@link DateFormat#calendar
@@ -1454,12 +1454,12 @@
      * {@link #setTimeZone(java.util.TimeZone) setTimeZone} may need
      * to be restored for further operations.
      *
-     * @param text  A <code>String</code>, part of which should be parsed.
-     * @param pos   A <code>ParsePosition</code> object with index and error
+     * @param text  A {@code String}, part of which should be parsed.
+     * @param pos   A {@code ParsePosition} object with index and error
      *              index information as described above.
-     * @return A <code>Date</code> parsed from the string. In case of
+     * @return A {@code Date} parsed from the string. In case of
      *         error, returns null.
-     * @throws    NullPointerException if <code>text</code> or <code>pos</code> is null.
+     * @throws    NullPointerException if {@code text} or {@code pos} is null.
      */
     @Override
     public Date parse(String text, ParsePosition pos)
@@ -2393,10 +2393,10 @@
     }
 
     /**
-     * Creates a copy of this <code>SimpleDateFormat</code>. This also
+     * Creates a copy of this {@code SimpleDateFormat}. This also
      * clones the format's date format symbols.
      *
-     * @return a clone of this <code>SimpleDateFormat</code>
+     * @return a clone of this {@code SimpleDateFormat}
      */
     @Override
     public Object clone() {
@@ -2406,9 +2406,9 @@
     }
 
     /**
-     * Returns the hash code value for this <code>SimpleDateFormat</code> object.
+     * Returns the hash code value for this {@code SimpleDateFormat} object.
      *
-     * @return the hash code value for this <code>SimpleDateFormat</code> object.
+     * @return the hash code value for this {@code SimpleDateFormat} object.
      */
     @Override
     public int hashCode()
@@ -2418,11 +2418,11 @@
     }
 
     /**
-     * Compares the given object with this <code>SimpleDateFormat</code> for
+     * Compares the given object with this {@code SimpleDateFormat} for
      * equality.
      *
      * @return true if the given object is equal to this
-     * <code>SimpleDateFormat</code>
+     * {@code SimpleDateFormat}
      */
     @Override
     public boolean equals(Object obj)
--- a/src/java.base/share/classes/java/text/StringCharacterIterator.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/StringCharacterIterator.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, 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
@@ -41,10 +41,10 @@
 package java.text;
 
 /**
- * <code>StringCharacterIterator</code> implements the
- * <code>CharacterIterator</code> protocol for a <code>String</code>.
- * The <code>StringCharacterIterator</code> class iterates over the
- * entire <code>String</code>.
+ * {@code StringCharacterIterator} implements the
+ * {@code CharacterIterator} protocol for a {@code String}.
+ * The {@code StringCharacterIterator} class iterates over the
+ * entire {@code String}.
  *
  * @see CharacterIterator
  * @since 1.1
--- a/src/java.base/share/classes/java/text/spi/BreakIteratorProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/spi/BreakIteratorProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -46,13 +46,13 @@
     }
 
     /**
-     * Returns a new <code>BreakIterator</code> instance
+     * Returns a new {@code BreakIterator} instance
      * for <a href="../BreakIterator.html#word">word breaks</a>
      * for the given locale.
      * @param locale the desired locale
      * @return A break iterator for word breaks
-     * @throws    NullPointerException if <code>locale</code> is null
-     * @throws    IllegalArgumentException if <code>locale</code> isn't
+     * @throws    NullPointerException if {@code locale} is null
+     * @throws    IllegalArgumentException if {@code locale} isn't
      *     one of the locales returned from
      *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
      *     getAvailableLocales()}.
@@ -61,13 +61,13 @@
     public abstract BreakIterator getWordInstance(Locale locale);
 
     /**
-     * Returns a new <code>BreakIterator</code> instance
+     * Returns a new {@code BreakIterator} instance
      * for <a href="../BreakIterator.html#line">line breaks</a>
      * for the given locale.
      * @param locale the desired locale
      * @return A break iterator for line breaks
-     * @throws    NullPointerException if <code>locale</code> is null
-     * @throws    IllegalArgumentException if <code>locale</code> isn't
+     * @throws    NullPointerException if {@code locale} is null
+     * @throws    IllegalArgumentException if {@code locale} isn't
      *     one of the locales returned from
      *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
      *     getAvailableLocales()}.
@@ -76,13 +76,13 @@
     public abstract BreakIterator getLineInstance(Locale locale);
 
     /**
-     * Returns a new <code>BreakIterator</code> instance
+     * Returns a new {@code BreakIterator} instance
      * for <a href="../BreakIterator.html#character">character breaks</a>
      * for the given locale.
      * @param locale the desired locale
      * @return A break iterator for character breaks
-     * @throws    NullPointerException if <code>locale</code> is null
-     * @throws    IllegalArgumentException if <code>locale</code> isn't
+     * @throws    NullPointerException if {@code locale} is null
+     * @throws    IllegalArgumentException if {@code locale} isn't
      *     one of the locales returned from
      *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
      *     getAvailableLocales()}.
@@ -91,13 +91,13 @@
     public abstract BreakIterator getCharacterInstance(Locale locale);
 
     /**
-     * Returns a new <code>BreakIterator</code> instance
+     * Returns a new {@code BreakIterator} instance
      * for <a href="../BreakIterator.html#sentence">sentence breaks</a>
      * for the given locale.
      * @param locale the desired locale
      * @return A break iterator for sentence breaks
-     * @throws    NullPointerException if <code>locale</code> is null
-     * @throws    IllegalArgumentException if <code>locale</code> isn't
+     * @throws    NullPointerException if {@code locale} is null
+     * @throws    IllegalArgumentException if {@code locale} isn't
      *     one of the locales returned from
      *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
      *     getAvailableLocales()}.
--- a/src/java.base/share/classes/java/text/spi/CollatorProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/spi/CollatorProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -46,12 +46,12 @@
     }
 
     /**
-     * Returns a new <code>Collator</code> instance for the specified locale.
+     * Returns a new {@code Collator} instance for the specified locale.
      * @param locale the desired locale.
-     * @return the <code>Collator</code> for the desired locale.
+     * @return the {@code Collator} for the desired locale.
      * @throws    NullPointerException if
-     * <code>locale</code> is null
-     * @throws    IllegalArgumentException if <code>locale</code> isn't
+     * {@code locale} is null
+     * @throws    IllegalArgumentException if {@code locale} isn't
      *     one of the locales returned from
      *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
      *     getAvailableLocales()}.
--- a/src/java.base/share/classes/java/text/spi/DateFormatProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/spi/DateFormatProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -46,7 +46,7 @@
     }
 
     /**
-     * Returns a new <code>DateFormat</code> instance which formats time
+     * Returns a new {@code DateFormat} instance which formats time
      * with the given formatting style for the specified locale.
      * @param style the given formatting style.  Either one of
      *     {@link java.text.DateFormat#SHORT DateFormat.SHORT},
@@ -54,19 +54,19 @@
      *     {@link java.text.DateFormat#LONG DateFormat.LONG}, or
      *     {@link java.text.DateFormat#FULL DateFormat.FULL}.
      * @param locale the desired locale.
-     * @throws    IllegalArgumentException if <code>style</code> is invalid,
-     *     or if <code>locale</code> isn't
+     * @throws    IllegalArgumentException if {@code style} is invalid,
+     *     or if {@code locale} isn't
      *     one of the locales returned from
      *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
      *     getAvailableLocales()}.
-     * @throws    NullPointerException if <code>locale</code> is null
+     * @throws    NullPointerException if {@code locale} is null
      * @return a time formatter.
      * @see java.text.DateFormat#getTimeInstance(int, java.util.Locale)
      */
     public abstract DateFormat getTimeInstance(int style, Locale locale);
 
     /**
-     * Returns a new <code>DateFormat</code> instance which formats date
+     * Returns a new {@code DateFormat} instance which formats date
      * with the given formatting style for the specified locale.
      * @param style the given formatting style.  Either one of
      *     {@link java.text.DateFormat#SHORT DateFormat.SHORT},
@@ -74,19 +74,19 @@
      *     {@link java.text.DateFormat#LONG DateFormat.LONG}, or
      *     {@link java.text.DateFormat#FULL DateFormat.FULL}.
      * @param locale the desired locale.
-     * @throws    IllegalArgumentException if <code>style</code> is invalid,
-     *     or if <code>locale</code> isn't
+     * @throws    IllegalArgumentException if {@code style} is invalid,
+     *     or if {@code locale} isn't
      *     one of the locales returned from
      *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
      *     getAvailableLocales()}.
-     * @throws    NullPointerException if <code>locale</code> is null
+     * @throws    NullPointerException if {@code locale} is null
      * @return a date formatter.
      * @see java.text.DateFormat#getDateInstance(int, java.util.Locale)
      */
     public abstract DateFormat getDateInstance(int style, Locale locale);
 
     /**
-     * Returns a new <code>DateFormat</code> instance which formats date and time
+     * Returns a new {@code DateFormat} instance which formats date and time
      * with the given formatting style for the specified locale.
      * @param dateStyle the given date formatting style.  Either one of
      *     {@link java.text.DateFormat#SHORT DateFormat.SHORT},
@@ -99,13 +99,13 @@
      *     {@link java.text.DateFormat#LONG DateFormat.LONG}, or
      *     {@link java.text.DateFormat#FULL DateFormat.FULL}.
      * @param locale the desired locale.
-     * @throws    IllegalArgumentException if <code>dateStyle</code> or
-     *     <code>timeStyle</code> is invalid,
-     *     or if <code>locale</code> isn't
+     * @throws    IllegalArgumentException if {@code dateStyle} or
+     *     {@code timeStyle} is invalid,
+     *     or if {@code locale} isn't
      *     one of the locales returned from
      *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
      *     getAvailableLocales()}.
-     * @throws    NullPointerException if <code>locale</code> is null
+     * @throws    NullPointerException if {@code locale} is null
      * @return a date/time formatter.
      * @see java.text.DateFormat#getDateTimeInstance(int, int, java.util.Locale)
      */
--- a/src/java.base/share/classes/java/text/spi/DateFormatSymbolsProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/spi/DateFormatSymbolsProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -46,16 +46,16 @@
     }
 
     /**
-     * Returns a new <code>DateFormatSymbols</code> instance for the
+     * Returns a new {@code DateFormatSymbols} instance for the
      * specified locale.
      *
      * @param locale the desired locale
-     * @throws    NullPointerException if <code>locale</code> is null
-     * @throws    IllegalArgumentException if <code>locale</code> isn't
+     * @throws    NullPointerException if {@code locale} is null
+     * @throws    IllegalArgumentException if {@code locale} isn't
      *     one of the locales returned from
      *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
      *     getAvailableLocales()}.
-     * @return a <code>DateFormatSymbols</code> instance.
+     * @return a {@code DateFormatSymbols} instance.
      * @see java.text.DateFormatSymbols#getInstance(java.util.Locale)
      */
     public abstract DateFormatSymbols getInstance(Locale locale);
--- a/src/java.base/share/classes/java/text/spi/DecimalFormatSymbolsProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/spi/DecimalFormatSymbolsProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -56,16 +56,16 @@
     }
 
     /**
-     * Returns a new <code>DecimalFormatSymbols</code> instance for the
+     * Returns a new {@code DecimalFormatSymbols} instance for the
      * specified locale.
      *
      * @param locale the desired locale
-     * @throws    NullPointerException if <code>locale</code> is null
-     * @throws    IllegalArgumentException if <code>locale</code> isn't
+     * @throws    NullPointerException if {@code locale} is null
+     * @throws    IllegalArgumentException if {@code locale} isn't
      *     one of the locales returned from
      *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
      *     getAvailableLocales()}.
-     * @return a <code>DecimalFormatSymbols</code> instance.
+     * @return a {@code DecimalFormatSymbols} instance.
      * @see java.text.DecimalFormatSymbols#getInstance(java.util.Locale)
      */
     public abstract DecimalFormatSymbols getInstance(Locale locale);
--- a/src/java.base/share/classes/java/text/spi/NumberFormatProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/text/spi/NumberFormatProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -46,12 +46,12 @@
     }
 
     /**
-     * Returns a new <code>NumberFormat</code> instance which formats
+     * Returns a new {@code NumberFormat} instance which formats
      * monetary values for the specified locale.
      *
      * @param locale the desired locale.
-     * @throws    NullPointerException if <code>locale</code> is null
-     * @throws    IllegalArgumentException if <code>locale</code> isn't
+     * @throws    NullPointerException if {@code locale} is null
+     * @throws    IllegalArgumentException if {@code locale} isn't
      *     one of the locales returned from
      *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
      *     getAvailableLocales()}.
@@ -61,7 +61,7 @@
     public abstract NumberFormat getCurrencyInstance(Locale locale);
 
     /**
-     * Returns a new <code>NumberFormat</code> instance which formats
+     * Returns a new {@code NumberFormat} instance which formats
      * integer values for the specified locale.
      * The returned number format is configured to
      * round floating point numbers to the nearest integer using
@@ -71,8 +71,8 @@
      * java.text.NumberFormat#isParseIntegerOnly isParseIntegerOnly}).
      *
      * @param locale the desired locale
-     * @throws    NullPointerException if <code>locale</code> is null
-     * @throws    IllegalArgumentException if <code>locale</code> isn't
+     * @throws    NullPointerException if {@code locale} is null
+     * @throws    IllegalArgumentException if {@code locale} isn't
      *     one of the locales returned from
      *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
      *     getAvailableLocales()}.
@@ -82,12 +82,12 @@
     public abstract NumberFormat getIntegerInstance(Locale locale);
 
     /**
-     * Returns a new general-purpose <code>NumberFormat</code> instance for
+     * Returns a new general-purpose {@code NumberFormat} instance for
      * the specified locale.
      *
      * @param locale the desired locale
-     * @throws    NullPointerException if <code>locale</code> is null
-     * @throws    IllegalArgumentException if <code>locale</code> isn't
+     * @throws    NullPointerException if {@code locale} is null
+     * @throws    IllegalArgumentException if {@code locale} isn't
      *     one of the locales returned from
      *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
      *     getAvailableLocales()}.
@@ -97,12 +97,12 @@
     public abstract NumberFormat getNumberInstance(Locale locale);
 
     /**
-     * Returns a new <code>NumberFormat</code> instance which formats
+     * Returns a new {@code NumberFormat} instance which formats
      * percentage values for the specified locale.
      *
      * @param locale the desired locale
-     * @throws    NullPointerException if <code>locale</code> is null
-     * @throws    IllegalArgumentException if <code>locale</code> isn't
+     * @throws    NullPointerException if {@code locale} is null
+     * @throws    IllegalArgumentException if {@code locale} isn't
      *     one of the locales returned from
      *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
      *     getAvailableLocales()}.
--- a/src/java.base/share/classes/java/time/ZoneId.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/time/ZoneId.java	Wed Sep 25 22:40:41 2019 +0200
@@ -339,7 +339,7 @@
      *  The rules of the returned {@code ZoneId} will be equivalent to the
      *  parsed {@code ZoneOffset}.
      * <li>All other IDs are parsed as region-based zone IDs. Region IDs must
-     *  match the regular expression <code>[A-Za-z][A-Za-z0-9~/._+-]+</code>
+     *  match the regular expression {@code [A-Za-z][A-Za-z0-9~/._+-]+}
      *  otherwise a {@code DateTimeException} is thrown. If the zone ID is not
      *  in the configured set of IDs, {@code ZoneRulesException} is thrown.
      *  The detailed format of the region ID depends on the group supplying the data.
--- a/src/java.base/share/classes/java/util/Calendar.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/Calendar.java	Wed Sep 25 22:40:41 2019 +0200
@@ -62,10 +62,10 @@
 import sun.util.spi.CalendarProvider;
 
 /**
- * The <code>Calendar</code> class is an abstract class that provides methods
+ * The {@code Calendar} class is an abstract class that provides methods
  * for converting between a specific instant in time and a set of {@link
- * #fields calendar fields} such as <code>YEAR</code>, <code>MONTH</code>,
- * <code>DAY_OF_MONTH</code>, <code>HOUR</code>, and so on, and for
+ * #fields calendar fields} such as {@code YEAR}, {@code MONTH},
+ * {@code DAY_OF_MONTH}, {@code HOUR}, and so on, and for
  * manipulating the calendar fields, such as getting the date of the next
  * week. An instant in time can be represented by a millisecond value that is
  * an offset from the <a id="Epoch"><em>Epoch</em></a>, January 1, 1970
@@ -73,13 +73,13 @@
  *
  * <p>The class also provides additional fields and methods for
  * implementing a concrete calendar system outside the package. Those
- * fields and methods are defined as <code>protected</code>.
+ * fields and methods are defined as {@code protected}.
  *
  * <p>
- * Like other locale-sensitive classes, <code>Calendar</code> provides a
- * class method, <code>getInstance</code>, for getting a generally useful
- * object of this type. <code>Calendar</code>'s <code>getInstance</code> method
- * returns a <code>Calendar</code> object whose
+ * Like other locale-sensitive classes, {@code Calendar} provides a
+ * class method, {@code getInstance}, for getting a generally useful
+ * object of this type. {@code Calendar}'s {@code getInstance} method
+ * returns a {@code Calendar} object whose
  * calendar fields have been initialized with the current date and time:
  * <blockquote>
  * <pre>
@@ -87,47 +87,47 @@
  * </pre>
  * </blockquote>
  *
- * <p>A <code>Calendar</code> object can produce all the calendar field values
+ * <p>A {@code Calendar} object can produce all the calendar field values
  * needed to implement the date-time formatting for a particular language and
  * calendar style (for example, Japanese-Gregorian, Japanese-Traditional).
- * <code>Calendar</code> defines the range of values returned by
+ * {@code Calendar} defines the range of values returned by
  * certain calendar fields, as well as their meaning.  For example,
  * the first month of the calendar system has value <code>MONTH ==
  * JANUARY</code> for all calendars.  Other values are defined by the
- * concrete subclass, such as <code>ERA</code>.  See individual field
+ * concrete subclass, such as {@code ERA}.  See individual field
  * documentation and subclass documentation for details.
  *
  * <h2>Getting and Setting Calendar Field Values</h2>
  *
- * <p>The calendar field values can be set by calling the <code>set</code>
- * methods. Any field values set in a <code>Calendar</code> will not be
+ * <p>The calendar field values can be set by calling the {@code set}
+ * methods. Any field values set in a {@code Calendar} will not be
  * interpreted until it needs to calculate its time value (milliseconds from
  * the Epoch) or values of the calendar fields. Calling the
- * <code>get</code>, <code>getTimeInMillis</code>, <code>getTime</code>,
- * <code>add</code> and <code>roll</code> involves such calculation.
+ * {@code get}, {@code getTimeInMillis}, {@code getTime},
+ * {@code add} and {@code roll} involves such calculation.
  *
  * <h3>Leniency</h3>
  *
- * <p><code>Calendar</code> has two modes for interpreting the calendar
+ * <p>{@code Calendar} has two modes for interpreting the calendar
  * fields, <em>lenient</em> and <em>non-lenient</em>.  When a
- * <code>Calendar</code> is in lenient mode, it accepts a wider range of
- * calendar field values than it produces.  When a <code>Calendar</code>
- * recomputes calendar field values for return by <code>get()</code>, all of
+ * {@code Calendar} is in lenient mode, it accepts a wider range of
+ * calendar field values than it produces.  When a {@code Calendar}
+ * recomputes calendar field values for return by {@code get()}, all of
  * the calendar fields are normalized. For example, a lenient
- * <code>GregorianCalendar</code> interprets <code>MONTH == JANUARY</code>,
- * <code>DAY_OF_MONTH == 32</code> as February 1.
+ * {@code GregorianCalendar} interprets {@code MONTH == JANUARY},
+ * {@code DAY_OF_MONTH == 32} as February 1.
 
- * <p>When a <code>Calendar</code> is in non-lenient mode, it throws an
+ * <p>When a {@code Calendar} is in non-lenient mode, it throws an
  * exception if there is any inconsistency in its calendar fields. For
- * example, a <code>GregorianCalendar</code> always produces
- * <code>DAY_OF_MONTH</code> values between 1 and the length of the month. A
- * non-lenient <code>GregorianCalendar</code> throws an exception upon
+ * example, a {@code GregorianCalendar} always produces
+ * {@code DAY_OF_MONTH} values between 1 and the length of the month. A
+ * non-lenient {@code GregorianCalendar} throws an exception upon
  * calculating its time or calendar field values if any out-of-range field
  * value has been set.
  *
  * <h3><a id="first_week">First Week</a></h3>
  *
- * <code>Calendar</code> defines a locale-specific seven day week using two
+ * {@code Calendar} defines a locale-specific seven day week using two
  * parameters: the first day of the week and the minimal days in first week
  * (from 1 to 7).  These numbers are taken from the locale resource data or the
  * locale itself when a {@code Calendar} is constructed. If the designated
@@ -138,15 +138,15 @@
  * They may also be specified explicitly through the methods for setting their
  * values.
  *
- * <p>When setting or getting the <code>WEEK_OF_MONTH</code> or
- * <code>WEEK_OF_YEAR</code> fields, <code>Calendar</code> must determine the
+ * <p>When setting or getting the {@code WEEK_OF_MONTH} or
+ * {@code WEEK_OF_YEAR} fields, {@code Calendar} must determine the
  * first week of the month or year as a reference point.  The first week of a
  * month or year is defined as the earliest seven day period beginning on
- * <code>getFirstDayOfWeek()</code> and containing at least
- * <code>getMinimalDaysInFirstWeek()</code> days of that month or year.  Weeks
+ * {@code getFirstDayOfWeek()} and containing at least
+ * {@code getMinimalDaysInFirstWeek()} days of that month or year.  Weeks
  * numbered ..., -1, 0 precede the first week; weeks numbered 2, 3,... follow
- * it.  Note that the normalized numbering returned by <code>get()</code> may be
- * different.  For example, a specific <code>Calendar</code> subclass may
+ * it.  Note that the normalized numbering returned by {@code get()} may be
+ * different.  For example, a specific {@code Calendar} subclass may
  * designate the week before week 1 of a year as week <code><i>n</i></code> of
  * the previous year.
  *
@@ -156,12 +156,12 @@
  * may be insufficient information for the computation (such as only
  * year and month with no day of month), or there may be inconsistent
  * information (such as Tuesday, July 15, 1996 (Gregorian) -- July 15,
- * 1996 is actually a Monday). <code>Calendar</code> will resolve
+ * 1996 is actually a Monday). {@code Calendar} will resolve
  * calendar field values to determine the date and time in the
  * following way.
  *
  * <p><a id="resolution">If there is any conflict in calendar field values,
- * <code>Calendar</code> gives priorities to calendar fields that have been set
+ * {@code Calendar} gives priorities to calendar fields that have been set
  * more recently.</a> The following are the default combinations of the
  * calendar fields. The most recent combination, as determined by the
  * most recently set single field, will be used.
@@ -184,11 +184,11 @@
  * </pre></blockquote>
  *
  * <p>If there are any calendar fields whose values haven't been set in the selected
- * field combination, <code>Calendar</code> uses their default values. The default
+ * field combination, {@code Calendar} uses their default values. The default
  * value of each field may vary by concrete calendar systems. For example, in
- * <code>GregorianCalendar</code>, the default of a field is the same as that
- * of the start of the Epoch: i.e., <code>YEAR = 1970</code>, <code>MONTH =
- * JANUARY</code>, <code>DAY_OF_MONTH = 1</code>, etc.
+ * {@code GregorianCalendar}, the default of a field is the same as that
+ * of the start of the Epoch: i.e., {@code YEAR = 1970}, <code>MONTH =
+ * JANUARY</code>, {@code DAY_OF_MONTH = 1}, etc.
  *
  * <p>
  * <strong>Note:</strong> There are certain possible ambiguities in
@@ -213,98 +213,98 @@
  * <h3>Field Manipulation</h3>
  *
  * The calendar fields can be changed using three methods:
- * <code>set()</code>, <code>add()</code>, and <code>roll()</code>.
+ * {@code set()}, {@code add()}, and {@code roll()}.
  *
- * <p><strong><code>set(f, value)</code></strong> changes calendar field
- * <code>f</code> to <code>value</code>.  In addition, it sets an
- * internal member variable to indicate that calendar field <code>f</code> has
- * been changed. Although calendar field <code>f</code> is changed immediately,
+ * <p><strong>{@code set(f, value)}</strong> changes calendar field
+ * {@code f} to {@code value}.  In addition, it sets an
+ * internal member variable to indicate that calendar field {@code f} has
+ * been changed. Although calendar field {@code f} is changed immediately,
  * the calendar's time value in milliseconds is not recomputed until the next call to
- * <code>get()</code>, <code>getTime()</code>, <code>getTimeInMillis()</code>,
- * <code>add()</code>, or <code>roll()</code> is made. Thus, multiple calls to
- * <code>set()</code> do not trigger multiple, unnecessary
+ * {@code get()}, {@code getTime()}, {@code getTimeInMillis()},
+ * {@code add()}, or {@code roll()} is made. Thus, multiple calls to
+ * {@code set()} do not trigger multiple, unnecessary
  * computations. As a result of changing a calendar field using
- * <code>set()</code>, other calendar fields may also change, depending on the
+ * {@code set()}, other calendar fields may also change, depending on the
  * calendar field, the calendar field value, and the calendar system. In addition,
- * <code>get(f)</code> will not necessarily return <code>value</code> set by
- * the call to the <code>set</code> method
+ * {@code get(f)} will not necessarily return {@code value} set by
+ * the call to the {@code set} method
  * after the calendar fields have been recomputed. The specifics are determined by
  * the concrete calendar class.</p>
  *
- * <p><em>Example</em>: Consider a <code>GregorianCalendar</code>
+ * <p><em>Example</em>: Consider a {@code GregorianCalendar}
  * originally set to August 31, 1999. Calling <code>set(Calendar.MONTH,
  * Calendar.SEPTEMBER)</code> sets the date to September 31,
  * 1999. This is a temporary internal representation that resolves to
- * October 1, 1999 if <code>getTime()</code>is then called. However, a
- * call to <code>set(Calendar.DAY_OF_MONTH, 30)</code> before the call to
- * <code>getTime()</code> sets the date to September 30, 1999, since
- * no recomputation occurs after <code>set()</code> itself.</p>
+ * October 1, 1999 if {@code getTime()}is then called. However, a
+ * call to {@code set(Calendar.DAY_OF_MONTH, 30)} before the call to
+ * {@code getTime()} sets the date to September 30, 1999, since
+ * no recomputation occurs after {@code set()} itself.</p>
  *
- * <p><strong><code>add(f, delta)</code></strong> adds <code>delta</code>
- * to field <code>f</code>.  This is equivalent to calling <code>set(f,
+ * <p><strong>{@code add(f, delta)}</strong> adds {@code delta}
+ * to field {@code f}.  This is equivalent to calling <code>set(f,
  * get(f) + delta)</code> with two adjustments:</p>
  *
  * <blockquote>
- *   <p><strong>Add rule 1</strong>. The value of field <code>f</code>
- *   after the call minus the value of field <code>f</code> before the
- *   call is <code>delta</code>, modulo any overflow that has occurred in
- *   field <code>f</code>. Overflow occurs when a field value exceeds its
+ *   <p><strong>Add rule 1</strong>. The value of field {@code f}
+ *   after the call minus the value of field {@code f} before the
+ *   call is {@code delta}, modulo any overflow that has occurred in
+ *   field {@code f}. Overflow occurs when a field value exceeds its
  *   range and, as a result, the next larger field is incremented or
  *   decremented and the field value is adjusted back into its range.</p>
  *
  *   <p><strong>Add rule 2</strong>. If a smaller field is expected to be
  *   invariant, but it is impossible for it to be equal to its
  *   prior value because of changes in its minimum or maximum after field
- *   <code>f</code> is changed or other constraints, such as time zone
+ *   {@code f} is changed or other constraints, such as time zone
  *   offset changes, then its value is adjusted to be as close
  *   as possible to its expected value. A smaller field represents a
- *   smaller unit of time. <code>HOUR</code> is a smaller field than
- *   <code>DAY_OF_MONTH</code>. No adjustment is made to smaller fields
+ *   smaller unit of time. {@code HOUR} is a smaller field than
+ *   {@code DAY_OF_MONTH}. No adjustment is made to smaller fields
  *   that are not expected to be invariant. The calendar system
  *   determines what fields are expected to be invariant.</p>
  * </blockquote>
  *
- * <p>In addition, unlike <code>set()</code>, <code>add()</code> forces
+ * <p>In addition, unlike {@code set()}, {@code add()} forces
  * an immediate recomputation of the calendar's milliseconds and all
  * fields.</p>
  *
- * <p><em>Example</em>: Consider a <code>GregorianCalendar</code>
+ * <p><em>Example</em>: Consider a {@code GregorianCalendar}
  * originally set to August 31, 1999. Calling <code>add(Calendar.MONTH,
  * 13)</code> sets the calendar to September 30, 2000. <strong>Add rule
- * 1</strong> sets the <code>MONTH</code> field to September, since
+ * 1</strong> sets the {@code MONTH} field to September, since
  * adding 13 months to August gives September of the next year. Since
- * <code>DAY_OF_MONTH</code> cannot be 31 in September in a
- * <code>GregorianCalendar</code>, <strong>add rule 2</strong> sets the
- * <code>DAY_OF_MONTH</code> to 30, the closest possible value. Although
- * it is a smaller field, <code>DAY_OF_WEEK</code> is not adjusted by
+ * {@code DAY_OF_MONTH} cannot be 31 in September in a
+ * {@code GregorianCalendar}, <strong>add rule 2</strong> sets the
+ * {@code DAY_OF_MONTH} to 30, the closest possible value. Although
+ * it is a smaller field, {@code DAY_OF_WEEK} is not adjusted by
  * rule 2, since it is expected to change when the month changes in a
- * <code>GregorianCalendar</code>.</p>
+ * {@code GregorianCalendar}.</p>
  *
- * <p><strong><code>roll(f, delta)</code></strong> adds
- * <code>delta</code> to field <code>f</code> without changing larger
- * fields. This is equivalent to calling <code>add(f, delta)</code> with
+ * <p><strong>{@code roll(f, delta)}</strong> adds
+ * {@code delta} to field {@code f} without changing larger
+ * fields. This is equivalent to calling {@code add(f, delta)} with
  * the following adjustment:</p>
  *
  * <blockquote>
  *   <p><strong>Roll rule</strong>. Larger fields are unchanged after the
  *   call. A larger field represents a larger unit of
- *   time. <code>DAY_OF_MONTH</code> is a larger field than
- *   <code>HOUR</code>.</p>
+ *   time. {@code DAY_OF_MONTH} is a larger field than
+ *   {@code HOUR}.</p>
  * </blockquote>
  *
  * <p><em>Example</em>: See {@link java.util.GregorianCalendar#roll(int, int)}.
  *
  * <p><strong>Usage model</strong>. To motivate the behavior of
- * <code>add()</code> and <code>roll()</code>, consider a user interface
+ * {@code add()} and {@code roll()}, consider a user interface
  * component with increment and decrement buttons for the month, day, and
- * year, and an underlying <code>GregorianCalendar</code>. If the
+ * year, and an underlying {@code GregorianCalendar}. If the
  * interface reads January 31, 1999 and the user presses the month
  * increment button, what should it read? If the underlying
- * implementation uses <code>set()</code>, it might read March 3, 1999. A
+ * implementation uses {@code set()}, it might read March 3, 1999. A
  * better result would be February 28, 1999. Furthermore, if the user
  * presses the month increment button again, it should read March 31,
  * 1999, not March 28, 1999. By saving the original date and using either
- * <code>add()</code> or <code>roll()</code>, depending on whether larger
+ * {@code add()} or {@code roll()}, depending on whether larger
  * fields should be affected, the user interface can behave as most users
  * will intuitively expect.</p>
  *
@@ -369,7 +369,7 @@
     // ranges when they are regenerated.
 
     /**
-     * Field number for <code>get</code> and <code>set</code> indicating the
+     * Field number for {@code get} and {@code set} indicating the
      * era, e.g., AD or BC in the Julian calendar. This is a calendar-specific
      * value; see subclass documentation.
      *
@@ -379,16 +379,16 @@
     public static final int ERA = 0;
 
     /**
-     * Field number for <code>get</code> and <code>set</code> indicating the
+     * Field number for {@code get} and {@code set} indicating the
      * year. This is a calendar-specific value; see subclass documentation.
      */
     public static final int YEAR = 1;
 
     /**
-     * Field number for <code>get</code> and <code>set</code> indicating the
+     * Field number for {@code get} and {@code set} indicating the
      * month. This is a calendar-specific value. The first month of
      * the year in the Gregorian and Julian calendars is
-     * <code>JANUARY</code> which is 0; the last depends on the number
+     * {@code JANUARY} which is 0; the last depends on the number
      * of months in a year.
      *
      * @see #JANUARY
@@ -408,11 +408,11 @@
     public static final int MONTH = 2;
 
     /**
-     * Field number for <code>get</code> and <code>set</code> indicating the
+     * Field number for {@code get} and {@code set} indicating the
      * week number within the current year.  The first week of the year, as
-     * defined by <code>getFirstDayOfWeek()</code> and
-     * <code>getMinimalDaysInFirstWeek()</code>, has value 1.  Subclasses define
-     * the value of <code>WEEK_OF_YEAR</code> for days before the first week of
+     * defined by {@code getFirstDayOfWeek()} and
+     * {@code getMinimalDaysInFirstWeek()}, has value 1.  Subclasses define
+     * the value of {@code WEEK_OF_YEAR} for days before the first week of
      * the year.
      *
      * @see #getFirstDayOfWeek
@@ -421,11 +421,11 @@
     public static final int WEEK_OF_YEAR = 3;
 
     /**
-     * Field number for <code>get</code> and <code>set</code> indicating the
+     * Field number for {@code get} and {@code set} indicating the
      * week number within the current month.  The first week of the month, as
-     * defined by <code>getFirstDayOfWeek()</code> and
-     * <code>getMinimalDaysInFirstWeek()</code>, has value 1.  Subclasses define
-     * the value of <code>WEEK_OF_MONTH</code> for days before the first week of
+     * defined by {@code getFirstDayOfWeek()} and
+     * {@code getMinimalDaysInFirstWeek()}, has value 1.  Subclasses define
+     * the value of {@code WEEK_OF_MONTH} for days before the first week of
      * the month.
      *
      * @see #getFirstDayOfWeek
@@ -434,8 +434,8 @@
     public static final int WEEK_OF_MONTH = 4;
 
     /**
-     * Field number for <code>get</code> and <code>set</code> indicating the
-     * day of the month. This is a synonym for <code>DAY_OF_MONTH</code>.
+     * Field number for {@code get} and {@code set} indicating the
+     * day of the month. This is a synonym for {@code DAY_OF_MONTH}.
      * The first day of the month has value 1.
      *
      * @see #DAY_OF_MONTH
@@ -443,8 +443,8 @@
     public static final int DATE = 5;
 
     /**
-     * Field number for <code>get</code> and <code>set</code> indicating the
-     * day of the month. This is a synonym for <code>DATE</code>.
+     * Field number for {@code get} and {@code set} indicating the
+     * day of the month. This is a synonym for {@code DATE}.
      * The first day of the month has value 1.
      *
      * @see #DATE
@@ -452,16 +452,16 @@
     public static final int DAY_OF_MONTH = 5;
 
     /**
-     * Field number for <code>get</code> and <code>set</code> indicating the day
+     * Field number for {@code get} and {@code set} indicating the day
      * number within the current year.  The first day of the year has value 1.
      */
     public static final int DAY_OF_YEAR = 6;
 
     /**
-     * Field number for <code>get</code> and <code>set</code> indicating the day
-     * of the week.  This field takes values <code>SUNDAY</code>,
-     * <code>MONDAY</code>, <code>TUESDAY</code>, <code>WEDNESDAY</code>,
-     * <code>THURSDAY</code>, <code>FRIDAY</code>, and <code>SATURDAY</code>.
+     * Field number for {@code get} and {@code set} indicating the day
+     * of the week.  This field takes values {@code SUNDAY},
+     * {@code MONDAY}, {@code TUESDAY}, {@code WEDNESDAY},
+     * {@code THURSDAY}, {@code FRIDAY}, and {@code SATURDAY}.
      *
      * @see #SUNDAY
      * @see #MONDAY
@@ -474,24 +474,24 @@
     public static final int DAY_OF_WEEK = 7;
 
     /**
-     * Field number for <code>get</code> and <code>set</code> indicating the
+     * Field number for {@code get} and {@code set} indicating the
      * ordinal number of the day of the week within the current month. Together
-     * with the <code>DAY_OF_WEEK</code> field, this uniquely specifies a day
-     * within a month.  Unlike <code>WEEK_OF_MONTH</code> and
-     * <code>WEEK_OF_YEAR</code>, this field's value does <em>not</em> depend on
-     * <code>getFirstDayOfWeek()</code> or
-     * <code>getMinimalDaysInFirstWeek()</code>.  <code>DAY_OF_MONTH 1</code>
-     * through <code>7</code> always correspond to <code>DAY_OF_WEEK_IN_MONTH
-     * 1</code>; <code>8</code> through <code>14</code> correspond to
-     * <code>DAY_OF_WEEK_IN_MONTH 2</code>, and so on.
-     * <code>DAY_OF_WEEK_IN_MONTH 0</code> indicates the week before
-     * <code>DAY_OF_WEEK_IN_MONTH 1</code>.  Negative values count back from the
+     * with the {@code DAY_OF_WEEK} field, this uniquely specifies a day
+     * within a month.  Unlike {@code WEEK_OF_MONTH} and
+     * {@code WEEK_OF_YEAR}, this field's value does <em>not</em> depend on
+     * {@code getFirstDayOfWeek()} or
+     * {@code getMinimalDaysInFirstWeek()}.  {@code DAY_OF_MONTH 1}
+     * through {@code 7} always correspond to <code>DAY_OF_WEEK_IN_MONTH
+     * 1</code>; {@code 8} through {@code 14} correspond to
+     * {@code DAY_OF_WEEK_IN_MONTH 2}, and so on.
+     * {@code DAY_OF_WEEK_IN_MONTH 0} indicates the week before
+     * {@code DAY_OF_WEEK_IN_MONTH 1}.  Negative values count back from the
      * end of the month, so the last Sunday of a month is specified as
-     * <code>DAY_OF_WEEK = SUNDAY, DAY_OF_WEEK_IN_MONTH = -1</code>.  Because
+     * {@code DAY_OF_WEEK = SUNDAY, DAY_OF_WEEK_IN_MONTH = -1}.  Because
      * negative values count backward they will usually be aligned differently
      * within the month than positive values.  For example, if a month has 31
-     * days, <code>DAY_OF_WEEK_IN_MONTH -1</code> will overlap
-     * <code>DAY_OF_WEEK_IN_MONTH 5</code> and the end of <code>4</code>.
+     * days, {@code DAY_OF_WEEK_IN_MONTH -1} will overlap
+     * {@code DAY_OF_WEEK_IN_MONTH 5} and the end of {@code 4}.
      *
      * @see #DAY_OF_WEEK
      * @see #WEEK_OF_MONTH
@@ -499,9 +499,9 @@
     public static final int DAY_OF_WEEK_IN_MONTH = 8;
 
     /**
-     * Field number for <code>get</code> and <code>set</code> indicating
-     * whether the <code>HOUR</code> is before or after noon.
-     * E.g., at 10:04:15.250 PM the <code>AM_PM</code> is <code>PM</code>.
+     * Field number for {@code get} and {@code set} indicating
+     * whether the {@code HOUR} is before or after noon.
+     * E.g., at 10:04:15.250 PM the {@code AM_PM} is {@code PM}.
      *
      * @see #AM
      * @see #PM
@@ -510,10 +510,10 @@
     public static final int AM_PM = 9;
 
     /**
-     * Field number for <code>get</code> and <code>set</code> indicating the
-     * hour of the morning or afternoon. <code>HOUR</code> is used for the
+     * Field number for {@code get} and {@code set} indicating the
+     * hour of the morning or afternoon. {@code HOUR} is used for the
      * 12-hour clock (0 - 11). Noon and midnight are represented by 0, not by 12.
-     * E.g., at 10:04:15.250 PM the <code>HOUR</code> is 10.
+     * E.g., at 10:04:15.250 PM the {@code HOUR} is 10.
      *
      * @see #AM_PM
      * @see #HOUR_OF_DAY
@@ -521,60 +521,60 @@
     public static final int HOUR = 10;
 
     /**
-     * Field number for <code>get</code> and <code>set</code> indicating the
-     * hour of the day. <code>HOUR_OF_DAY</code> is used for the 24-hour clock.
-     * E.g., at 10:04:15.250 PM the <code>HOUR_OF_DAY</code> is 22.
+     * Field number for {@code get} and {@code set} indicating the
+     * hour of the day. {@code HOUR_OF_DAY} is used for the 24-hour clock.
+     * E.g., at 10:04:15.250 PM the {@code HOUR_OF_DAY} is 22.
      *
      * @see #HOUR
      */
     public static final int HOUR_OF_DAY = 11;
 
     /**
-     * Field number for <code>get</code> and <code>set</code> indicating the
+     * Field number for {@code get} and {@code set} indicating the
      * minute within the hour.
-     * E.g., at 10:04:15.250 PM the <code>MINUTE</code> is 4.
+     * E.g., at 10:04:15.250 PM the {@code MINUTE} is 4.
      */
     public static final int MINUTE = 12;
 
     /**
-     * Field number for <code>get</code> and <code>set</code> indicating the
+     * Field number for {@code get} and {@code set} indicating the
      * second within the minute.
-     * E.g., at 10:04:15.250 PM the <code>SECOND</code> is 15.
+     * E.g., at 10:04:15.250 PM the {@code SECOND} is 15.
      */
     public static final int SECOND = 13;
 
     /**
-     * Field number for <code>get</code> and <code>set</code> indicating the
+     * Field number for {@code get} and {@code set} indicating the
      * millisecond within the second.
-     * E.g., at 10:04:15.250 PM the <code>MILLISECOND</code> is 250.
+     * E.g., at 10:04:15.250 PM the {@code MILLISECOND} is 250.
      */
     public static final int MILLISECOND = 14;
 
     /**
-     * Field number for <code>get</code> and <code>set</code>
+     * Field number for {@code get} and {@code set}
      * indicating the raw offset from GMT in milliseconds.
      * <p>
      * This field reflects the correct GMT offset value of the time
-     * zone of this <code>Calendar</code> if the
-     * <code>TimeZone</code> implementation subclass supports
+     * zone of this {@code Calendar} if the
+     * {@code TimeZone} implementation subclass supports
      * historical GMT offset changes.
      */
     public static final int ZONE_OFFSET = 15;
 
     /**
-     * Field number for <code>get</code> and <code>set</code> indicating the
+     * Field number for {@code get} and {@code set} indicating the
      * daylight saving offset in milliseconds.
      * <p>
      * This field reflects the correct daylight saving offset value of
-     * the time zone of this <code>Calendar</code> if the
-     * <code>TimeZone</code> implementation subclass supports
+     * the time zone of this {@code Calendar} if the
+     * {@code TimeZone} implementation subclass supports
      * historical Daylight Saving Time schedule changes.
      */
     public static final int DST_OFFSET = 16;
 
     /**
-     * The number of distinct fields recognized by <code>get</code> and <code>set</code>.
-     * Field numbers range from <code>0..FIELD_COUNT-1</code>.
+     * The number of distinct fields recognized by {@code get} and {@code set}.
+     * Field numbers range from {@code 0..FIELD_COUNT-1}.
      */
     public static final int FIELD_COUNT = 17;
 
@@ -694,7 +694,7 @@
 
     /**
      * Value of the {@link #MONTH} field indicating the
-     * thirteenth month of the year. Although <code>GregorianCalendar</code>
+     * thirteenth month of the year. Although {@code GregorianCalendar}
      * does not use this value, lunar calendars do.
      */
     public static final int UNDECIMBER = 12;
@@ -839,8 +839,8 @@
 
     /**
      * The calendar field values for the currently set time for this calendar.
-     * This is an array of <code>FIELD_COUNT</code> integers, with index values
-     * <code>ERA</code> through <code>DST_OFFSET</code>.
+     * This is an array of {@code FIELD_COUNT} integers, with index values
+     * {@code ERA} through {@code DST_OFFSET}.
      * @serial
      */
     @SuppressWarnings("ProtectedField")
@@ -850,8 +850,8 @@
      * The flags which tell if a specified calendar field for the calendar is set.
      * A new object has no fields set.  After the first call to a method
      * which generates the fields, they all remain set after that.
-     * This is an array of <code>FIELD_COUNT</code> booleans, with index values
-     * <code>ERA</code> through <code>DST_OFFSET</code>.
+     * This is an array of {@code FIELD_COUNT} booleans, with index values
+     * {@code ERA} through {@code DST_OFFSET}.
      * @serial
      */
     @SuppressWarnings("ProtectedField")
@@ -874,8 +874,8 @@
     protected long          time;
 
     /**
-     * True if then the value of <code>time</code> is valid.
-     * The time is made invalid by a change to an item of <code>field[]</code>.
+     * True if then the value of {@code time} is valid.
+     * The time is made invalid by a change to an item of {@code field[]}.
      * @see #time
      * @serial
      */
@@ -883,10 +883,10 @@
     protected boolean       isTimeSet;
 
     /**
-     * True if <code>fields[]</code> are in sync with the currently set time.
+     * True if {@code fields[]} are in sync with the currently set time.
      * If false, then the next attempt to get the value of a field will
      * force a recomputation of all fields from the current value of
-     * <code>time</code>.
+     * {@code time}.
      * @serial
      */
     @SuppressWarnings("ProtectedField")
@@ -899,8 +899,8 @@
     transient boolean       areAllFieldsSet;
 
     /**
-     * <code>True</code> if this calendar allows out-of-range field values during computation
-     * of <code>time</code> from <code>fields[]</code>.
+     * {@code True} if this calendar allows out-of-range field values during computation
+     * of {@code time} from {@code fields[]}.
      * @see #setLenient
      * @see #isLenient
      * @serial
@@ -908,20 +908,20 @@
     private boolean         lenient = true;
 
     /**
-     * The <code>TimeZone</code> used by this calendar. <code>Calendar</code>
+     * The {@code TimeZone} used by this calendar. {@code Calendar}
      * uses the time zone data to translate between locale and GMT time.
      * @serial
      */
     private TimeZone        zone;
 
     /**
-     * <code>True</code> if zone references to a shared TimeZone object.
+     * {@code True} if zone references to a shared TimeZone object.
      */
     private transient boolean sharedZone = false;
 
     /**
-     * The first day of the week, with possible values <code>SUNDAY</code>,
-     * <code>MONDAY</code>, etc.  This is a locale-dependent value.
+     * The first day of the week, with possible values {@code SUNDAY},
+     * {@code MONDAY}, etc.  This is a locale-dependent value.
      * @serial
      */
     private int             firstDayOfWeek;
@@ -964,10 +964,10 @@
     static final int ALL_FIELDS = (1 << FIELD_COUNT) - 1;
 
     /**
-     * The next available value for <code>stamp[]</code>, an internal array.
+     * The next available value for {@code stamp[]}, an internal array.
      * This actually should not be written out to the stream, and will probably
      * be removed from the stream in the near future.  In the meantime,
-     * a value of <code>MINIMUM_USER_STAMP</code> should be used.
+     * a value of {@code MINIMUM_USER_STAMP} should be used.
      * @serial
      */
     private int             nextStamp = MINIMUM_USER_STAMP;
@@ -997,7 +997,7 @@
      * </dd>
      * </dl>
      * When streaming out this class, the most recent format
-     * and the highest allowable <code>serialVersionOnStream</code>
+     * and the highest allowable {@code serialVersionOnStream}
      * is written.
      * @serial
      * @since 1.1.6
@@ -1307,7 +1307,7 @@
          * Sets the time zone parameter to the given {@code zone}. If no time
          * zone parameter is given to this {@code Calendar.Builder}, the
          * {@linkplain TimeZone#getDefault() default
-         * <code>TimeZone</code>} will be used in the {@link #build() build}
+         * {@code TimeZone}} will be used in the {@link #build() build}
          * method.
          *
          * @param zone the {@link TimeZone}
@@ -1378,7 +1378,7 @@
         /**
          * Sets the locale parameter to the given {@code locale}. If no locale
          * is given to this {@code Calendar.Builder}, the {@linkplain
-         * Locale#getDefault(Locale.Category) default <code>Locale</code>}
+         * Locale#getDefault(Locale.Category) default {@code Locale}}
          * for {@link Locale.Category#FORMAT} will be used.
          *
          * <p>If no calendar type is explicitly given by a call to the
@@ -1614,7 +1614,7 @@
 
     /**
      * Gets a calendar using the default time zone and locale. The
-     * <code>Calendar</code> returned is based on the current time
+     * {@code Calendar} returned is based on the current time
      * in the default time zone with the default
      * {@link Locale.Category#FORMAT FORMAT} locale.
      * <p>
@@ -1632,7 +1632,7 @@
 
     /**
      * Gets a calendar using the specified time zone and default locale.
-     * The <code>Calendar</code> returned is based on the current time
+     * The {@code Calendar} returned is based on the current time
      * in the given time zone with the default
      * {@link Locale.Category#FORMAT FORMAT} locale.
      *
@@ -1646,7 +1646,7 @@
 
     /**
      * Gets a calendar using the default time zone and specified locale.
-     * The <code>Calendar</code> returned is based on the current time
+     * The {@code Calendar} returned is based on the current time
      * in the default time zone with the given locale.
      * <p>
      * If the locale contains the time zone with "tz"
@@ -1663,7 +1663,7 @@
 
     /**
      * Gets a calendar with the specified time zone and locale.
-     * The <code>Calendar</code> returned is based on the current time
+     * The {@code Calendar} returned is based on the current time
      * in the given time zone with the given locale.
      *
      * @param zone the time zone to use
@@ -1738,13 +1738,13 @@
     }
 
     /**
-     * Returns an array of all locales for which the <code>getInstance</code>
+     * Returns an array of all locales for which the {@code getInstance}
      * methods of this class can return localized instances.
-     * The array returned must contain at least a <code>Locale</code>
+     * The array returned must contain at least a {@code Locale}
      * instance equal to {@link java.util.Locale#US Locale.US}.
      *
      * @return An array of locales for which localized
-     *         <code>Calendar</code> instances are available.
+     *         {@code Calendar} instances are available.
      */
     public static synchronized Locale[] getAvailableLocales()
     {
@@ -1774,11 +1774,11 @@
     protected abstract void computeFields();
 
     /**
-     * Returns a <code>Date</code> object representing this
-     * <code>Calendar</code>'s time value (millisecond offset from the <a
+     * Returns a {@code Date} object representing this
+     * {@code Calendar}'s time value (millisecond offset from the <a
      * href="#Epoch">Epoch</a>").
      *
-     * @return a <code>Date</code> representing the time value.
+     * @return a {@code Date} representing the time value.
      * @see #setTime(Date)
      * @see #getTimeInMillis()
      */
@@ -1787,11 +1787,11 @@
     }
 
     /**
-     * Sets this Calendar's time with the given <code>Date</code>.
+     * Sets this Calendar's time with the given {@code Date}.
      * <p>
-     * Note: Calling <code>setTime()</code> with
-     * <code>Date(Long.MAX_VALUE)</code> or <code>Date(Long.MIN_VALUE)</code>
-     * may yield incorrect field values from <code>get()</code>.
+     * Note: Calling {@code setTime()} with
+     * {@code Date(Long.MAX_VALUE)} or {@code Date(Long.MIN_VALUE)}
+     * may yield incorrect field values from {@code get()}.
      *
      * @param date the given Date.
      * @see #getTime()
@@ -1874,7 +1874,7 @@
     /**
      * Sets the value of the given calendar field. This method does
      * not affect any setting state of the field in this
-     * <code>Calendar</code> instance.
+     * {@code Calendar} instance.
      *
      * @throws IndexOutOfBoundsException if the specified field is out of range
      *             (<code>field &lt; 0 || field &gt;= FIELD_COUNT</code>).
@@ -1920,15 +1920,15 @@
     }
 
     /**
-     * Sets the values for the calendar fields <code>YEAR</code>,
-     * <code>MONTH</code>, and <code>DAY_OF_MONTH</code>.
+     * Sets the values for the calendar fields {@code YEAR},
+     * {@code MONTH}, and {@code DAY_OF_MONTH}.
      * Previous values of other calendar fields are retained.  If this is not desired,
      * call {@link #clear()} first.
      *
-     * @param year the value used to set the <code>YEAR</code> calendar field.
-     * @param month the value used to set the <code>MONTH</code> calendar field.
+     * @param year the value used to set the {@code YEAR} calendar field.
+     * @param month the value used to set the {@code MONTH} calendar field.
      * Month value is 0-based. e.g., 0 for January.
-     * @param date the value used to set the <code>DAY_OF_MONTH</code> calendar field.
+     * @param date the value used to set the {@code DAY_OF_MONTH} calendar field.
      * @see #set(int,int)
      * @see #set(int,int,int,int,int)
      * @see #set(int,int,int,int,int,int)
@@ -1941,18 +1941,18 @@
     }
 
     /**
-     * Sets the values for the calendar fields <code>YEAR</code>,
-     * <code>MONTH</code>, <code>DAY_OF_MONTH</code>,
-     * <code>HOUR_OF_DAY</code>, and <code>MINUTE</code>.
+     * Sets the values for the calendar fields {@code YEAR},
+     * {@code MONTH}, {@code DAY_OF_MONTH},
+     * {@code HOUR_OF_DAY}, and {@code MINUTE}.
      * Previous values of other fields are retained.  If this is not desired,
      * call {@link #clear()} first.
      *
-     * @param year the value used to set the <code>YEAR</code> calendar field.
-     * @param month the value used to set the <code>MONTH</code> calendar field.
+     * @param year the value used to set the {@code YEAR} calendar field.
+     * @param month the value used to set the {@code MONTH} calendar field.
      * Month value is 0-based. e.g., 0 for January.
-     * @param date the value used to set the <code>DAY_OF_MONTH</code> calendar field.
-     * @param hourOfDay the value used to set the <code>HOUR_OF_DAY</code> calendar field.
-     * @param minute the value used to set the <code>MINUTE</code> calendar field.
+     * @param date the value used to set the {@code DAY_OF_MONTH} calendar field.
+     * @param hourOfDay the value used to set the {@code HOUR_OF_DAY} calendar field.
+     * @param minute the value used to set the {@code MINUTE} calendar field.
      * @see #set(int,int)
      * @see #set(int,int,int)
      * @see #set(int,int,int,int,int,int)
@@ -1967,19 +1967,19 @@
     }
 
     /**
-     * Sets the values for the fields <code>YEAR</code>, <code>MONTH</code>,
-     * <code>DAY_OF_MONTH</code>, <code>HOUR_OF_DAY</code>, <code>MINUTE</code>, and
-     * <code>SECOND</code>.
+     * Sets the values for the fields {@code YEAR}, {@code MONTH},
+     * {@code DAY_OF_MONTH}, {@code HOUR_OF_DAY}, {@code MINUTE}, and
+     * {@code SECOND}.
      * Previous values of other fields are retained.  If this is not desired,
      * call {@link #clear()} first.
      *
-     * @param year the value used to set the <code>YEAR</code> calendar field.
-     * @param month the value used to set the <code>MONTH</code> calendar field.
+     * @param year the value used to set the {@code YEAR} calendar field.
+     * @param month the value used to set the {@code MONTH} calendar field.
      * Month value is 0-based. e.g., 0 for January.
-     * @param date the value used to set the <code>DAY_OF_MONTH</code> calendar field.
-     * @param hourOfDay the value used to set the <code>HOUR_OF_DAY</code> calendar field.
-     * @param minute the value used to set the <code>MINUTE</code> calendar field.
-     * @param second the value used to set the <code>SECOND</code> calendar field.
+     * @param date the value used to set the {@code DAY_OF_MONTH} calendar field.
+     * @param hourOfDay the value used to set the {@code HOUR_OF_DAY} calendar field.
+     * @param minute the value used to set the {@code MINUTE} calendar field.
+     * @param second the value used to set the {@code SECOND} calendar field.
      * @see #set(int,int)
      * @see #set(int,int,int)
      * @see #set(int,int,int,int,int)
@@ -1998,14 +1998,14 @@
     /**
      * Sets all the calendar field values and the time value
      * (millisecond offset from the <a href="#Epoch">Epoch</a>) of
-     * this <code>Calendar</code> undefined. This means that {@link
-     * #isSet(int) isSet()} will return <code>false</code> for all the
+     * this {@code Calendar} undefined. This means that {@link
+     * #isSet(int) isSet()} will return {@code false} for all the
      * calendar fields, and the date and time calculations will treat
      * the fields as if they had never been set. A
-     * <code>Calendar</code> implementation class may use its specific
+     * {@code Calendar} implementation class may use its specific
      * default field values for date/time calculations. For example,
-     * <code>GregorianCalendar</code> uses 1970 if the
-     * <code>YEAR</code> field value is undefined.
+     * {@code GregorianCalendar} uses 1970 if the
+     * {@code YEAR} field value is undefined.
      *
      * @see #clear(int)
      */
@@ -2022,10 +2022,10 @@
     /**
      * Sets the given calendar field value and the time value
      * (millisecond offset from the <a href="#Epoch">Epoch</a>) of
-     * this <code>Calendar</code> undefined. This means that {@link
-     * #isSet(int) isSet(field)} will return <code>false</code>, and
+     * this {@code Calendar} undefined. This means that {@link
+     * #isSet(int) isSet(field)} will return {@code false}, and
      * the date and time calculations will treat the field as if it
-     * had never been set. A <code>Calendar</code> implementation
+     * had never been set. A {@code Calendar} implementation
      * class may use the field's specific default value for date and
      * time calculations.
      *
@@ -2033,7 +2033,7 @@
      * fields are handled independently and the <a
      * href="#time_resolution">the resolution rule for the time of
      * day</a> is applied. Clearing one of the fields doesn't reset
-     * the hour of day value of this <code>Calendar</code>. Use {@link
+     * the hour of day value of this {@code Calendar}. Use {@link
      * #set(int,int) set(Calendar.HOUR_OF_DAY, 0)} to reset the hour
      * value.
      *
@@ -2053,11 +2053,11 @@
     /**
      * Determines if the given calendar field has a value set,
      * including cases that the value has been set by internal fields
-     * calculations triggered by a <code>get</code> method call.
+     * calculations triggered by a {@code get} method call.
      *
      * @param field the calendar field to test
-     * @return <code>true</code> if the given calendar field has a value set;
-     * <code>false</code> otherwise.
+     * @return {@code true} if the given calendar field has a value set;
+     * {@code false} otherwise.
      */
     public final boolean isSet(int field)
     {
@@ -2066,24 +2066,24 @@
 
     /**
      * Returns the string representation of the calendar
-     * <code>field</code> value in the given <code>style</code> and
-     * <code>locale</code>.  If no string representation is
-     * applicable, <code>null</code> is returned. This method calls
+     * {@code field} value in the given {@code style} and
+     * {@code locale}.  If no string representation is
+     * applicable, {@code null} is returned. This method calls
      * {@link Calendar#get(int) get(field)} to get the calendar
-     * <code>field</code> value if the string representation is
-     * applicable to the given calendar <code>field</code>.
+     * {@code field} value if the string representation is
+     * applicable to the given calendar {@code field}.
      *
-     * <p>For example, if this <code>Calendar</code> is a
-     * <code>GregorianCalendar</code> and its date is 2005-01-01, then
+     * <p>For example, if this {@code Calendar} is a
+     * {@code GregorianCalendar} and its date is 2005-01-01, then
      * the string representation of the {@link #MONTH} field would be
      * "January" in the long style in an English locale or "Jan" in
      * the short style. However, no string representation would be
      * available for the {@link #DAY_OF_MONTH} field, and this method
-     * would return <code>null</code>.
+     * would return {@code null}.
      *
      * <p>The default implementation supports the calendar fields for
      * which a {@link DateFormatSymbols} has names in the given
-     * <code>locale</code>.
+     * {@code locale}.
      *
      * @param field
      *        the calendar field for which the string representation
@@ -2309,10 +2309,10 @@
      * externally by calling one of the setter methods rather than by the
      * internal time calculation.
      *
-     * @return <code>true</code> if the field has been set externally,
-     * <code>false</code> otherwise.
+     * @return {@code true} if the field has been set externally,
+     * {@code false} otherwise.
      * @throws    IndexOutOfBoundsException if the specified
-     *                <code>field</code> is out of range
+     *                {@code field} is out of range
      *               (<code>field &lt; 0 || field &gt;= FIELD_COUNT</code>).
      * @see #selectFields()
      * @see #setFieldsComputed(int)
@@ -2345,7 +2345,7 @@
      *
      * @param fieldMask the field to be marked as computed.
      * @throws    IndexOutOfBoundsException if the specified
-     *                <code>field</code> is out of range
+     *                {@code field} is out of range
      *               (<code>field &lt; 0 || field &gt;= FIELD_COUNT</code>).
      * @see #isExternallySet(int)
      * @see #selectFields()
@@ -2374,15 +2374,15 @@
 
     /**
      * Sets the state of the calendar fields that are <em>not</em> specified
-     * by <code>fieldMask</code> to <em>unset</em>. If <code>fieldMask</code>
+     * by {@code fieldMask} to <em>unset</em>. If {@code fieldMask}
      * specifies all the calendar fields, then the state of this
-     * <code>Calendar</code> becomes that all the calendar fields are in sync
+     * {@code Calendar} becomes that all the calendar fields are in sync
      * with the time value (millisecond offset from the Epoch).
      *
      * @param fieldMask the field mask indicating which calendar fields are in
      * sync with the time value.
      * @throws    IndexOutOfBoundsException if the specified
-     *                <code>field</code> is out of range
+     *                {@code field} is out of range
      *               (<code>field &lt; 0 || field &gt;= FIELD_COUNT</code>).
      * @see #isExternallySet(int)
      * @see #selectFields()
@@ -2428,8 +2428,8 @@
     }
 
     /**
-     * Returns whether the specified <code>field</code> is on in the
-     * <code>fieldMask</code>.
+     * Returns whether the specified {@code field} is on in the
+     * {@code fieldMask}.
      */
     static boolean isFieldSet(int fieldMask, int field) {
         return (fieldMask & (1 << field)) != 0;
@@ -2439,16 +2439,16 @@
      * Returns a field mask indicating which calendar field values
      * to be used to calculate the time value. The calendar fields are
      * returned as a bit mask, each bit of which corresponds to a field, i.e.,
-     * the mask value of <code>field</code> is <code>(1 &lt;&lt;
-     * field)</code>. For example, 0x26 represents the <code>YEAR</code>,
-     * <code>MONTH</code>, and <code>DAY_OF_MONTH</code> fields (i.e., 0x26 is
+     * the mask value of {@code field} is <code>(1 &lt;&lt;
+     * field)</code>. For example, 0x26 represents the {@code YEAR},
+     * {@code MONTH}, and {@code DAY_OF_MONTH} fields (i.e., 0x26 is
      * equal to
      * <code>(1&lt;&lt;YEAR)|(1&lt;&lt;MONTH)|(1&lt;&lt;DAY_OF_MONTH))</code>.
      *
      * <p>This method supports the calendar fields resolution as described in
      * the class description. If the bit mask for a given field is on and its
-     * field has not been set (i.e., <code>isSet(field)</code> is
-     * <code>false</code>), then the default value of the field has to be
+     * field has not been set (i.e., {@code isSet(field)} is
+     * {@code false}), then the default value of the field has to be
      * used, which case means that the field has been selected because the
      * selected combination involves the field.
      *
@@ -2693,26 +2693,26 @@
     }
 
     /**
-     * Compares this <code>Calendar</code> to the specified
-     * <code>Object</code>.  The result is <code>true</code> if and only if
-     * the argument is a <code>Calendar</code> object of the same calendar
+     * Compares this {@code Calendar} to the specified
+     * {@code Object}.  The result is {@code true} if and only if
+     * the argument is a {@code Calendar} object of the same calendar
      * system that represents the same time value (millisecond offset from the
      * <a href="#Epoch">Epoch</a>) under the same
-     * <code>Calendar</code> parameters as this object.
+     * {@code Calendar} parameters as this object.
      *
-     * <p>The <code>Calendar</code> parameters are the values represented
-     * by the <code>isLenient</code>, <code>getFirstDayOfWeek</code>,
-     * <code>getMinimalDaysInFirstWeek</code> and <code>getTimeZone</code>
+     * <p>The {@code Calendar} parameters are the values represented
+     * by the {@code isLenient}, {@code getFirstDayOfWeek},
+     * {@code getMinimalDaysInFirstWeek} and {@code getTimeZone}
      * methods. If there is any difference in those parameters
-     * between the two <code>Calendar</code>s, this method returns
-     * <code>false</code>.
+     * between the two {@code Calendar}s, this method returns
+     * {@code false}.
      *
      * <p>Use the {@link #compareTo(Calendar) compareTo} method to
      * compare only the time values.
      *
      * @param obj the object to compare with.
-     * @return <code>true</code> if this object is equal to <code>obj</code>;
-     * <code>false</code> otherwise.
+     * @return {@code true} if this object is equal to {@code obj};
+     * {@code false} otherwise.
      */
     @SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
     @Override
@@ -2753,19 +2753,19 @@
     }
 
     /**
-     * Returns whether this <code>Calendar</code> represents a time
+     * Returns whether this {@code Calendar} represents a time
      * before the time represented by the specified
-     * <code>Object</code>. This method is equivalent to:
+     * {@code Object}. This method is equivalent to:
      * <pre>{@code
      *         compareTo(when) < 0
      * }</pre>
-     * if and only if <code>when</code> is a <code>Calendar</code>
-     * instance. Otherwise, the method returns <code>false</code>.
+     * if and only if {@code when} is a {@code Calendar}
+     * instance. Otherwise, the method returns {@code false}.
      *
-     * @param when the <code>Object</code> to be compared
-     * @return <code>true</code> if the time of this
-     * <code>Calendar</code> is before the time represented by
-     * <code>when</code>; <code>false</code> otherwise.
+     * @param when the {@code Object} to be compared
+     * @return {@code true} if the time of this
+     * {@code Calendar} is before the time represented by
+     * {@code when}; {@code false} otherwise.
      * @see     #compareTo(Calendar)
      */
     public boolean before(Object when) {
@@ -2774,18 +2774,18 @@
     }
 
     /**
-     * Returns whether this <code>Calendar</code> represents a time
+     * Returns whether this {@code Calendar} represents a time
      * after the time represented by the specified
-     * <code>Object</code>. This method is equivalent to:
+     * {@code Object}. This method is equivalent to:
      * <pre>{@code
      *         compareTo(when) > 0
      * }</pre>
-     * if and only if <code>when</code> is a <code>Calendar</code>
-     * instance. Otherwise, the method returns <code>false</code>.
+     * if and only if {@code when} is a {@code Calendar}
+     * instance. Otherwise, the method returns {@code false}.
      *
-     * @param when the <code>Object</code> to be compared
-     * @return <code>true</code> if the time of this <code>Calendar</code> is
-     * after the time represented by <code>when</code>; <code>false</code>
+     * @param when the {@code Object} to be compared
+     * @return {@code true} if the time of this {@code Calendar} is
+     * after the time represented by {@code when}; {@code false}
      * otherwise.
      * @see     #compareTo(Calendar)
      */
@@ -2797,19 +2797,19 @@
     /**
      * Compares the time values (millisecond offsets from the <a
      * href="#Epoch">Epoch</a>) represented by two
-     * <code>Calendar</code> objects.
+     * {@code Calendar} objects.
      *
-     * @param anotherCalendar the <code>Calendar</code> to be compared.
-     * @return the value <code>0</code> if the time represented by the argument
-     * is equal to the time represented by this <code>Calendar</code>; a value
-     * less than <code>0</code> if the time of this <code>Calendar</code> is
+     * @param anotherCalendar the {@code Calendar} to be compared.
+     * @return the value {@code 0} if the time represented by the argument
+     * is equal to the time represented by this {@code Calendar}; a value
+     * less than {@code 0} if the time of this {@code Calendar} is
      * before the time represented by the argument; and a value greater than
-     * <code>0</code> if the time of this <code>Calendar</code> is after the
+     * {@code 0} if the time of this {@code Calendar} is after the
      * time represented by the argument.
-     * @throws    NullPointerException if the specified <code>Calendar</code> is
-     *            <code>null</code>.
+     * @throws    NullPointerException if the specified {@code Calendar} is
+     *            {@code null}.
      * @throws    IllegalArgumentException if the time value of the
-     * specified <code>Calendar</code> object can't be obtained due to
+     * specified {@code Calendar} object can't be obtained due to
      * any invalid calendar values.
      * @since   1.5
      */
@@ -2822,7 +2822,7 @@
      * Adds or subtracts the specified amount of time to the given calendar field,
      * based on the calendar's rules. For example, to subtract 5 days from
      * the current time of the calendar, you can achieve it by calling:
-     * <p><code>add(Calendar.DAY_OF_MONTH, -5)</code>.
+     * <p>{@code add(Calendar.DAY_OF_MONTH, -5)}.
      *
      * @param field the calendar field.
      * @param amount the amount of date or time to be added to the field.
@@ -2838,7 +2838,7 @@
      * <p>roll(Calendar.DATE, true).
      * When rolling on the year or Calendar.YEAR field, it will roll the year
      * value in the range between 1 and the value returned by calling
-     * <code>getMaximum(Calendar.YEAR)</code>.
+     * {@code getMaximum(Calendar.YEAR)}.
      * When rolling on the month or Calendar.MONTH field, other fields like
      * date might conflict and, need to be changed. For instance,
      * rolling the month on the date 01/31/96 will result in 02/29/96.
@@ -2858,15 +2858,15 @@
      * without changing larger fields.  A negative amount means to roll
      * down.
      *
-     * <p>NOTE:  This default implementation on <code>Calendar</code> just repeatedly calls the
+     * <p>NOTE:  This default implementation on {@code Calendar} just repeatedly calls the
      * version of {@link #roll(int,boolean) roll()} that rolls by one unit.  This may not
-     * always do the right thing.  For example, if the <code>DAY_OF_MONTH</code> field is 31,
-     * rolling through February will leave it set to 28.  The <code>GregorianCalendar</code>
+     * always do the right thing.  For example, if the {@code DAY_OF_MONTH} field is 31,
+     * rolling through February will leave it set to 28.  The {@code GregorianCalendar}
      * version of this function takes care of this problem.  Other subclasses
      * should also provide overrides of this function that do the right thing.
      *
      * @param field the calendar field.
-     * @param amount the signed amount to add to the calendar <code>field</code>.
+     * @param amount the signed amount to add to the calendar {@code field}.
      * @since 1.2
      * @see #roll(int,boolean)
      * @see #add(int,int)
@@ -2929,7 +2929,7 @@
     }
 
     /**
-     * Sets the sharedZone flag to <code>shared</code>.
+     * Sets the sharedZone flag to {@code shared}.
      */
     void setZoneShared(boolean shared) {
         sharedZone = shared;
@@ -2942,8 +2942,8 @@
      * With strict (non-lenient) interpretation, such dates will cause an exception to be
      * thrown. The default is lenient.
      *
-     * @param lenient <code>true</code> if the lenient mode is to be turned
-     * on; <code>false</code> if it is to be turned off.
+     * @param lenient {@code true} if the lenient mode is to be turned
+     * on; {@code false} if it is to be turned off.
      * @see #isLenient()
      * @see java.text.DateFormat#setLenient
      */
@@ -2955,8 +2955,8 @@
     /**
      * Tells whether date/time interpretation is to be lenient.
      *
-     * @return <code>true</code> if the interpretation mode of this calendar is lenient;
-     * <code>false</code> otherwise.
+     * @return {@code true} if the interpretation mode of this calendar is lenient;
+     * {@code false} otherwise.
      * @see #setLenient(boolean)
      */
     public boolean isLenient()
@@ -2965,8 +2965,8 @@
     }
 
     /**
-     * Sets what the first day of the week is; e.g., <code>SUNDAY</code> in the U.S.,
-     * <code>MONDAY</code> in France.
+     * Sets what the first day of the week is; e.g., {@code SUNDAY} in the U.S.,
+     * {@code MONDAY} in France.
      *
      * @param value the given first day of the week.
      * @see #getFirstDayOfWeek()
@@ -2982,8 +2982,8 @@
     }
 
     /**
-     * Gets what the first day of the week is; e.g., <code>SUNDAY</code> in the U.S.,
-     * <code>MONDAY</code> in France.
+     * Gets what the first day of the week is; e.g., {@code SUNDAY} in the U.S.,
+     * {@code MONDAY} in France.
      *
      * @return the first day of the week.
      * @see #setFirstDayOfWeek(int)
@@ -3125,7 +3125,7 @@
 
     /**
      * Returns the minimum value for the given calendar field of this
-     * <code>Calendar</code> instance. The minimum value is defined as
+     * {@code Calendar} instance. The minimum value is defined as
      * the smallest value returned by the {@link #get(int) get} method
      * for any possible time value.  The minimum value depends on
      * calendar system specific parameters of the instance.
@@ -3142,7 +3142,7 @@
 
     /**
      * Returns the maximum value for the given calendar field of this
-     * <code>Calendar</code> instance. The maximum value is defined as
+     * {@code Calendar} instance. The maximum value is defined as
      * the largest value returned by the {@link #get(int) get} method
      * for any possible time value. The maximum value depends on
      * calendar system specific parameters of the instance.
@@ -3159,7 +3159,7 @@
 
     /**
      * Returns the highest minimum value for the given calendar field
-     * of this <code>Calendar</code> instance. The highest minimum
+     * of this {@code Calendar} instance. The highest minimum
      * value is defined as the largest value returned by {@link
      * #getActualMinimum(int)} for any possible time value. The
      * greatest minimum value depends on calendar system specific
@@ -3177,13 +3177,13 @@
 
     /**
      * Returns the lowest maximum value for the given calendar field
-     * of this <code>Calendar</code> instance. The lowest maximum
+     * of this {@code Calendar} instance. The lowest maximum
      * value is defined as the smallest value returned by {@link
      * #getActualMaximum(int)} for any possible time value. The least
      * maximum value depends on calendar system specific parameters of
-     * the instance. For example, a <code>Calendar</code> for the
+     * the instance. For example, a {@code Calendar} for the
      * Gregorian calendar system returns 28 for the
-     * <code>DAY_OF_MONTH</code> field, because the 28th is the last
+     * {@code DAY_OF_MONTH} field, because the 28th is the last
      * day of the shortest month of this calendar, February in a
      * common year.
      *
@@ -3199,17 +3199,17 @@
 
     /**
      * Returns the minimum value that the specified calendar field
-     * could have, given the time value of this <code>Calendar</code>.
+     * could have, given the time value of this {@code Calendar}.
      *
      * <p>The default implementation of this method uses an iterative
      * algorithm to determine the actual minimum value for the
      * calendar field. Subclasses should, if possible, override this
      * with a more efficient implementation - in many cases, they can
-     * simply return <code>getMinimum()</code>.
+     * simply return {@code getMinimum()}.
      *
      * @param field the calendar field
      * @return the minimum of the given calendar field for the time
-     * value of this <code>Calendar</code>
+     * value of this {@code Calendar}
      * @see #getMinimum(int)
      * @see #getMaximum(int)
      * @see #getGreatestMinimum(int)
@@ -3252,8 +3252,8 @@
     /**
      * Returns the maximum value that the specified calendar field
      * could have, given the time value of this
-     * <code>Calendar</code>. For example, the actual maximum value of
-     * the <code>MONTH</code> field is 12 in some years, and 13 in
+     * {@code Calendar}. For example, the actual maximum value of
+     * the {@code MONTH} field is 12 in some years, and 13 in
      * other years in the Hebrew calendar system.
      *
      * <p>The default implementation of this method uses an iterative
@@ -3263,7 +3263,7 @@
      *
      * @param field the calendar field
      * @return the maximum of the given calendar field for the time
-     * value of this <code>Calendar</code>
+     * value of this {@code Calendar}
      * @see #getMinimum(int)
      * @see #getMaximum(int)
      * @see #getGreatestMinimum(int)
@@ -3351,7 +3351,7 @@
      *
      * @param field the calendar field
      * @return the calendar field name
-     * @throws    IndexOutOfBoundsException if <code>field</code> is negative,
+     * @throws    IndexOutOfBoundsException if {@code field} is negative,
      * equal to or greater than {@code FIELD_COUNT}.
      */
     static String getFieldName(int field) {
@@ -3362,7 +3362,7 @@
      * Return a string representation of this calendar. This method
      * is intended to be used only for debugging purposes, and the
      * format of the returned string may vary between implementations.
-     * The returned string may be empty but may not be <code>null</code>.
+     * The returned string may be empty but may not be {@code null}.
      *
      * @return  a string representation of this calendar.
      */
@@ -3517,13 +3517,13 @@
     /**
      * Save the state of this object to a stream (i.e., serialize it).
      *
-     * Ideally, <code>Calendar</code> would only write out its state data and
+     * Ideally, {@code Calendar} would only write out its state data and
      * the current time, and not write any field data out, such as
-     * <code>fields[]</code>, <code>isTimeSet</code>, <code>areFieldsSet</code>,
-     * and <code>isSet[]</code>.  <code>nextStamp</code> also should not be part
+     * {@code fields[]}, {@code isTimeSet}, {@code areFieldsSet},
+     * and {@code isSet[]}.  {@code nextStamp} also should not be part
      * of the persistent state. Unfortunately, this didn't happen before JDK 1.1
      * shipped. To be compatible with JDK 1.1, we will always have to write out
-     * the field values and state flags.  However, <code>nextStamp</code> can be
+     * the field values and state flags.  However, {@code nextStamp} can be
      * removed from the serialization stream; this will probably happen in the
      * near future.
      */
--- a/src/java.base/share/classes/java/util/ConcurrentModificationException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/ConcurrentModificationException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -107,7 +107,7 @@
      * Constructs a new exception with the specified detail message and
      * cause.
      *
-     * <p>Note that the detail message associated with <code>cause</code> is
+     * <p>Note that the detail message associated with {@code cause} is
      * <i>not</i> automatically incorporated in this exception's detail
      * message.
      *
--- a/src/java.base/share/classes/java/util/Currency.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/Currency.java	Wed Sep 25 22:40:41 2019 +0200
@@ -55,9 +55,9 @@
  * ISO web site</a> for more information.
  * <p>
  * The class is designed so that there's never more than one
- * <code>Currency</code> instance for any given currency. Therefore, there's
- * no public constructor. You obtain a <code>Currency</code> instance using
- * the <code>getInstance</code> methods.
+ * {@code Currency} instance for any given currency. Therefore, there's
+ * no public constructor. You obtain a {@code Currency} instance using
+ * the {@code getInstance} methods.
  * <p>
  * Users can supersede the Java runtime currency data by means of the system
  * property {@systemProperty java.util.currency.data}. If this system property is
@@ -274,7 +274,7 @@
 
 
     /**
-     * Constructs a <code>Currency</code> instance. The constructor is private
+     * Constructs a {@code Currency} instance. The constructor is private
      * so that we can insure that there's never more than one instance for a
      * given currency.
      */
@@ -285,12 +285,12 @@
     }
 
     /**
-     * Returns the <code>Currency</code> instance for the given currency code.
+     * Returns the {@code Currency} instance for the given currency code.
      *
      * @param currencyCode the ISO 4217 code of the currency
-     * @return the <code>Currency</code> instance for the given currency code
-     * @throws    NullPointerException if <code>currencyCode</code> is null
-     * @throws    IllegalArgumentException if <code>currencyCode</code> is not
+     * @return the {@code Currency} instance for the given currency code
+     * @throws    NullPointerException if {@code currencyCode} is null
+     * @throws    IllegalArgumentException if {@code currencyCode} is not
      * a supported ISO 4217 code.
      */
     public static Currency getInstance(String currencyCode) {
@@ -350,7 +350,7 @@
     }
 
     /**
-     * Returns the <code>Currency</code> instance for the country of the
+     * Returns the {@code Currency} instance for the country of the
      * given locale. The language and variant components of the locale
      * are ignored. The result may vary over time, as countries change their
      * currencies. For example, for the original member countries of the
@@ -365,14 +365,14 @@
      * specified, the currency from the "cu" extension supersedes the implicit one
      * from the "rg" extension.
      * <p>
-     * The method returns <code>null</code> for territories that don't
+     * The method returns {@code null} for territories that don't
      * have a currency, such as Antarctica.
      *
-     * @param locale the locale for whose country a <code>Currency</code>
+     * @param locale the locale for whose country a {@code Currency}
      * instance is needed
-     * @return the <code>Currency</code> instance for the country of the given
+     * @return the {@code Currency} instance for the country of the given
      * locale, or {@code null}
-     * @throws    NullPointerException if <code>locale</code>
+     * @throws    NullPointerException if {@code locale}
      * is {@code null}
      * @throws    IllegalArgumentException if the country of the given {@code locale}
      * is not a supported ISO 3166 country code.
@@ -537,7 +537,7 @@
      * @param locale the locale for which a display name for this currency is
      * needed
      * @return the symbol of this currency for the specified locale
-     * @throws    NullPointerException if <code>locale</code> is null
+     * @throws    NullPointerException if {@code locale} is null
      */
     public String getSymbol(Locale locale) {
         LocaleServiceProviderPool pool =
@@ -632,7 +632,7 @@
      * @param locale the locale for which a display name for this currency is
      * needed
      * @return the display name of this currency for the specified locale
-     * @throws    NullPointerException if <code>locale</code> is null
+     * @throws    NullPointerException if {@code locale} is null
      * @since 1.7
      */
     public String getDisplayName(Locale locale) {
--- a/src/java.base/share/classes/java/util/GregorianCalendar.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/GregorianCalendar.java	Wed Sep 25 22:40:41 2019 +0200
@@ -53,11 +53,11 @@
 import sun.util.calendar.ZoneInfo;
 
 /**
- * <code>GregorianCalendar</code> is a concrete subclass of
- * <code>Calendar</code> and provides the standard calendar system
+ * {@code GregorianCalendar} is a concrete subclass of
+ * {@code Calendar} and provides the standard calendar system
  * used by most of the world.
  *
- * <p> <code>GregorianCalendar</code> is a hybrid calendar that
+ * <p> {@code GregorianCalendar} is a hybrid calendar that
  * supports both the Julian and Gregorian calendar systems with the
  * support of a single discontinuity, which corresponds by default to
  * the Gregorian date when the Gregorian calendar was instituted
@@ -68,19 +68,19 @@
  * <p>
  * Historically, in those countries which adopted the Gregorian calendar first,
  * October 4, 1582 (Julian) was thus followed by October 15, 1582 (Gregorian). This calendar models
- * this correctly.  Before the Gregorian cutover, <code>GregorianCalendar</code>
+ * this correctly.  Before the Gregorian cutover, {@code GregorianCalendar}
  * implements the Julian calendar.  The only difference between the Gregorian
  * and the Julian calendar is the leap year rule. The Julian calendar specifies
  * leap years every four years, whereas the Gregorian calendar omits century
  * years which are not divisible by 400.
  *
  * <p>
- * <code>GregorianCalendar</code> implements <em>proleptic</em> Gregorian and
+ * {@code GregorianCalendar} implements <em>proleptic</em> Gregorian and
  * Julian calendars. That is, dates are computed by extrapolating the current
  * rules indefinitely far backward and forward in time. As a result,
- * <code>GregorianCalendar</code> may be used for all years to generate
+ * {@code GregorianCalendar} may be used for all years to generate
  * meaningful and consistent results. However, dates obtained using
- * <code>GregorianCalendar</code> are historically accurate only from March 1, 4
+ * {@code GregorianCalendar} are historically accurate only from March 1, 4
  * AD onward, when modern Julian calendar rules were adopted.  Before this date,
  * leap year rules were applied irregularly, and before 45 BC the Julian
  * calendar did not even exist.
@@ -135,28 +135,28 @@
  *
  * <h3>Week Of Month</h3>
  *
- * <p>Values calculated for the <code>WEEK_OF_MONTH</code> field range from 0
+ * <p>Values calculated for the {@code WEEK_OF_MONTH} field range from 0
  * to 6.  Week 1 of a month (the days with <code>WEEK_OF_MONTH =
  * 1</code>) is the earliest set of at least
- * <code>getMinimalDaysInFirstWeek()</code> contiguous days in that month,
- * ending on the day before <code>getFirstDayOfWeek()</code>.  Unlike
+ * {@code getMinimalDaysInFirstWeek()} contiguous days in that month,
+ * ending on the day before {@code getFirstDayOfWeek()}.  Unlike
  * week 1 of a year, week 1 of a month may be shorter than 7 days, need
- * not start on <code>getFirstDayOfWeek()</code>, and will not include days of
+ * not start on {@code getFirstDayOfWeek()}, and will not include days of
  * the previous month.  Days of a month before week 1 have a
- * <code>WEEK_OF_MONTH</code> of 0.
+ * {@code WEEK_OF_MONTH} of 0.
  *
- * <p>For example, if <code>getFirstDayOfWeek()</code> is <code>SUNDAY</code>
- * and <code>getMinimalDaysInFirstWeek()</code> is 4, then the first week of
+ * <p>For example, if {@code getFirstDayOfWeek()} is {@code SUNDAY}
+ * and {@code getMinimalDaysInFirstWeek()} is 4, then the first week of
  * January 1998 is Sunday, January 4 through Saturday, January 10.  These days
- * have a <code>WEEK_OF_MONTH</code> of 1.  Thursday, January 1 through
- * Saturday, January 3 have a <code>WEEK_OF_MONTH</code> of 0.  If
- * <code>getMinimalDaysInFirstWeek()</code> is changed to 3, then January 1
- * through January 3 have a <code>WEEK_OF_MONTH</code> of 1.
+ * have a {@code WEEK_OF_MONTH} of 1.  Thursday, January 1 through
+ * Saturday, January 3 have a {@code WEEK_OF_MONTH} of 0.  If
+ * {@code getMinimalDaysInFirstWeek()} is changed to 3, then January 1
+ * through January 3 have a {@code WEEK_OF_MONTH} of 1.
  *
  * <h3>Default Fields Values</h3>
  *
- * <p>The <code>clear</code> method sets calendar field(s)
- * undefined. <code>GregorianCalendar</code> uses the following
+ * <p>The {@code clear} method sets calendar field(s)
+ * undefined. {@code GregorianCalendar} uses the following
  * default value for each calendar field if its value is undefined.
  *
  * <table class="striped" style="text-align: left; width: 66%;">
@@ -174,74 +174,74 @@
  *   <tbody>
  *     <tr>
  *       <th scope="row">
- *              <code>ERA</code>
+ *              {@code ERA}
  *       </th>
  *       <td>
- *              <code>AD</code>
+ *              {@code AD}
  *       </td>
  *     </tr>
  *     <tr>
  *       <th scope="row">
- *              <code>YEAR</code>
+ *              {@code YEAR}
  *       </th>
  *       <td>
- *              <code>1970</code>
+ *              {@code 1970}
  *       </td>
  *     </tr>
  *     <tr>
  *       <th scope="row">
- *              <code>MONTH</code>
+ *              {@code MONTH}
  *       </th>
  *       <td>
- *              <code>JANUARY</code>
+ *              {@code JANUARY}
  *       </td>
  *     </tr>
  *     <tr>
  *       <th scope="row">
- *              <code>DAY_OF_MONTH</code>
+ *              {@code DAY_OF_MONTH}
  *       </th>
  *       <td>
- *              <code>1</code>
+ *              {@code 1}
  *       </td>
  *     </tr>
  *     <tr>
  *       <th scope="row">
- *              <code>DAY_OF_WEEK</code>
+ *              {@code DAY_OF_WEEK}
  *       </th>
  *       <td>
- *              <code>the first day of week</code>
+ *              {@code the first day of week}
  *       </td>
  *     </tr>
  *     <tr>
  *       <th scope="row">
- *              <code>WEEK_OF_MONTH</code>
+ *              {@code WEEK_OF_MONTH}
  *       </th>
  *       <td>
- *              <code>0</code>
+ *              {@code 0}
  *       </td>
  *     </tr>
  *     <tr>
  *       <th scope="row">
- *              <code>DAY_OF_WEEK_IN_MONTH</code>
+ *              {@code DAY_OF_WEEK_IN_MONTH}
  *       </th>
  *       <td>
- *              <code>1</code>
+ *              {@code 1}
  *       </td>
  *     </tr>
  *     <tr>
  *       <th scope="row">
- *              <code>AM_PM</code>
+ *              {@code AM_PM}
  *       </th>
  *       <td>
- *              <code>AM</code>
+ *              {@code AM}
  *       </td>
  *     </tr>
  *     <tr>
  *       <th scope="row">
- *              <code>HOUR, HOUR_OF_DAY, MINUTE, SECOND, MILLISECOND</code>
+ *              {@code HOUR, HOUR_OF_DAY, MINUTE, SECOND, MILLISECOND}
  *       </th>
  *       <td>
- *              <code>0</code>
+ *              {@code 0}
  *       </td>
  *     </tr>
  *   </tbody>
@@ -360,9 +360,9 @@
 //////////////////
 
     /**
-     * Value of the <code>ERA</code> field indicating
+     * Value of the {@code ERA} field indicating
      * the period before the common era (before Christ), also known as BCE.
-     * The sequence of years at the transition from <code>BC</code> to <code>AD</code> is
+     * The sequence of years at the transition from {@code BC} to {@code AD} is
      * ..., 2 BC, 1 BC, 1 AD, 2 AD,...
      *
      * @see #ERA
@@ -378,9 +378,9 @@
     static final int BCE = 0;
 
     /**
-     * Value of the <code>ERA</code> field indicating
+     * Value of the {@code ERA} field indicating
      * the common era (Anno Domini), also known as CE.
-     * The sequence of years at the transition from <code>BC</code> to <code>AD</code> is
+     * The sequence of years at the transition from {@code BC} to {@code AD} is
      * ..., 2 BC, 1 BC, 1 AD, 2 AD,...
      *
      * @see #ERA
@@ -585,7 +585,7 @@
 ///////////////
 
     /**
-     * Constructs a default <code>GregorianCalendar</code> using the current time
+     * Constructs a default {@code GregorianCalendar} using the current time
      * in the default time zone with the default
      * {@link Locale.Category#FORMAT FORMAT} locale.
      */
@@ -595,7 +595,7 @@
     }
 
     /**
-     * Constructs a <code>GregorianCalendar</code> based on the current time
+     * Constructs a {@code GregorianCalendar} based on the current time
      * in the given time zone with the default
      * {@link Locale.Category#FORMAT FORMAT} locale.
      *
@@ -606,7 +606,7 @@
     }
 
     /**
-     * Constructs a <code>GregorianCalendar</code> based on the current time
+     * Constructs a {@code GregorianCalendar} based on the current time
      * in the default time zone with the given locale.
      *
      * @param aLocale the given locale.
@@ -617,7 +617,7 @@
     }
 
     /**
-     * Constructs a <code>GregorianCalendar</code> based on the current time
+     * Constructs a {@code GregorianCalendar} based on the current time
      * in the given time zone with the given locale.
      *
      * @param zone the given time zone.
@@ -630,29 +630,29 @@
     }
 
     /**
-     * Constructs a <code>GregorianCalendar</code> with the given date set
+     * Constructs a {@code GregorianCalendar} with the given date set
      * in the default time zone with the default locale.
      *
-     * @param year the value used to set the <code>YEAR</code> calendar field in the calendar.
-     * @param month the value used to set the <code>MONTH</code> calendar field in the calendar.
+     * @param year the value used to set the {@code YEAR} calendar field in the calendar.
+     * @param month the value used to set the {@code MONTH} calendar field in the calendar.
      * Month value is 0-based. e.g., 0 for January.
-     * @param dayOfMonth the value used to set the <code>DAY_OF_MONTH</code> calendar field in the calendar.
+     * @param dayOfMonth the value used to set the {@code DAY_OF_MONTH} calendar field in the calendar.
      */
     public GregorianCalendar(int year, int month, int dayOfMonth) {
         this(year, month, dayOfMonth, 0, 0, 0, 0);
     }
 
     /**
-     * Constructs a <code>GregorianCalendar</code> with the given date
+     * Constructs a {@code GregorianCalendar} with the given date
      * and time set for the default time zone with the default locale.
      *
-     * @param year the value used to set the <code>YEAR</code> calendar field in the calendar.
-     * @param month the value used to set the <code>MONTH</code> calendar field in the calendar.
+     * @param year the value used to set the {@code YEAR} calendar field in the calendar.
+     * @param month the value used to set the {@code MONTH} calendar field in the calendar.
      * Month value is 0-based. e.g., 0 for January.
-     * @param dayOfMonth the value used to set the <code>DAY_OF_MONTH</code> calendar field in the calendar.
-     * @param hourOfDay the value used to set the <code>HOUR_OF_DAY</code> calendar field
+     * @param dayOfMonth the value used to set the {@code DAY_OF_MONTH} calendar field in the calendar.
+     * @param hourOfDay the value used to set the {@code HOUR_OF_DAY} calendar field
      * in the calendar.
-     * @param minute the value used to set the <code>MINUTE</code> calendar field
+     * @param minute the value used to set the {@code MINUTE} calendar field
      * in the calendar.
      */
     public GregorianCalendar(int year, int month, int dayOfMonth, int hourOfDay,
@@ -664,15 +664,15 @@
      * Constructs a GregorianCalendar with the given date
      * and time set for the default time zone with the default locale.
      *
-     * @param year the value used to set the <code>YEAR</code> calendar field in the calendar.
-     * @param month the value used to set the <code>MONTH</code> calendar field in the calendar.
+     * @param year the value used to set the {@code YEAR} calendar field in the calendar.
+     * @param month the value used to set the {@code MONTH} calendar field in the calendar.
      * Month value is 0-based. e.g., 0 for January.
-     * @param dayOfMonth the value used to set the <code>DAY_OF_MONTH</code> calendar field in the calendar.
-     * @param hourOfDay the value used to set the <code>HOUR_OF_DAY</code> calendar field
+     * @param dayOfMonth the value used to set the {@code DAY_OF_MONTH} calendar field in the calendar.
+     * @param hourOfDay the value used to set the {@code HOUR_OF_DAY} calendar field
      * in the calendar.
-     * @param minute the value used to set the <code>MINUTE</code> calendar field
+     * @param minute the value used to set the {@code MINUTE} calendar field
      * in the calendar.
-     * @param second the value used to set the <code>SECOND</code> calendar field
+     * @param second the value used to set the {@code SECOND} calendar field
      * in the calendar.
      */
     public GregorianCalendar(int year, int month, int dayOfMonth, int hourOfDay,
@@ -681,20 +681,20 @@
     }
 
     /**
-     * Constructs a <code>GregorianCalendar</code> with the given date
+     * Constructs a {@code GregorianCalendar} with the given date
      * and time set for the default time zone with the default locale.
      *
-     * @param year the value used to set the <code>YEAR</code> calendar field in the calendar.
-     * @param month the value used to set the <code>MONTH</code> calendar field in the calendar.
+     * @param year the value used to set the {@code YEAR} calendar field in the calendar.
+     * @param month the value used to set the {@code MONTH} calendar field in the calendar.
      * Month value is 0-based. e.g., 0 for January.
-     * @param dayOfMonth the value used to set the <code>DAY_OF_MONTH</code> calendar field in the calendar.
-     * @param hourOfDay the value used to set the <code>HOUR_OF_DAY</code> calendar field
+     * @param dayOfMonth the value used to set the {@code DAY_OF_MONTH} calendar field in the calendar.
+     * @param hourOfDay the value used to set the {@code HOUR_OF_DAY} calendar field
      * in the calendar.
-     * @param minute the value used to set the <code>MINUTE</code> calendar field
+     * @param minute the value used to set the {@code MINUTE} calendar field
      * in the calendar.
-     * @param second the value used to set the <code>SECOND</code> calendar field
+     * @param second the value used to set the {@code SECOND} calendar field
      * in the calendar.
-     * @param millis the value used to set the <code>MILLISECOND</code> calendar field
+     * @param millis the value used to set the {@code MILLISECOND} calendar field
      */
     GregorianCalendar(int year, int month, int dayOfMonth,
                       int hourOfDay, int minute, int second, int millis) {
@@ -745,13 +745,13 @@
 /////////////////
 
     /**
-     * Sets the <code>GregorianCalendar</code> change date. This is the point when the switch
+     * Sets the {@code GregorianCalendar} change date. This is the point when the switch
      * from Julian dates to Gregorian dates occurred. Default is October 15,
      * 1582 (Gregorian). Previous to this, dates will be in the Julian calendar.
      * <p>
      * To obtain a pure Julian calendar, set the change date to
-     * <code>Date(Long.MAX_VALUE)</code>.  To obtain a pure Gregorian calendar,
-     * set the change date to <code>Date(Long.MIN_VALUE)</code>.
+     * {@code Date(Long.MAX_VALUE)}.  To obtain a pure Gregorian calendar,
+     * set the change date to {@code Date(Long.MIN_VALUE)}.
      *
      * @param date the given Gregorian cutover date.
      */
@@ -803,20 +803,20 @@
      * October 15, 1582 (Gregorian). Previous to this, dates will be in the Julian
      * calendar.
      *
-     * @return the Gregorian cutover date for this <code>GregorianCalendar</code> object.
+     * @return the Gregorian cutover date for this {@code GregorianCalendar} object.
      */
     public final Date getGregorianChange() {
         return new Date(gregorianCutover);
     }
 
     /**
-     * Determines if the given year is a leap year. Returns <code>true</code> if
+     * Determines if the given year is a leap year. Returns {@code true} if
      * the given year is a leap year. To specify BC year numbers,
-     * <code>1 - year number</code> must be given. For example, year BC 4 is
+     * {@code 1 - year number} must be given. For example, year BC 4 is
      * specified as -3.
      *
      * @param year the given year.
-     * @return <code>true</code> if the given year is a leap year; <code>false</code> otherwise.
+     * @return {@code true} if the given year is a leap year; {@code false} otherwise.
      */
     public boolean isLeapYear(int year) {
         if ((year & 3) != 0) {
@@ -853,17 +853,17 @@
     }
 
     /**
-     * Compares this <code>GregorianCalendar</code> to the specified
-     * <code>Object</code>. The result is <code>true</code> if and
-     * only if the argument is a <code>GregorianCalendar</code> object
+     * Compares this {@code GregorianCalendar} to the specified
+     * {@code Object}. The result is {@code true} if and
+     * only if the argument is a {@code GregorianCalendar} object
      * that represents the same time value (millisecond offset from
      * the <a href="Calendar.html#Epoch">Epoch</a>) under the same
-     * <code>Calendar</code> parameters and Gregorian change date as
+     * {@code Calendar} parameters and Gregorian change date as
      * this object.
      *
      * @param obj the object to compare with.
-     * @return <code>true</code> if this object is equal to <code>obj</code>;
-     * <code>false</code> otherwise.
+     * @return {@code true} if this object is equal to {@code obj};
+     * {@code false} otherwise.
      * @see Calendar#compareTo(Calendar)
      */
     @Override
@@ -874,7 +874,7 @@
     }
 
     /**
-     * Generates the hash code for this <code>GregorianCalendar</code> object.
+     * Generates the hash code for this {@code GregorianCalendar} object.
      */
     @Override
     public int hashCode() {
@@ -885,27 +885,27 @@
      * Adds the specified (signed) amount of time to the given calendar field,
      * based on the calendar's rules.
      *
-     * <p><em>Add rule 1</em>. The value of <code>field</code>
-     * after the call minus the value of <code>field</code> before the
-     * call is <code>amount</code>, modulo any overflow that has occurred in
-     * <code>field</code>. Overflow occurs when a field value exceeds its
+     * <p><em>Add rule 1</em>. The value of {@code field}
+     * after the call minus the value of {@code field} before the
+     * call is {@code amount}, modulo any overflow that has occurred in
+     * {@code field}. Overflow occurs when a field value exceeds its
      * range and, as a result, the next larger field is incremented or
      * decremented and the field value is adjusted back into its range.</p>
      *
      * <p><em>Add rule 2</em>. If a smaller field is expected to be
      * invariant, but it is impossible for it to be equal to its
      * prior value because of changes in its minimum or maximum after
-     * <code>field</code> is changed, then its value is adjusted to be as close
+     * {@code field} is changed, then its value is adjusted to be as close
      * as possible to its expected value. A smaller field represents a
-     * smaller unit of time. <code>HOUR</code> is a smaller field than
-     * <code>DAY_OF_MONTH</code>. No adjustment is made to smaller fields
+     * smaller unit of time. {@code HOUR} is a smaller field than
+     * {@code DAY_OF_MONTH}. No adjustment is made to smaller fields
      * that are not expected to be invariant. The calendar system
      * determines what fields are expected to be invariant.</p>
      *
      * @param field the calendar field.
      * @param amount the amount of date or time to be added to the field.
-     * @throws    IllegalArgumentException if <code>field</code> is
-     * <code>ZONE_OFFSET</code>, <code>DST_OFFSET</code>, or unknown,
+     * @throws    IllegalArgumentException if {@code field} is
+     * {@code ZONE_OFFSET}, {@code DST_OFFSET}, or unknown,
      * or if any calendar fields have out-of-range values in
      * non-lenient mode.
      */
@@ -1094,15 +1094,15 @@
      * Adds or subtracts (up/down) a single unit of time on the given time
      * field without changing larger fields.
      * <p>
-     * <em>Example</em>: Consider a <code>GregorianCalendar</code>
+     * <em>Example</em>: Consider a {@code GregorianCalendar}
      * originally set to December 31, 1999. Calling {@link #roll(int,boolean) roll(Calendar.MONTH, true)}
-     * sets the calendar to January 31, 1999.  The <code>YEAR</code> field is unchanged
-     * because it is a larger field than <code>MONTH</code>.</p>
+     * sets the calendar to January 31, 1999.  The {@code YEAR} field is unchanged
+     * because it is a larger field than {@code MONTH}.</p>
      *
      * @param up indicates if the value of the specified calendar field is to be
-     * rolled up or rolled down. Use <code>true</code> if rolling up, <code>false</code> otherwise.
-     * @throws    IllegalArgumentException if <code>field</code> is
-     * <code>ZONE_OFFSET</code>, <code>DST_OFFSET</code>, or unknown,
+     * rolled up or rolled down. Use {@code true} if rolling up, {@code false} otherwise.
+     * @throws    IllegalArgumentException if {@code field} is
+     * {@code ZONE_OFFSET}, {@code DST_OFFSET}, or unknown,
      * or if any calendar fields have out-of-range values in
      * non-lenient mode.
      * @see #add(int,int)
@@ -1121,35 +1121,35 @@
      * <p>This method calls {@link #complete()} before adding the
      * amount so that all the calendar fields are normalized. If there
      * is any calendar field having an out-of-range value in non-lenient mode, then an
-     * <code>IllegalArgumentException</code> is thrown.
+     * {@code IllegalArgumentException} is thrown.
      *
      * <p>
-     * <em>Example</em>: Consider a <code>GregorianCalendar</code>
+     * <em>Example</em>: Consider a {@code GregorianCalendar}
      * originally set to August 31, 1999. Calling <code>roll(Calendar.MONTH,
      * 8)</code> sets the calendar to April 30, <strong>1999</strong>. Using a
-     * <code>GregorianCalendar</code>, the <code>DAY_OF_MONTH</code> field cannot
-     * be 31 in the month April. <code>DAY_OF_MONTH</code> is set to the closest possible
-     * value, 30. The <code>YEAR</code> field maintains the value of 1999 because it
-     * is a larger field than <code>MONTH</code>.
+     * {@code GregorianCalendar}, the {@code DAY_OF_MONTH} field cannot
+     * be 31 in the month April. {@code DAY_OF_MONTH} is set to the closest possible
+     * value, 30. The {@code YEAR} field maintains the value of 1999 because it
+     * is a larger field than {@code MONTH}.
      * <p>
-     * <em>Example</em>: Consider a <code>GregorianCalendar</code>
+     * <em>Example</em>: Consider a {@code GregorianCalendar}
      * originally set to Sunday June 6, 1999. Calling
-     * <code>roll(Calendar.WEEK_OF_MONTH, -1)</code> sets the calendar to
+     * {@code roll(Calendar.WEEK_OF_MONTH, -1)} sets the calendar to
      * Tuesday June 1, 1999, whereas calling
-     * <code>add(Calendar.WEEK_OF_MONTH, -1)</code> sets the calendar to
+     * {@code add(Calendar.WEEK_OF_MONTH, -1)} sets the calendar to
      * Sunday May 30, 1999. This is because the roll rule imposes an
-     * additional constraint: The <code>MONTH</code> must not change when the
-     * <code>WEEK_OF_MONTH</code> is rolled. Taken together with add rule 1,
+     * additional constraint: The {@code MONTH} must not change when the
+     * {@code WEEK_OF_MONTH} is rolled. Taken together with add rule 1,
      * the resultant date must be between Tuesday June 1 and Saturday June
-     * 5. According to add rule 2, the <code>DAY_OF_WEEK</code>, an invariant
-     * when changing the <code>WEEK_OF_MONTH</code>, is set to Tuesday, the
+     * 5. According to add rule 2, the {@code DAY_OF_WEEK}, an invariant
+     * when changing the {@code WEEK_OF_MONTH}, is set to Tuesday, the
      * closest possible value to Sunday (where Sunday is the first day of the
      * week).</p>
      *
      * @param field the calendar field.
-     * @param amount the signed amount to add to <code>field</code>.
-     * @throws    IllegalArgumentException if <code>field</code> is
-     * <code>ZONE_OFFSET</code>, <code>DST_OFFSET</code>, or unknown,
+     * @param amount the signed amount to add to {@code field}.
+     * @throws    IllegalArgumentException if {@code field} is
+     * {@code ZONE_OFFSET}, {@code DST_OFFSET}, or unknown,
      * or if any calendar fields have out-of-range values in
      * non-lenient mode.
      * @see #roll(int,boolean)
@@ -1512,7 +1512,7 @@
 
     /**
      * Returns the minimum value for the given calendar field of this
-     * <code>GregorianCalendar</code> instance. The minimum value is
+     * {@code GregorianCalendar} instance. The minimum value is
      * defined as the smallest value returned by the {@link
      * Calendar#get(int) get} method for any possible time value,
      * taking into consideration the current values of the
@@ -1536,7 +1536,7 @@
 
     /**
      * Returns the maximum value for the given calendar field of this
-     * <code>GregorianCalendar</code> instance. The maximum value is
+     * {@code GregorianCalendar} instance. The maximum value is
      * defined as the largest value returned by the {@link
      * Calendar#get(int) get} method for any possible time value,
      * taking into consideration the current values of the
@@ -1585,7 +1585,7 @@
 
     /**
      * Returns the highest minimum value for the given calendar field
-     * of this <code>GregorianCalendar</code> instance. The highest
+     * of this {@code GregorianCalendar} instance. The highest
      * minimum value is defined as the largest value returned by
      * {@link #getActualMinimum(int)} for any possible time value,
      * taking into consideration the current values of the
@@ -1615,7 +1615,7 @@
 
     /**
      * Returns the lowest maximum value for the given calendar field
-     * of this <code>GregorianCalendar</code> instance. The lowest
+     * of this {@code GregorianCalendar} instance. The lowest
      * maximum value is defined as the smallest value returned by
      * {@link #getActualMaximum(int)} for any possible time value,
      * taking into consideration the current values of the
@@ -1665,16 +1665,16 @@
      * {@link Calendar#getTimeZone() getTimeZone} methods.
      *
      * <p>For example, if the Gregorian change date is January 10,
-     * 1970 and the date of this <code>GregorianCalendar</code> is
+     * 1970 and the date of this {@code GregorianCalendar} is
      * January 20, 1970, the actual minimum value of the
-     * <code>DAY_OF_MONTH</code> field is 10 because the previous date
+     * {@code DAY_OF_MONTH} field is 10 because the previous date
      * of January 10, 1970 is December 27, 1996 (in the Julian
      * calendar). Therefore, December 28, 1969 to January 9, 1970
      * don't exist.
      *
      * @param field the calendar field
      * @return the minimum of the given field for the time value of
-     * this <code>GregorianCalendar</code>
+     * this {@code GregorianCalendar}
      * @see #getMinimum(int)
      * @see #getMaximum(int)
      * @see #getGreatestMinimum(int)
@@ -1705,7 +1705,7 @@
      * {@link #getGregorianChange() getGregorianChange} and
      * {@link Calendar#getTimeZone() getTimeZone} methods.
      * For example, if the date of this instance is February 1, 2004,
-     * the actual maximum value of the <code>DAY_OF_MONTH</code> field
+     * the actual maximum value of the {@code DAY_OF_MONTH} field
      * is 29 because 2004 is a leap year, and if the date of this
      * instance is February 1, 2005, it's 28.
      *
@@ -1718,7 +1718,7 @@
      *
      * @param field the calendar field
      * @return the maximum of the given field for the time value of
-     * this <code>GregorianCalendar</code>
+     * this {@code GregorianCalendar}
      * @see #getMinimum(int)
      * @see #getMaximum(int)
      * @see #getGreatestMinimum(int)
@@ -2287,7 +2287,7 @@
      * href="Calendar.html#Epoch">Epoch</a>) to calendar field values.
      * The time is <em>not</em>
      * recomputed first; to recompute the time, then the fields, call the
-     * <code>complete</code> method.
+     * {@code complete} method.
      *
      * @see Calendar#complete
      */
--- a/src/java.base/share/classes/java/util/IllformedLocaleException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/IllformedLocaleException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -47,7 +47,7 @@
     private int _errIdx = -1;
 
     /**
-     * Constructs a new <code>IllformedLocaleException</code> with no
+     * Constructs a new {@code IllformedLocaleException} with no
      * detail message and -1 as the error index.
      */
     public IllformedLocaleException() {
@@ -55,7 +55,7 @@
     }
 
     /**
-     * Constructs a new <code>IllformedLocaleException</code> with the
+     * Constructs a new {@code IllformedLocaleException} with the
      * given message and -1 as the error index.
      *
      * @param message the message
@@ -65,7 +65,7 @@
     }
 
     /**
-     * Constructs a new <code>IllformedLocaleException</code> with the
+     * Constructs a new {@code IllformedLocaleException} with the
      * given message and the error index.  The error index is the approximate
      * offset from the start of the ill-formed value to the point where the
      * parse first detected an error.  A negative error index value indicates
--- a/src/java.base/share/classes/java/util/ListResourceBundle.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/ListResourceBundle.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2016, 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
@@ -43,16 +43,16 @@
 import sun.util.ResourceBundleEnumeration;
 
 /**
- * <code>ListResourceBundle</code> is an abstract subclass of
- * <code>ResourceBundle</code> that manages resources for a locale
- * in a convenient and easy to use list. See <code>ResourceBundle</code> for
+ * {@code ListResourceBundle} is an abstract subclass of
+ * {@code ResourceBundle} that manages resources for a locale
+ * in a convenient and easy to use list. See {@code ResourceBundle} for
  * more information about resource bundles in general.
  *
  * <P>
- * Subclasses must override <code>getContents</code> and provide an array,
+ * Subclasses must override {@code getContents} and provide an array,
  * where each item in the array is a pair of objects.
  * The first element of each pair is the key, which must be a
- * <code>String</code>, and the second element is the value associated with
+ * {@code String}, and the second element is the value associated with
  * that key.
  *
  * <p>
@@ -60,7 +60,7 @@
  * bundle family with the base name "MyResources".
  * "MyResources" is the default member of the bundle family, and
  * "MyResources_fr" is the French member.
- * These members are based on <code>ListResourceBundle</code>
+ * These members are based on {@code ListResourceBundle}
  * (a related <a href="PropertyResourceBundle.html#sample">example</a> shows
  * how you can add a bundle to this family that's based on a properties file).
  * The keys in this example are of the form "s1" etc. The actual
@@ -136,11 +136,11 @@
     }
 
     /**
-     * Returns an <code>Enumeration</code> of the keys contained in
-     * this <code>ResourceBundle</code> and its parent bundles.
+     * Returns an {@code Enumeration} of the keys contained in
+     * this {@code ResourceBundle} and its parent bundles.
      *
-     * @return an <code>Enumeration</code> of the keys contained in
-     *         this <code>ResourceBundle</code> and its parent bundles.
+     * @return an {@code Enumeration} of the keys contained in
+     *         this {@code ResourceBundle} and its parent bundles.
      * @see #keySet()
      */
     public Enumeration<String> getKeys() {
@@ -155,11 +155,11 @@
     }
 
     /**
-     * Returns a <code>Set</code> of the keys contained
-     * <em>only</em> in this <code>ResourceBundle</code>.
+     * Returns a {@code Set} of the keys contained
+     * <em>only</em> in this {@code ResourceBundle}.
      *
-     * @return a <code>Set</code> of the keys contained only in this
-     *         <code>ResourceBundle</code>
+     * @return a {@code Set} of the keys contained only in this
+     *         {@code ResourceBundle}
      * @since 1.6
      * @see #keySet()
      */
@@ -172,12 +172,12 @@
 
     /**
      * Returns an array in which each item is a pair of objects in an
-     * <code>Object</code> array. The first element of each pair is
-     * the key, which must be a <code>String</code>, and the second
+     * {@code Object} array. The first element of each pair is
+     * the key, which must be a {@code String}, and the second
      * element is the value associated with that key.  See the class
      * description for details.
      *
-     * @return an array of an <code>Object</code> array representing a
+     * @return an array of an {@code Object} array representing a
      * key-value pair.
      */
     protected abstract Object[][] getContents();
--- a/src/java.base/share/classes/java/util/Locale.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/Locale.java	Wed Sep 25 22:40:41 2019 +0200
@@ -66,9 +66,9 @@
 import sun.util.locale.provider.TimeZoneNameUtility;
 
 /**
- * A <code>Locale</code> object represents a specific geographical, political,
- * or cultural region. An operation that requires a <code>Locale</code> to perform
- * its task is called <em>locale-sensitive</em> and uses the <code>Locale</code>
+ * A {@code Locale} object represents a specific geographical, political,
+ * or cultural region. An operation that requires a {@code Locale} to perform
+ * its task is called <em>locale-sensitive</em> and uses the {@code Locale}
  * to tailor information for the user. For example, displaying a number
  * is a locale-sensitive operation&mdash; the number should be formatted
  * according to the customs and conventions of the user's native country,
@@ -81,7 +81,7 @@
  * Locale Data Markup Language") BCP 47-compatible extensions for locale data
  * exchange.
  *
- * <p> A <code>Locale</code> object logically consists of the fields
+ * <p> A {@code Locale} object logically consists of the fields
  * described below.
  *
  * <dl>
@@ -93,7 +93,7 @@
  *   alpha-2 code must be used.  You can find a full list of valid
  *   language codes in the IANA Language Subtag Registry (search for
  *   "Type: language").  The language field is case insensitive, but
- *   <code>Locale</code> always canonicalizes to lower case.</dd>
+ *   {@code Locale} always canonicalizes to lower case.</dd>
  *
  *   <dd>Well-formed language values have the form
  *   <code>[a-zA-Z]{2,8}</code>.  Note that this is not the full
@@ -108,7 +108,7 @@
  *   <dd>ISO 15924 alpha-4 script code.  You can find a full list of
  *   valid script codes in the IANA Language Subtag Registry (search
  *   for "Type: script").  The script field is case insensitive, but
- *   <code>Locale</code> always canonicalizes to title case (the first
+ *   {@code Locale} always canonicalizes to title case (the first
  *   letter is upper case and the rest of the letters are lower
  *   case).</dd>
  *
@@ -123,7 +123,7 @@
  *   You can find a full list of valid country and region codes in the
  *   IANA Language Subtag Registry (search for "Type: region").  The
  *   country (region) field is case insensitive, but
- *   <code>Locale</code> always canonicalizes to upper case.</dd>
+ *   {@code Locale} always canonicalizes to upper case.</dd>
  *
  *   <dd>Well-formed country/region values have
  *   the form <code>[a-zA-Z]{2} | [0-9]{3}</code></dd>
@@ -134,7 +134,7 @@
  *   <dt><a id="def_variant"><b>variant</b></a></dt>
  *
  *   <dd>Any arbitrary value used to indicate a variation of a
- *   <code>Locale</code>.  Where there are two or more variant values
+ *   {@code Locale}.  Where there are two or more variant values
  *   each indicating its own semantics, these values should be ordered
  *   by importance, with most important first, separated by
  *   underscore('_').  The variant field is case sensitive.</dd>
@@ -146,7 +146,7 @@
  *   region subtags.  You can find a full list of valid variant codes
  *   in the IANA Language Subtag Registry (search for "Type: variant").
  *
- *   <p>However, the variant field in <code>Locale</code> has
+ *   <p>However, the variant field in {@code Locale} has
  *   historically been used for any kind of variation, not just
  *   language variations.  For example, some supported variants
  *   available in Java SE Runtime Environments indicate alternative
@@ -166,15 +166,15 @@
  *
  *   <dd>A map from single character keys to string values, indicating
  *   extensions apart from language identification.  The extensions in
- *   <code>Locale</code> implement the semantics and syntax of BCP 47
+ *   {@code Locale} implement the semantics and syntax of BCP 47
  *   extension subtags and private use subtags. The extensions are
- *   case insensitive, but <code>Locale</code> canonicalizes all
+ *   case insensitive, but {@code Locale} canonicalizes all
  *   extension keys and values to lower case. Note that extensions
  *   cannot have empty values.</dd>
  *
  *   <dd>Well-formed keys are single characters from the set
- *   <code>[0-9a-zA-Z]</code>.  Well-formed values have the form
- *   <code>SUBTAG ('-' SUBTAG)*</code> where for the key 'x'
+ *   {@code [0-9a-zA-Z]}.  Well-formed values have the form
+ *   {@code SUBTAG ('-' SUBTAG)*} where for the key 'x'
  *   <code>SUBTAG = [0-9a-zA-Z]{1,8}</code> and for other keys
  *   <code>SUBTAG = [0-9a-zA-Z]{2,8}</code> (that is, 'x' allows
  *   single-character subtags).</dd>
@@ -184,8 +184,8 @@
  * </dl>
  *
  * <b>Note:</b> Although BCP 47 requires field values to be registered
- * in the IANA Language Subtag Registry, the <code>Locale</code> class
- * does not provide any validation features.  The <code>Builder</code>
+ * in the IANA Language Subtag Registry, the {@code Locale} class
+ * does not provide any validation features.  The {@code Builder}
  * only checks if an individual field satisfies the syntactic
  * requirement (is well-formed), but does not validate the value
  * itself.  See {@link Builder} for details.
@@ -203,11 +203,11 @@
  * extension key 'u' ({@link #UNICODE_LOCALE_EXTENSION}).  The above
  * example, "nu-thai", becomes the extension "u-nu-thai".
  *
- * <p>Thus, when a <code>Locale</code> object contains Unicode locale
+ * <p>Thus, when a {@code Locale} object contains Unicode locale
  * attributes and keywords,
- * <code>getExtension(UNICODE_LOCALE_EXTENSION)</code> will return a
+ * {@code getExtension(UNICODE_LOCALE_EXTENSION)} will return a
  * String representing this information, for example, "nu-thai".  The
- * <code>Locale</code> class also provides {@link
+ * {@code Locale} class also provides {@link
  * #getUnicodeLocaleAttributes}, {@link #getUnicodeLocaleKeys}, and
  * {@link #getUnicodeLocaleType} which allow you to access Unicode
  * locale attributes and key/type pairs directly.  When represented as
@@ -232,17 +232,17 @@
  *
  * <h3>Creating a Locale</h3>
  *
- * <p>There are several different ways to create a <code>Locale</code>
+ * <p>There are several different ways to create a {@code Locale}
  * object.
  *
  * <h4>Builder</h4>
  *
- * <p>Using {@link Builder} you can construct a <code>Locale</code> object
+ * <p>Using {@link Builder} you can construct a {@code Locale} object
  * that conforms to BCP 47 syntax.
  *
  * <h4>Constructors</h4>
  *
- * <p>The <code>Locale</code> class provides three constructors:
+ * <p>The {@code Locale} class provides three constructors:
  * <blockquote>
  * <pre>
  *     {@link #Locale(String language)}
@@ -250,20 +250,20 @@
  *     {@link #Locale(String language, String country, String variant)}
  * </pre>
  * </blockquote>
- * These constructors allow you to create a <code>Locale</code> object
+ * These constructors allow you to create a {@code Locale} object
  * with language, country and variant, but you cannot specify
  * script or extensions.
  *
  * <h4>Factory Methods</h4>
  *
- * <p>The method {@link #forLanguageTag} creates a <code>Locale</code>
+ * <p>The method {@link #forLanguageTag} creates a {@code Locale}
  * object for a well-formed BCP 47 language tag.
  *
  * <h4>Locale Constants</h4>
  *
- * <p>The <code>Locale</code> class provides a number of convenient constants
- * that you can use to create <code>Locale</code> objects for commonly used
- * locales. For example, the following creates a <code>Locale</code> object
+ * <p>The {@code Locale} class provides a number of convenient constants
+ * that you can use to create {@code Locale} objects for commonly used
+ * locales. For example, the following creates a {@code Locale} object
  * for the United States:
  * <blockquote>
  * <pre>
@@ -344,25 +344,25 @@
  *
  * <h3>Use of Locale</h3>
  *
- * <p>Once you've created a <code>Locale</code> you can query it for information
- * about itself. Use <code>getCountry</code> to get the country (or region)
- * code and <code>getLanguage</code> to get the language code.
- * You can use <code>getDisplayCountry</code> to get the
+ * <p>Once you've created a {@code Locale} you can query it for information
+ * about itself. Use {@code getCountry} to get the country (or region)
+ * code and {@code getLanguage} to get the language code.
+ * You can use {@code getDisplayCountry} to get the
  * name of the country suitable for displaying to the user. Similarly,
- * you can use <code>getDisplayLanguage</code> to get the name of
+ * you can use {@code getDisplayLanguage} to get the name of
  * the language suitable for displaying to the user. Interestingly,
- * the <code>getDisplayXXX</code> methods are themselves locale-sensitive
+ * the {@code getDisplayXXX} methods are themselves locale-sensitive
  * and have two versions: one that uses the default
  * {@link Locale.Category#DISPLAY DISPLAY} locale and one
  * that uses the locale specified as an argument.
  *
  * <p>The Java Platform provides a number of classes that perform locale-sensitive
- * operations. For example, the <code>NumberFormat</code> class formats
+ * operations. For example, the {@code NumberFormat} class formats
  * numbers, currency, and percentages in a locale-sensitive manner. Classes
- * such as <code>NumberFormat</code> have several convenience methods
+ * such as {@code NumberFormat} have several convenience methods
  * for creating a default object of that type. For example, the
- * <code>NumberFormat</code> class provides these three convenience methods
- * for creating a default <code>NumberFormat</code> object:
+ * {@code NumberFormat} class provides these three convenience methods
+ * for creating a default {@code NumberFormat} object:
  * <blockquote>
  * <pre>
  *     NumberFormat.getInstance()
@@ -380,8 +380,8 @@
  *     NumberFormat.getPercentInstance(myLocale)
  * </pre>
  * </blockquote>
- * A <code>Locale</code> is the mechanism for identifying the kind of object
- * (<code>NumberFormat</code>) that you would like to get. The locale is
+ * A {@code Locale} is the mechanism for identifying the kind of object
+ * ({@code NumberFormat}) that you would like to get. The locale is
  * <STRONG>just</STRONG> a mechanism for identifying objects,
  * <STRONG>not</STRONG> a container for the objects themselves.
  *
@@ -390,7 +390,7 @@
  * <p>In order to maintain compatibility with existing usage, Locale's
  * constructors retain their behavior prior to the Java Runtime
  * Environment version 1.7.  The same is largely true for the
- * <code>toString</code> method. Thus Locale objects can continue to
+ * {@code toString} method. Thus Locale objects can continue to
  * be used as they were. In particular, clients who parse the output
  * of toString into language, country, and variant fields can continue
  * to do so (although this is strongly discouraged), although the
@@ -400,15 +400,15 @@
  * <p>In addition, BCP 47 imposes syntax restrictions that are not
  * imposed by Locale's constructors. This means that conversions
  * between some Locales and BCP 47 language tags cannot be made without
- * losing information. Thus <code>toLanguageTag</code> cannot
+ * losing information. Thus {@code toLanguageTag} cannot
  * represent the state of locales whose language, country, or variant
  * do not conform to BCP 47.
  *
  * <p>Because of these issues, it is recommended that clients migrate
  * away from constructing non-conforming locales and use the
- * <code>forLanguageTag</code> and <code>Locale.Builder</code> APIs instead.
+ * {@code forLanguageTag} and {@code Locale.Builder} APIs instead.
  * Clients desiring a string representation of the complete locale can
- * then always rely on <code>toLanguageTag</code> for this purpose.
+ * then always rely on {@code toLanguageTag} for this purpose.
  *
  * <h4><a id="special_cases_constructor">Special cases</a></h4>
  *
@@ -454,9 +454,9 @@
  *
  * <p>The APIs added in 1.7 map between the old and new language codes,
  * maintaining the old codes internal to Locale (so that
- * <code>getLanguage</code> and <code>toString</code> reflect the old
+ * {@code getLanguage} and {@code toString} reflect the old
  * code), but using the new codes in the BCP 47 language tag APIs (so
- * that <code>toLanguageTag</code> reflects the new one). This
+ * that {@code toLanguageTag} reflects the new one). This
  * preserves the equivalence between Locales no matter which code or
  * API is used to construct them. Java's default resource bundle
  * lookup mechanism also implements this mapping, so that resources
@@ -734,12 +734,12 @@
      * </ul>
      *
      * @param language An ISO 639 alpha-2 or alpha-3 language code, or a language subtag
-     * up to 8 characters in length.  See the <code>Locale</code> class description about
+     * up to 8 characters in length.  See the {@code Locale} class description about
      * valid language values.
      * @param country An ISO 3166 alpha-2 country code or a UN M.49 numeric-3 area code.
-     * See the <code>Locale</code> class description about valid country values.
-     * @param variant Any arbitrary value used to indicate a variation of a <code>Locale</code>.
-     * See the <code>Locale</code> class description for the details.
+     * See the {@code Locale} class description about valid country values.
+     * @param variant Any arbitrary value used to indicate a variation of a {@code Locale}.
+     * See the {@code Locale} class description for the details.
      * @throws    NullPointerException thrown if any argument is null.
      */
     public Locale(String language, String country, String variant) {
@@ -766,10 +766,10 @@
      * </ul>
      *
      * @param language An ISO 639 alpha-2 or alpha-3 language code, or a language subtag
-     * up to 8 characters in length.  See the <code>Locale</code> class description about
+     * up to 8 characters in length.  See the {@code Locale} class description about
      * valid language values.
      * @param country An ISO 3166 alpha-2 country code or a UN M.49 numeric-3 area code.
-     * See the <code>Locale</code> class description about valid country values.
+     * See the {@code Locale} class description about valid country values.
      * @throws    NullPointerException thrown if either argument is null.
      */
     public Locale(String language, String country) {
@@ -791,7 +791,7 @@
      * </ul>
      *
      * @param language An ISO 639 alpha-2 or alpha-3 language code, or a language subtag
-     * up to 8 characters in length.  See the <code>Locale</code> class description about
+     * up to 8 characters in length.  See the {@code Locale} class description about
      * valid language values.
      * @throws    NullPointerException thrown if argument is null.
      * @since 1.4
@@ -801,17 +801,17 @@
     }
 
     /**
-     * Returns a <code>Locale</code> constructed from the given
-     * <code>language</code>, <code>country</code> and
-     * <code>variant</code>. If the same <code>Locale</code> instance
+     * Returns a {@code Locale} constructed from the given
+     * {@code language}, {@code country} and
+     * {@code variant}. If the same {@code Locale} instance
      * is available in the cache, then that instance is
-     * returned. Otherwise, a new <code>Locale</code> instance is
+     * returned. Otherwise, a new {@code Locale} instance is
      * created and cached.
      *
      * @param language lowercase 2 to 8 language code.
      * @param country uppercase two-letter ISO-3166 code and numeric-3 UN M.49 area code.
      * @param variant vendor and browser specific code. See class description.
-     * @return the <code>Locale</code> instance requested
+     * @return the {@code Locale} instance requested
      * @throws    NullPointerException if any argument is null.
      */
     static Locale getInstance(String language, String country, String variant) {
@@ -1029,8 +1029,8 @@
      * Sets the default locale for this instance of the Java Virtual Machine.
      * This does not affect the host locale.
      * <p>
-     * If there is a security manager, its <code>checkPermission</code>
-     * method is called with a <code>PropertyPermission("user.language", "write")</code>
+     * If there is a security manager, its {@code checkPermission}
+     * method is called with a {@code PropertyPermission("user.language", "write")}
      * permission before the default locale is changed.
      * <p>
      * The Java Virtual Machine sets the default locale during startup
@@ -1047,8 +1047,8 @@
      *
      * @throws SecurityException
      *        if a security manager exists and its
-     *        <code>checkPermission</code> method doesn't allow the operation.
-     * @throws NullPointerException if <code>newLocale</code> is null
+     *        {@code checkPermission} method doesn't allow the operation.
+     * @throws NullPointerException if {@code newLocale} is null
      * @param newLocale the new default locale
      * @see SecurityManager#checkPermission
      * @see java.util.PropertyPermission
@@ -1113,7 +1113,7 @@
      * The returned array represents the union of locales supported
      * by the Java runtime environment and by installed
      * {@link java.util.spi.LocaleServiceProvider LocaleServiceProvider}
-     * implementations.  It must contain at least a <code>Locale</code>
+     * implementations.  It must contain at least a {@code Locale}
      * instance equal to {@link java.util.Locale#US Locale.US}.
      *
      * @return An array of installed locales.
@@ -1128,7 +1128,7 @@
      * This method is equivalent to {@link #getISOCountries(Locale.IsoCountryCode type)}
      * with {@code type}  {@link IsoCountryCode#PART1_ALPHA2}.
      * <p>
-     * <b>Note:</b> The <code>Locale</code> class also supports other codes for
+     * <b>Note:</b> The {@code Locale} class also supports other codes for
      * country (region), such as 3-letter numeric UN M.49 area codes.
      * Therefore, the list returned by this method does not contain ALL valid
      * codes that can be used to create Locales.
@@ -1171,7 +1171,7 @@
      * <li>ISO 639 is not a stable standard&mdash; some languages' codes have changed.
      * The list this function returns includes both the new and the old codes for the
      * languages whose codes have changed.
-     * <li>The <code>Locale</code> class also supports language codes up to
+     * <li>The {@code Locale} class also supports language codes up to
      * 8 characters in length.  Therefore, the list returned by this method does
      * not contain ALL valid codes that can be used to create Locales.
      * </ul>
@@ -1283,7 +1283,7 @@
      * Returns the extension (or private use) value associated with
      * the specified key, or null if there is no extension
      * associated with the key. To be well-formed, the key must be one
-     * of <code>[0-9A-Za-z]</code>. Keys are case-insensitive, so
+     * of {@code [0-9A-Za-z]}. Keys are case-insensitive, so
      * for example 'z' and 'Z' represent the same extension.
      *
      * @param key the extension key
@@ -1343,7 +1343,7 @@
      * @return The Unicode locale type associated with the key, or null if the
      * locale does not define the key.
      * @throws IllegalArgumentException if the key is not well-formed
-     * @throws NullPointerException if <code>key</code> is null
+     * @throws NullPointerException if {@code key} is null
      * @since 1.7
      */
     public String getUnicodeLocaleType(String key) {
@@ -1388,7 +1388,7 @@
      }
 
     /**
-     * Returns a string representation of this <code>Locale</code>
+     * Returns a string representation of this {@code Locale}
      * object, consisting of language, country, variant, script,
      * and extensions as below:
      * <blockquote>
@@ -1411,7 +1411,7 @@
      * added before the "#".
      *
      * <p>This behavior is designed to support debugging and to be compatible with
-     * previous uses of <code>toString</code> that expected language, country, and variant
+     * previous uses of {@code toString} that expected language, country, and variant
      * fields only.  To represent a Locale as a String for interchange purposes, use
      * {@link #toLanguageTag}.
      *
@@ -1467,7 +1467,7 @@
      * Returns a well-formed IETF BCP 47 language tag representing
      * this locale.
      *
-     * <p>If this <code>Locale</code> has a language, country, or
+     * <p>If this {@code Locale} has a language, country, or
      * variant that does not satisfy the IETF BCP 47 language tag
      * syntax requirements, this method handles these fields as
      * described below:
@@ -1703,12 +1703,12 @@
      * <p>For a list of all grandfathered tags, see the
      * IANA Language Subtag Registry (search for "Type: grandfathered").
      *
-     * <p><b>Note</b>: there is no guarantee that <code>toLanguageTag</code>
-     * and <code>forLanguageTag</code> will round-trip.
+     * <p><b>Note</b>: there is no guarantee that {@code toLanguageTag}
+     * and {@code forLanguageTag} will round-trip.
      *
      * @param languageTag the language tag
      * @return The locale that best represents the language tag.
-     * @throws NullPointerException if <code>languageTag</code> is <code>null</code>
+     * @throws NullPointerException if {@code languageTag} is {@code null}
      * @see #toLanguageTag()
      * @see java.util.Locale.Builder#setLanguageTag(String)
      * @since 1.7
@@ -1834,7 +1834,7 @@
      *
      * @param inLocale The locale for which to retrieve the display language.
      * @return The name of the display language appropriate to the given locale.
-     * @throws    NullPointerException if <code>inLocale</code> is <code>null</code>
+     * @throws    NullPointerException if {@code inLocale} is {@code null}
      */
     public String getDisplayLanguage(Locale inLocale) {
         return getDisplayString(baseLocale.getLanguage(), null, inLocale, DISPLAY_LANGUAGE);
@@ -1863,7 +1863,7 @@
      * @param inLocale The locale for which to retrieve the display script.
      * @return the display name of the script code for the current default
      * {@link Locale.Category#DISPLAY DISPLAY} locale
-     * @throws NullPointerException if <code>inLocale</code> is <code>null</code>
+     * @throws NullPointerException if {@code inLocale} is {@code null}
      * @since 1.7
      */
     public String getDisplayScript(Locale inLocale) {
@@ -1907,7 +1907,7 @@
      *
      * @param inLocale The locale for which to retrieve the display country.
      * @return The name of the country appropriate to the given locale.
-     * @throws    NullPointerException if <code>inLocale</code> is <code>null</code>
+     * @throws    NullPointerException if {@code inLocale} is {@code null}
      */
     public String getDisplayCountry(Locale inLocale) {
         return getDisplayString(baseLocale.getRegion(), null, inLocale, DISPLAY_COUNTRY);
@@ -1949,7 +1949,7 @@
      *
      * @param inLocale The locale for which to retrieve the display variant code.
      * @return The name of the display variant code appropriate to the given locale.
-     * @throws    NullPointerException if <code>inLocale</code> is <code>null</code>
+     * @throws    NullPointerException if {@code inLocale} is {@code null}
      */
     public String getDisplayVariant(Locale inLocale) {
         if (baseLocale.getVariant().isEmpty())
@@ -2014,7 +2014,7 @@
      *
      * @param inLocale The locale for which to retrieve the display name.
      * @return The name of the locale appropriate to display.
-     * @throws NullPointerException if <code>inLocale</code> is <code>null</code>
+     * @throws NullPointerException if {@code inLocale} is {@code null}
      */
     public String getDisplayName(Locale inLocale) {
         LocaleResources lr =  LocaleProviderAdapter
@@ -2313,8 +2313,8 @@
     };
 
     /**
-     * Serializes this <code>Locale</code> to the specified <code>ObjectOutputStream</code>.
-     * @param out the <code>ObjectOutputStream</code> to write
+     * Serializes this {@code Locale} to the specified {@code ObjectOutputStream}.
+     * @param out the {@code ObjectOutputStream} to write
      * @throws IOException
      * @since 1.7
      */
@@ -2331,8 +2331,8 @@
     }
 
     /**
-     * Deserializes this <code>Locale</code>.
-     * @param in the <code>ObjectInputStream</code> to read
+     * Deserializes this {@code Locale}.
+     * @param in the {@code ObjectInputStream} to read
      * @throws IOException
      * @throws ClassNotFoundException
      * @throws IllformedLocaleException
@@ -2362,17 +2362,17 @@
     }
 
     /**
-     * Returns a cached <code>Locale</code> instance equivalent to
-     * the deserialized <code>Locale</code>. When serialized
+     * Returns a cached {@code Locale} instance equivalent to
+     * the deserialized {@code Locale}. When serialized
      * language, country and variant fields read from the object data stream
      * are exactly "ja", "JP", "JP" or "th", "TH", "TH" and script/extensions
-     * fields are empty, this method supplies <code>UNICODE_LOCALE_EXTENSION</code>
+     * fields are empty, this method supplies {@code UNICODE_LOCALE_EXTENSION}
      * "ca"/"japanese" (calendar type is "japanese") or "nu"/"thai" (number script
      * type is "thai"). See <a href="Locale.html#special_cases_constructor">Special Cases</a>
      * for more information.
      *
-     * @return an instance of <code>Locale</code> equivalent to
-     * the deserialized <code>Locale</code>.
+     * @return an instance of {@code Locale} equivalent to
+     * the deserialized {@code Locale}.
      * @throws java.io.ObjectStreamException
      */
     @java.io.Serial
@@ -2509,33 +2509,33 @@
     }
 
     /**
-     * <code>Builder</code> is used to build instances of <code>Locale</code>
-     * from values configured by the setters.  Unlike the <code>Locale</code>
-     * constructors, the <code>Builder</code> checks if a value configured by a
-     * setter satisfies the syntax requirements defined by the <code>Locale</code>
-     * class.  A <code>Locale</code> object created by a <code>Builder</code> is
+     * {@code Builder} is used to build instances of {@code Locale}
+     * from values configured by the setters.  Unlike the {@code Locale}
+     * constructors, the {@code Builder} checks if a value configured by a
+     * setter satisfies the syntax requirements defined by the {@code Locale}
+     * class.  A {@code Locale} object created by a {@code Builder} is
      * well-formed and can be transformed to a well-formed IETF BCP 47 language tag
      * without losing information.
      *
-     * <p><b>Note:</b> The <code>Locale</code> class does not provide any
+     * <p><b>Note:</b> The {@code Locale} class does not provide any
      * syntactic restrictions on variant, while BCP 47 requires each variant
      * subtag to be 5 to 8 alphanumerics or a single numeric followed by 3
-     * alphanumerics.  The method <code>setVariant</code> throws
-     * <code>IllformedLocaleException</code> for a variant that does not satisfy
+     * alphanumerics.  The method {@code setVariant} throws
+     * {@code IllformedLocaleException} for a variant that does not satisfy
      * this restriction. If it is necessary to support such a variant, use a
-     * Locale constructor.  However, keep in mind that a <code>Locale</code>
+     * Locale constructor.  However, keep in mind that a {@code Locale}
      * object created this way might lose the variant information when
      * transformed to a BCP 47 language tag.
      *
-     * <p>The following example shows how to create a <code>Locale</code> object
-     * with the <code>Builder</code>.
+     * <p>The following example shows how to create a {@code Locale} object
+     * with the {@code Builder}.
      * <blockquote>
      * <pre>
      *     Locale aLocale = new Builder().setLanguage("sr").setScript("Latn").setRegion("RS").build();
      * </pre>
      * </blockquote>
      *
-     * <p>Builders can be reused; <code>clear()</code> resets all
+     * <p>Builders can be reused; {@code clear()} resets all
      * fields to their default values.
      *
      * @see Locale#forLanguageTag
@@ -2554,13 +2554,13 @@
         }
 
         /**
-         * Resets the <code>Builder</code> to match the provided
-         * <code>locale</code>.  Existing state is discarded.
+         * Resets the {@code Builder} to match the provided
+         * {@code locale}.  Existing state is discarded.
          *
          * <p>All fields of the locale must be well-formed, see {@link Locale}.
          *
          * <p>Locales with any ill-formed fields cause
-         * <code>IllformedLocaleException</code> to be thrown, except for the
+         * {@code IllformedLocaleException} to be thrown, except for the
          * following three cases which are accepted for compatibility
          * reasons:<ul>
          * <li>Locale("ja", "JP", "JP") is treated as "ja-JP-u-ca-japanese"
@@ -2569,9 +2569,9 @@
          *
          * @param locale the locale
          * @return This builder.
-         * @throws IllformedLocaleException if <code>locale</code> has
+         * @throws IllformedLocaleException if {@code locale} has
          * any ill-formed fields.
-         * @throws NullPointerException if <code>locale</code> is null.
+         * @throws NullPointerException if {@code locale} is null.
          */
         public Builder setLocale(Locale locale) {
             try {
@@ -2590,13 +2590,13 @@
          * Locale#forLanguageTag}) are converted to their canonical
          * form before being processed.  Otherwise, the language tag
          * must be well-formed (see {@link Locale}) or an exception is
-         * thrown (unlike <code>Locale.forLanguageTag</code>, which
+         * thrown (unlike {@code Locale.forLanguageTag}, which
          * just discards ill-formed and following portions of the
          * tag).
          *
          * @param languageTag the language tag
          * @return This builder.
-         * @throws IllformedLocaleException if <code>languageTag</code> is ill-formed
+         * @throws IllformedLocaleException if {@code languageTag} is ill-formed
          * @see Locale#forLanguageTag(String)
          */
         public Builder setLanguageTag(String languageTag) {
@@ -2610,8 +2610,8 @@
         }
 
         /**
-         * Sets the language.  If <code>language</code> is the empty string or
-         * null, the language in this <code>Builder</code> is removed.  Otherwise,
+         * Sets the language.  If {@code language} is the empty string or
+         * null, the language in this {@code Builder} is removed.  Otherwise,
          * the language must be <a href="./Locale.html#def_language">well-formed</a>
          * or an exception is thrown.
          *
@@ -2620,7 +2620,7 @@
          *
          * @param language the language
          * @return This builder.
-         * @throws IllformedLocaleException if <code>language</code> is ill-formed
+         * @throws IllformedLocaleException if {@code language} is ill-formed
          */
         public Builder setLanguage(String language) {
             try {
@@ -2632,8 +2632,8 @@
         }
 
         /**
-         * Sets the script. If <code>script</code> is null or the empty string,
-         * the script in this <code>Builder</code> is removed.
+         * Sets the script. If {@code script} is null or the empty string,
+         * the script in this {@code Builder} is removed.
          * Otherwise, the script must be <a href="./Locale.html#def_script">well-formed</a> or an
          * exception is thrown.
          *
@@ -2641,7 +2641,7 @@
          *
          * @param script the script
          * @return This builder.
-         * @throws IllformedLocaleException if <code>script</code> is ill-formed
+         * @throws IllformedLocaleException if {@code script} is ill-formed
          */
         public Builder setScript(String script) {
             try {
@@ -2654,19 +2654,19 @@
 
         /**
          * Sets the region.  If region is null or the empty string, the region
-         * in this <code>Builder</code> is removed.  Otherwise,
+         * in this {@code Builder} is removed.  Otherwise,
          * the region must be <a href="./Locale.html#def_region">well-formed</a> or an
          * exception is thrown.
          *
          * <p>The typical region value is a two-letter ISO 3166 code or a
          * three-digit UN M.49 area code.
          *
-         * <p>The country value in the <code>Locale</code> created by the
-         * <code>Builder</code> is always normalized to upper case.
+         * <p>The country value in the {@code Locale} created by the
+         * {@code Builder} is always normalized to upper case.
          *
          * @param region the region
          * @return This builder.
-         * @throws IllformedLocaleException if <code>region</code> is ill-formed
+         * @throws IllformedLocaleException if {@code region} is ill-formed
          */
         public Builder setRegion(String region) {
             try {
@@ -2679,21 +2679,21 @@
 
         /**
          * Sets the variant.  If variant is null or the empty string, the
-         * variant in this <code>Builder</code> is removed.  Otherwise, it
+         * variant in this {@code Builder} is removed.  Otherwise, it
          * must consist of one or more <a href="./Locale.html#def_variant">well-formed</a>
          * subtags, or an exception is thrown.
          *
-         * <p><b>Note:</b> This method checks if <code>variant</code>
+         * <p><b>Note:</b> This method checks if {@code variant}
          * satisfies the IETF BCP 47 variant subtag's syntax requirements,
          * and normalizes the value to lowercase letters.  However,
-         * the <code>Locale</code> class does not impose any syntactic
+         * the {@code Locale} class does not impose any syntactic
          * restriction on variant, and the variant value in
-         * <code>Locale</code> is case sensitive.  To set such a variant,
+         * {@code Locale} is case sensitive.  To set such a variant,
          * use a Locale constructor.
          *
          * @param variant the variant
          * @return This builder.
-         * @throws IllformedLocaleException if <code>variant</code> is ill-formed
+         * @throws IllformedLocaleException if {@code variant} is ill-formed
          */
         public Builder setVariant(String variant) {
             try {
@@ -2723,8 +2723,8 @@
          * @param key the extension key
          * @param value the extension value
          * @return This builder.
-         * @throws IllformedLocaleException if <code>key</code> is illegal
-         * or <code>value</code> is ill-formed
+         * @throws IllformedLocaleException if {@code key} is illegal
+         * or {@code value} is ill-formed
          * @see #setUnicodeLocaleKeyword(String, String)
          */
         public Builder setExtension(char key, String value) {
@@ -2752,9 +2752,9 @@
          * @param key the Unicode locale key
          * @param type the Unicode locale type
          * @return This builder.
-         * @throws IllformedLocaleException if <code>key</code> or <code>type</code>
+         * @throws IllformedLocaleException if {@code key} or {@code type}
          * is ill-formed
-         * @throws NullPointerException if <code>key</code> is null
+         * @throws NullPointerException if {@code key} is null
          * @see #setExtension(char, String)
          */
         public Builder setUnicodeLocaleKeyword(String key, String type) {
@@ -2774,8 +2774,8 @@
          *
          * @param attribute the attribute
          * @return This builder.
-         * @throws NullPointerException if <code>attribute</code> is null
-         * @throws IllformedLocaleException if <code>attribute</code> is ill-formed
+         * @throws NullPointerException if {@code attribute} is null
+         * @throws IllformedLocaleException if {@code attribute} is ill-formed
          * @see #setExtension(char, String)
          */
         public Builder addUnicodeLocaleAttribute(String attribute) {
@@ -2797,8 +2797,8 @@
          *
          * @param attribute the attribute
          * @return This builder.
-         * @throws NullPointerException if <code>attribute</code> is null
-         * @throws IllformedLocaleException if <code>attribute</code> is ill-formed
+         * @throws NullPointerException if {@code attribute} is null
+         * @throws IllformedLocaleException if {@code attribute} is ill-formed
          * @see #setExtension(char, String)
          */
         public Builder removeUnicodeLocaleAttribute(String attribute) {
@@ -2834,7 +2834,7 @@
         }
 
         /**
-         * Returns an instance of <code>Locale</code> created from the fields set
+         * Returns an instance of {@code Locale} created from the fields set
          * on this builder.
          *
          * <p>This applies the conversions listed in {@link Locale#forLanguageTag}
@@ -3482,7 +3482,7 @@
      * @param priorityList user's Language Priority List in which each language
      *     tag is sorted in descending order based on priority or weight
      * @param locales {@code Locale} instances used for matching
-     * @return the best matching <code>Locale</code> instance chosen based on
+     * @return the best matching {@code Locale} instance chosen based on
      *     priority or weight, or {@code null} if nothing matches.
      * @throws NullPointerException if {@code priorityList} or {@code tags} is
      *     {@code null}
--- a/src/java.base/share/classes/java/util/PropertyPermission.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/PropertyPermission.java	Wed Sep 25 22:40:41 2019 +0200
@@ -54,10 +54,10 @@
  *
  * <DL>
  *    <DT> read
- *    <DD> read permission. Allows <code>System.getProperty</code> to
+ *    <DD> read permission. Allows {@code System.getProperty} to
  *         be called.
  *    <DT> write
- *    <DD> write permission. Allows <code>System.setProperty</code> to
+ *    <DD> write permission. Allows {@code System.setProperty} to
  *         be called.
  * </DL>
  * <P>
@@ -149,9 +149,9 @@
      * @param name the name of the PropertyPermission.
      * @param actions the actions string.
      *
-     * @throws NullPointerException if <code>name</code> is <code>null</code>.
-     * @throws IllegalArgumentException if <code>name</code> is empty or if
-     * <code>actions</code> is invalid.
+     * @throws NullPointerException if {@code name} is {@code null}.
+     * @throws IllegalArgumentException if {@code name} is empty or if
+     * {@code actions} is invalid.
      */
     public PropertyPermission(String name, String actions) {
         super(name,actions);
@@ -223,7 +223,7 @@
     /**
      * Returns the hash code value for this object.
      * The hash code used is the hash code of this permissions name, that is,
-     * <code>getName().hashCode()</code>, where <code>getName</code> is
+     * {@code getName().hashCode()}, where {@code getName} is
      * from the Permission superclass.
      *
      * @return a hash code value for this object.
@@ -350,7 +350,7 @@
      * Returns the "canonical string representation" of the actions.
      * That is, this method always returns present actions in the following order:
      * read, write. For example, if this PropertyPermission object
-     * allows both write and read actions, a call to <code>getActions</code>
+     * allows both write and read actions, a call to {@code getActions}
      * will return the string "read,write".
      *
      * @return the canonical string representation of the actions.
--- a/src/java.base/share/classes/java/util/PropertyResourceBundle.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/PropertyResourceBundle.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2016, 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
@@ -51,18 +51,18 @@
 import sun.util.ResourceBundleEnumeration;
 
 /**
- * <code>PropertyResourceBundle</code> is a concrete subclass of
- * <code>ResourceBundle</code> that manages resources for a locale
+ * {@code PropertyResourceBundle} is a concrete subclass of
+ * {@code ResourceBundle} that manages resources for a locale
  * using a set of static strings from a property file. See
  * {@link ResourceBundle ResourceBundle} for more information about resource
  * bundles.
  *
  * <p>
  * Unlike other types of resource bundle, you don't subclass
- * <code>PropertyResourceBundle</code>.  Instead, you supply properties
- * files containing the resource data.  <code>ResourceBundle.getBundle</code>
+ * {@code PropertyResourceBundle}.  Instead, you supply properties
+ * files containing the resource data.  {@code ResourceBundle.getBundle}
  * will automatically look for the appropriate properties file and create a
- * <code>PropertyResourceBundle</code> that refers to it. See
+ * {@code PropertyResourceBundle} that refers to it. See
  * {@link ResourceBundle#getBundle(String, Locale, ClassLoader) ResourceBundle.getBundle}
  * for a complete description of the search and instantiation strategy.
  *
@@ -71,11 +71,11 @@
  * bundle family with the base name "MyResources".
  * The text defines the bundle "MyResources_de",
  * the German member of the bundle family.
- * This member is based on <code>PropertyResourceBundle</code>, and the text
+ * This member is based on {@code PropertyResourceBundle}, and the text
  * therefore is the content of the file "MyResources_de.properties"
  * (a related <a href="ListResourceBundle.html#sample">example</a> shows
  * how you can add bundles to this family that are implemented as subclasses
- * of <code>ListResourceBundle</code>).
+ * of {@code ListResourceBundle}).
  * The keys in this example are of the form "s1" etc. The actual
  * keys are entirely up to your choice, so long as they are the same as
  * the keys you use in your program to retrieve the objects from the bundle.
@@ -162,7 +162,7 @@
      * @param stream an InputStream that represents a property file
      *        to read from.
      * @throws IOException if an I/O error occurs
-     * @throws NullPointerException if <code>stream</code> is null
+     * @throws NullPointerException if {@code stream} is null
      * @throws IllegalArgumentException if {@code stream} contains a
      *     malformed Unicode escape sequence.
      * @throws MalformedInputException if the system property
@@ -189,7 +189,7 @@
      * @param reader a Reader that represents a property file to
      *        read from.
      * @throws IOException if an I/O error occurs
-     * @throws NullPointerException if <code>reader</code> is null
+     * @throws NullPointerException if {@code reader} is null
      * @throws IllegalArgumentException if a malformed Unicode escape sequence appears
      *     from {@code reader}.
      * @since 1.6
@@ -210,11 +210,11 @@
     }
 
     /**
-     * Returns an <code>Enumeration</code> of the keys contained in
-     * this <code>ResourceBundle</code> and its parent bundles.
+     * Returns an {@code Enumeration} of the keys contained in
+     * this {@code ResourceBundle} and its parent bundles.
      *
-     * @return an <code>Enumeration</code> of the keys contained in
-     *         this <code>ResourceBundle</code> and its parent bundles.
+     * @return an {@code Enumeration} of the keys contained in
+     *         this {@code ResourceBundle} and its parent bundles.
      * @see #keySet()
      */
     public Enumeration<String> getKeys() {
@@ -224,11 +224,11 @@
     }
 
     /**
-     * Returns a <code>Set</code> of the keys contained
-     * <em>only</em> in this <code>ResourceBundle</code>.
+     * Returns a {@code Set} of the keys contained
+     * <em>only</em> in this {@code ResourceBundle}.
      *
-     * @return a <code>Set</code> of the keys contained only in this
-     *         <code>ResourceBundle</code>
+     * @return a {@code Set} of the keys contained only in this
+     *         {@code ResourceBundle}
      * @since 1.6
      * @see #keySet()
      */
--- a/src/java.base/share/classes/java/util/ResourceBundle.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/ResourceBundle.java	Wed Sep 25 22:40:41 2019 +0200
@@ -79,7 +79,7 @@
 /**
  *
  * Resource bundles contain locale-specific objects.  When your program needs a
- * locale-specific resource, a <code>String</code> for example, your program can
+ * locale-specific resource, a {@code String} for example, your program can
  * load it from the resource bundle that is appropriate for the current user's
  * locale. In this way, you can write program code that is largely independent
  * of the user's locale isolating most, if not all, of the locale-specific
@@ -108,8 +108,8 @@
  * Each resource bundle in a family contains the same items, but the items have
  * been translated for the locale represented by that resource bundle.
  * For example, both "MyResources" and "MyResources_de" may have a
- * <code>String</code> that's used on a button for canceling operations.
- * In "MyResources" the <code>String</code> may contain "Cancel" and in
+ * {@code String} that's used on a button for canceling operations.
+ * In "MyResources" the {@code String} may contain "Cancel" and in
  * "MyResources_de" it may contain "Abbrechen".
  *
  * <P>
@@ -121,7 +121,7 @@
  *
  * <P>
  * When your program needs a locale-specific object, it loads
- * the <code>ResourceBundle</code> class using the
+ * the {@code ResourceBundle} class using the
  * {@link #getBundle(java.lang.String, java.util.Locale) getBundle}
  * method:
  * <blockquote>
@@ -134,7 +134,7 @@
  * <P>
  * Resource bundles contain key/value pairs. The keys uniquely
  * identify a locale-specific object in the bundle. Here's an
- * example of a <code>ListResourceBundle</code> that contains
+ * example of a {@code ListResourceBundle} that contains
  * two key/value pairs:
  * <blockquote>
  * <pre>
@@ -150,16 +150,16 @@
  * }
  * </pre>
  * </blockquote>
- * Keys are always <code>String</code>s.
+ * Keys are always {@code String}s.
  * In this example, the keys are "OkKey" and "CancelKey".
  * In the above example, the values
- * are also <code>String</code>s--"OK" and "Cancel"--but
+ * are also {@code String}s--"OK" and "Cancel"--but
  * they don't have to be. The values can be any type of object.
  *
  * <P>
  * You retrieve an object from resource bundle using the appropriate
  * getter method. Because "OkKey" and "CancelKey"
- * are both strings, you would use <code>getString</code> to retrieve them:
+ * are both strings, you would use {@code getString} to retrieve them:
  * <blockquote>
  * <pre>
  * button1 = new Button(myResources.getString("OkKey"));
@@ -168,13 +168,13 @@
  * </blockquote>
  * The getter methods all require the key as an argument and return
  * the object if found. If the object is not found, the getter method
- * throws a <code>MissingResourceException</code>.
+ * throws a {@code MissingResourceException}.
  *
  * <P>
- * Besides <code>getString</code>, <code>ResourceBundle</code> also provides
- * a method for getting string arrays, <code>getStringArray</code>,
- * as well as a generic <code>getObject</code> method for any other
- * type of object. When using <code>getObject</code>, you'll
+ * Besides {@code getString}, {@code ResourceBundle} also provides
+ * a method for getting string arrays, {@code getStringArray},
+ * as well as a generic {@code getObject} method for any other
+ * type of object. When using {@code getObject}, you'll
  * have to cast the result to the appropriate type. For example:
  * <blockquote>
  * <pre>
@@ -183,19 +183,19 @@
  * </blockquote>
  *
  * <P>
- * The Java Platform provides two subclasses of <code>ResourceBundle</code>,
- * <code>ListResourceBundle</code> and <code>PropertyResourceBundle</code>,
+ * The Java Platform provides two subclasses of {@code ResourceBundle},
+ * {@code ListResourceBundle} and {@code PropertyResourceBundle},
  * that provide a fairly simple way to create resources.
- * As you saw briefly in a previous example, <code>ListResourceBundle</code>
+ * As you saw briefly in a previous example, {@code ListResourceBundle}
  * manages its resource as a list of key/value pairs.
- * <code>PropertyResourceBundle</code> uses a properties file to manage
+ * {@code PropertyResourceBundle} uses a properties file to manage
  * its resources.
  *
  * <p>
- * If <code>ListResourceBundle</code> or <code>PropertyResourceBundle</code>
- * do not suit your needs, you can write your own <code>ResourceBundle</code>
- * subclass.  Your subclasses must override two methods: <code>handleGetObject</code>
- * and <code>getKeys()</code>.
+ * If {@code ListResourceBundle} or {@code PropertyResourceBundle}
+ * do not suit your needs, you can write your own {@code ResourceBundle}
+ * subclass.  Your subclasses must override two methods: {@code handleGetObject}
+ * and {@code getKeys()}.
  *
  * <p>
  * The implementation of a {@code ResourceBundle} subclass must be thread-safe
@@ -272,8 +272,8 @@
  * <h3>ResourceBundle.Control</h3>
  *
  * The {@link ResourceBundle.Control} class provides information necessary
- * to perform the bundle loading process by the <code>getBundle</code>
- * factory methods that take a <code>ResourceBundle.Control</code>
+ * to perform the bundle loading process by the {@code getBundle}
+ * factory methods that take a {@code ResourceBundle.Control}
  * instance. You can implement your own subclass in order to enable
  * non-standard resource bundle formats, change the search strategy, or
  * define caching parameters. Refer to the descriptions of the class and the
@@ -302,14 +302,14 @@
  *
  * <h2>Cache Management</h2>
  *
- * Resource bundle instances created by the <code>getBundle</code> factory
+ * Resource bundle instances created by the {@code getBundle} factory
  * methods are cached by default, and the factory methods return the same
  * resource bundle instance multiple times if it has been
- * cached. <code>getBundle</code> clients may clear the cache, manage the
+ * cached. {@code getBundle} clients may clear the cache, manage the
  * lifetime of cached resource bundle instances using time-to-live values,
  * or specify not to cache resource bundle instances. Refer to the
  * descriptions of the {@linkplain #getBundle(String, Locale, ClassLoader,
- * Control) <code>getBundle</code> factory method}, {@link
+ * Control) {@code getBundle} factory method}, {@link
  * #clearCache(ClassLoader) clearCache}, {@link
  * Control#getTimeToLive(String, Locale)
  * ResourceBundle.Control.getTimeToLive}, and {@link
@@ -318,11 +318,11 @@
  *
  * <h2>Example</h2>
  *
- * The following is a very simple example of a <code>ResourceBundle</code>
- * subclass, <code>MyResources</code>, that manages two resources (for a larger number of
- * resources you would probably use a <code>Map</code>).
+ * The following is a very simple example of a {@code ResourceBundle}
+ * subclass, {@code MyResources}, that manages two resources (for a larger number of
+ * resources you would probably use a {@code Map}).
  * Notice that you don't need to supply a value if
- * a "parent-level" <code>ResourceBundle</code> handles the same
+ * a "parent-level" {@code ResourceBundle} handles the same
  * key with the same value (as for the okKey below).
  * <blockquote>
  * <pre>
@@ -360,11 +360,11 @@
  * </pre>
  * </blockquote>
  * You do not have to restrict yourself to using a single family of
- * <code>ResourceBundle</code>s. For example, you could have a set of bundles for
- * exception messages, <code>ExceptionResources</code>
- * (<code>ExceptionResources_fr</code>, <code>ExceptionResources_de</code>, ...),
- * and one for widgets, <code>WidgetResource</code> (<code>WidgetResources_fr</code>,
- * <code>WidgetResources_de</code>, ...); breaking up the resources however you like.
+ * {@code ResourceBundle}s. For example, you could have a set of bundles for
+ * exception messages, {@code ExceptionResources}
+ * ({@code ExceptionResources_fr}, {@code ExceptionResources_de}, ...),
+ * and one for widgets, {@code WidgetResource} ({@code WidgetResources_fr},
+ * {@code WidgetResources_de}, ...); breaking up the resources however you like.
  *
  * @see ListResourceBundle
  * @see PropertyResourceBundle
@@ -512,7 +512,7 @@
      * </blockquote>
      *
      * @param key the key for the desired string
-     * @throws    NullPointerException if <code>key</code> is <code>null</code>
+     * @throws    NullPointerException if {@code key} is {@code null}
      * @throws    MissingResourceException if no object for the given key can be found
      * @throws    ClassCastException if the object found for the given key is not a string
      * @return the string for the given key
@@ -529,7 +529,7 @@
      * </blockquote>
      *
      * @param key the key for the desired string array
-     * @throws    NullPointerException if <code>key</code> is <code>null</code>
+     * @throws    NullPointerException if {@code key} is {@code null}
      * @throws    MissingResourceException if no object for the given key can be found
      * @throws    ClassCastException if the object found for the given key is not a string array
      * @return the string array for the given key
@@ -543,11 +543,11 @@
      * This method first tries to obtain the object from this resource bundle using
      * {@link #handleGetObject(java.lang.String) handleGetObject}.
      * If not successful, and the parent resource bundle is not null,
-     * it calls the parent's <code>getObject</code> method.
+     * it calls the parent's {@code getObject} method.
      * If still not successful, it throws a MissingResourceException.
      *
      * @param key the key for the desired object
-     * @throws    NullPointerException if <code>key</code> is <code>null</code>
+     * @throws    NullPointerException if {@code key} is {@code null}
      * @throws    MissingResourceException if no object for the given key can be found
      * @return the object for the given key
      */
@@ -837,12 +837,12 @@
      * Gets a resource bundle using the specified base name, the default locale,
      * and the caller module. Calling this method is equivalent to calling
      * <blockquote>
-     * <code>getBundle(baseName, Locale.getDefault(), callerModule)</code>,
+     * {@code getBundle(baseName, Locale.getDefault(), callerModule)},
      * </blockquote>
      *
      * @param baseName the base name of the resource bundle, a fully qualified class name
      * @throws    java.lang.NullPointerException
-     *     if <code>baseName</code> is <code>null</code>
+     *     if {@code baseName} is {@code null}
      * @throws    MissingResourceException
      *     if no resource bundle for the specified base name can be found
      * @return a resource bundle for the given base name and the default locale
@@ -866,11 +866,11 @@
      * getBundle(baseName, Locale.getDefault(),
      *           this.getClass().getClassLoader(), control),
      * </pre>
-     * except that <code>getClassLoader()</code> is run with the security
-     * privileges of <code>ResourceBundle</code>.  See {@link
+     * except that {@code getClassLoader()} is run with the security
+     * privileges of {@code ResourceBundle}.  See {@link
      * #getBundle(String, Locale, ClassLoader, Control) getBundle} for the
      * complete description of the resource bundle loading process with a
-     * <code>ResourceBundle.Control</code>.
+     * {@code ResourceBundle.Control}.
      *
      * @param baseName
      *        the base name of the resource bundle, a fully qualified class
@@ -880,14 +880,14 @@
      *        loading process
      * @return a resource bundle for the given base name and the default locale
      * @throws NullPointerException
-     *         if <code>baseName</code> or <code>control</code> is
-     *         <code>null</code>
+     *         if {@code baseName} or {@code control} is
+     *         {@code null}
      * @throws MissingResourceException
      *         if no resource bundle for the specified base name can be found
      * @throws IllegalArgumentException
-     *         if the given <code>control</code> doesn't perform properly
-     *         (e.g., <code>control.getCandidateLocales</code> returns null.)
-     *         Note that validation of <code>control</code> is performed as
+     *         if the given {@code control} doesn't perform properly
+     *         (e.g., {@code control.getCandidateLocales} returns null.)
+     *         Note that validation of {@code control} is performed as
      *         needed.
      * @throws UnsupportedOperationException
      *         if this method is called in a named module
@@ -908,7 +908,7 @@
      * Gets a resource bundle using the specified base name and locale,
      * and the caller module. Calling this method is equivalent to calling
      * <blockquote>
-     * <code>getBundle(baseName, locale, callerModule)</code>,
+     * {@code getBundle(baseName, locale, callerModule)},
      * </blockquote>
      *
      * @param baseName
@@ -916,7 +916,7 @@
      * @param locale
      *        the locale for which a resource bundle is desired
      * @throws    NullPointerException
-     *        if <code>baseName</code> or <code>locale</code> is <code>null</code>
+     *        if {@code baseName} or {@code locale} is {@code null}
      * @throws    MissingResourceException
      *        if no resource bundle for the specified base name can be found
      * @return a resource bundle for the given base name and locale
@@ -937,7 +937,7 @@
      * Gets a resource bundle using the specified base name and the default locale
      * on behalf of the specified module. This method is equivalent to calling
      * <blockquote>
-     * <code>getBundle(baseName, Locale.getDefault(), module)</code>
+     * {@code getBundle(baseName, Locale.getDefault(), module)}
      * </blockquote>
      *
      * @param baseName the base name of the resource bundle,
@@ -1025,11 +1025,11 @@
      * getBundle(baseName, targetLocale, this.getClass().getClassLoader(),
      *           control),
      * </pre>
-     * except that <code>getClassLoader()</code> is run with the security
-     * privileges of <code>ResourceBundle</code>.  See {@link
+     * except that {@code getClassLoader()} is run with the security
+     * privileges of {@code ResourceBundle}.  See {@link
      * #getBundle(String, Locale, ClassLoader, Control) getBundle} for the
      * complete description of the resource bundle loading process with a
-     * <code>ResourceBundle.Control</code>.
+     * {@code ResourceBundle.Control}.
      *
      * @param baseName
      *        the base name of the resource bundle, a fully qualified
@@ -1040,17 +1040,17 @@
      *        the control which gives information for the resource
      *        bundle loading process
      * @return a resource bundle for the given base name and a
-     *         <code>Locale</code> in <code>locales</code>
+     *         {@code Locale} in {@code locales}
      * @throws NullPointerException
-     *         if <code>baseName</code>, <code>locales</code> or
-     *         <code>control</code> is <code>null</code>
+     *         if {@code baseName}, {@code locales} or
+     *         {@code control} is {@code null}
      * @throws MissingResourceException
      *         if no resource bundle for the specified base name in any
-     *         of the <code>locales</code> can be found.
+     *         of the {@code locales} can be found.
      * @throws IllegalArgumentException
-     *         if the given <code>control</code> doesn't perform properly
-     *         (e.g., <code>control.getCandidateLocales</code> returns null.)
-     *         Note that validation of <code>control</code> is performed as
+     *         if the given {@code control} doesn't perform properly
+     *         (e.g., {@code control.getCandidateLocales} returns null.)
+     *         Note that validation of {@code control} is performed as
      *         needed.
      * @throws UnsupportedOperationException
      *         if this method is called in a named module
@@ -1090,7 +1090,7 @@
      * <p>
      * <b><a id="default_behavior">Resource Bundle Search and Loading Strategy</a></b>
      *
-     * <p><code>getBundle</code> uses the base name, the specified locale, and
+     * <p>{@code getBundle} uses the base name, the specified locale, and
      * the default locale (obtained from {@link java.util.Locale#getDefault()
      * Locale.getDefault}) to generate a sequence of <a
      * id="candidates"><em>candidate bundle names</em></a>.  If the specified
@@ -1140,13 +1140,13 @@
      * MyResource_en
      * </pre>
      *
-     * <blockquote><b>Note:</b> For some <code>Locale</code>s, the list of
+     * <blockquote><b>Note:</b> For some {@code Locale}s, the list of
      * candidate bundle names contains extra names, or the order of bundle names
      * is slightly modified.  See the description of the default implementation
      * of {@link Control#getCandidateLocales(String, Locale)
      * getCandidateLocales} for details.</blockquote>
      *
-     * <p><code>getBundle</code> then iterates over the candidate bundle names
+     * <p>{@code getBundle} then iterates over the candidate bundle names
      * to find the first one for which it can <em>instantiate</em> an actual
      * resource bundle. It uses the default controls' {@link Control#getFormats
      * getFormats} method, which generates two bundle names for each generated
@@ -1156,18 +1156,18 @@
      * <ul><li>First, it attempts to load a class using the generated class name.
      * If such a class can be found and loaded using the specified class
      * loader, is assignment compatible with ResourceBundle, is accessible from
-     * ResourceBundle, and can be instantiated, <code>getBundle</code> creates a
+     * ResourceBundle, and can be instantiated, {@code getBundle} creates a
      * new instance of this class and uses it as the <em>result resource
      * bundle</em>.
      *
-     * <li>Otherwise, <code>getBundle</code> attempts to locate a property
+     * <li>Otherwise, {@code getBundle} attempts to locate a property
      * resource file using the generated properties file name.  It generates a
      * path name from the candidate bundle name by replacing all "." characters
      * with "/" and appending the string ".properties".  It attempts to find a
      * "resource" with this name using {@link
      * java.lang.ClassLoader#getResource(java.lang.String)
      * ClassLoader.getResource}.  (Note that a "resource" in the sense of
-     * <code>getResource</code> has nothing to do with the contents of a
+     * {@code getResource} has nothing to do with the contents of a
      * resource bundle, it is just a container of data, such as a file.)  If it
      * finds a "resource", it attempts to create a new {@link
      * PropertyResourceBundle} instance from its contents.  If successful, this
@@ -1181,14 +1181,14 @@
      * locale and searched again, as above.
      *
      * <p>If still no result bundle is found, the base name alone is looked up. If
-     * this still fails, a <code>MissingResourceException</code> is thrown.
+     * this still fails, a {@code MissingResourceException} is thrown.
      *
      * <p><a id="parent_chain"> Once a result resource bundle has been found,
      * its <em>parent chain</em> is instantiated</a>.  If the result bundle already
      * has a parent (perhaps because it was returned from a cache) the chain is
      * complete.
      *
-     * <p>Otherwise, <code>getBundle</code> examines the remainder of the
+     * <p>Otherwise, {@code getBundle} examines the remainder of the
      * candidate locale list that was used during the pass that generated the
      * result resource bundle.  (As before, candidate bundle names where the
      * final component is an empty string are omitted.)  When it comes to the
@@ -1203,13 +1203,13 @@
      *
      * <p>Once the parent chain is complete, the bundle is returned.
      *
-     * <p><b>Note:</b> <code>getBundle</code> caches instantiated resource
+     * <p><b>Note:</b> {@code getBundle} caches instantiated resource
      * bundles and might return the same resource bundle instance multiple times.
      *
-     * <p><b>Note:</b>The <code>baseName</code> argument should be a fully
+     * <p><b>Note:</b>The {@code baseName} argument should be a fully
      * qualified class name. However, for compatibility with earlier versions,
      * Java SE Runtime Environments do not verify this, and so it is
-     * possible to access <code>PropertyResourceBundle</code>s by specifying a
+     * possible to access {@code PropertyResourceBundle}s by specifying a
      * path name (using "/") instead of a fully qualified class name (using
      * ".").
      *
@@ -1228,11 +1228,11 @@
      * </ul>
      *
      * The contents of all files are valid (that is, public non-abstract
-     * subclasses of <code>ResourceBundle</code> for the ".class" files,
+     * subclasses of {@code ResourceBundle} for the ".class" files,
      * syntactically correct ".properties" files).  The default locale is
-     * <code>Locale("en", "GB")</code>.
+     * {@code Locale("en", "GB")}.
      *
-     * <p>Calling <code>getBundle</code> with the locale arguments below will
+     * <p>Calling {@code getBundle} with the locale arguments below will
      * instantiate resource bundles as follows:
      *
      * <table class="striped">
@@ -1265,7 +1265,7 @@
      * @param loader the class loader from which to load the resource bundle
      * @return a resource bundle for the given base name and locale
      * @throws    java.lang.NullPointerException
-     *        if <code>baseName</code>, <code>locale</code>, or <code>loader</code> is <code>null</code>
+     *        if {@code baseName}, {@code locale}, or {@code loader} is {@code null}
      * @throws    MissingResourceException
      *        if no resource bundle for the specified base name can be found
      * @since 1.2
@@ -1289,14 +1289,14 @@
      * locale, class loader and control. Unlike the {@link
      * #getBundle(String, Locale, ClassLoader) getBundle}
      * factory methods with no {@code control} argument, the given
-     * <code>control</code> specifies how to locate and instantiate resource
+     * {@code control} specifies how to locate and instantiate resource
      * bundles. Conceptually, the bundle loading process with the given
-     * <code>control</code> is performed in the following steps.
+     * {@code control} is performed in the following steps.
      *
      * <ol>
      * <li>This factory method looks up the resource bundle in the cache for
-     * the specified <code>baseName</code>, <code>targetLocale</code> and
-     * <code>loader</code>.  If the requested resource bundle instance is
+     * the specified {@code baseName}, {@code targetLocale} and
+     * {@code loader}.  If the requested resource bundle instance is
      * found in the cache and the time-to-live periods of the instance and
      * all of its parent instances have not expired, the instance is returned
      * to the caller. Otherwise, this factory method proceeds with the
@@ -1305,71 +1305,71 @@
      * <li>The {@link ResourceBundle.Control#getFormats(String)
      * control.getFormats} method is called to get resource bundle formats
      * to produce bundle or resource names. The strings
-     * <code>"java.class"</code> and <code>"java.properties"</code>
+     * {@code "java.class"} and {@code "java.properties"}
      * designate class-based and {@linkplain PropertyResourceBundle
      * property}-based resource bundles, respectively. Other strings
-     * starting with <code>"java."</code> are reserved for future extensions
+     * starting with {@code "java."} are reserved for future extensions
      * and must not be used for application-defined formats. Other strings
      * designate application-defined formats.</li>
      *
      * <li>The {@link ResourceBundle.Control#getCandidateLocales(String,
      * Locale) control.getCandidateLocales} method is called with the target
-     * locale to get a list of <em>candidate <code>Locale</code>s</em> for
+     * locale to get a list of <em>candidate {@code Locale}s</em> for
      * which resource bundles are searched.</li>
      *
      * <li>The {@link ResourceBundle.Control#newBundle(String, Locale,
      * String, ClassLoader, boolean) control.newBundle} method is called to
-     * instantiate a <code>ResourceBundle</code> for the base bundle name, a
+     * instantiate a {@code ResourceBundle} for the base bundle name, a
      * candidate locale, and a format. (Refer to the note on the cache
      * lookup below.) This step is iterated over all combinations of the
-     * candidate locales and formats until the <code>newBundle</code> method
-     * returns a <code>ResourceBundle</code> instance or the iteration has
+     * candidate locales and formats until the {@code newBundle} method
+     * returns a {@code ResourceBundle} instance or the iteration has
      * used up all the combinations. For example, if the candidate locales
-     * are <code>Locale("de", "DE")</code>, <code>Locale("de")</code> and
-     * <code>Locale("")</code> and the formats are <code>"java.class"</code>
-     * and <code>"java.properties"</code>, then the following is the
+     * are {@code Locale("de", "DE")}, {@code Locale("de")} and
+     * {@code Locale("")} and the formats are {@code "java.class"}
+     * and {@code "java.properties"}, then the following is the
      * sequence of locale-format combinations to be used to call
-     * <code>control.newBundle</code>.
+     * {@code control.newBundle}.
      *
      * <table class=striped style="width: 50%; text-align: left; margin-left: 40px;">
      * <caption style="display:none">locale-format combinations for newBundle</caption>
      * <thead>
      * <tr>
      * <th scope="col">Index</th>
-     * <th scope="col"><code>Locale</code></th>
-     * <th scope="col"><code>format</code></th>
+     * <th scope="col">{@code Locale}</th>
+     * <th scope="col">{@code format}</th>
      * </tr>
      * </thead>
      * <tbody>
      * <tr>
      * <th scope="row">1</th>
-     * <td><code>Locale("de", "DE")</code></td>
-     * <td><code>java.class</code></td>
+     * <td>{@code Locale("de", "DE")}</td>
+     * <td>{@code java.class}</td>
      * </tr>
      * <tr>
      * <th scope="row">2</th>
-     * <td><code>Locale("de", "DE")</code></td>
-     * <td><code>java.properties</code></td>
+     * <td>{@code Locale("de", "DE")}</td>
+     * <td>{@code java.properties}</td>
      * </tr>
      * <tr>
      * <th scope="row">3</th>
-     * <td><code>Locale("de")</code></td>
-     * <td><code>java.class</code></td>
+     * <td>{@code Locale("de")}</td>
+     * <td>{@code java.class}</td>
      * </tr>
      * <tr>
      * <th scope="row">4</th>
-     * <td><code>Locale("de")</code></td>
-     * <td><code>java.properties</code></td>
+     * <td>{@code Locale("de")}</td>
+     * <td>{@code java.properties}</td>
      * </tr>
      * <tr>
      * <th scope="row">5</th>
-     * <td><code>Locale("")</code></td>
-     * <td><code>java.class</code></td>
+     * <td>{@code Locale("")}</td>
+     * <td>{@code java.class}</td>
      * </tr>
      * <tr>
      * <th scope="row">6</th>
-     * <td><code>Locale("")</code></td>
-     * <td><code>java.properties</code></td>
+     * <td>{@code Locale("")}</td>
+     * <td>{@code java.properties}</td>
      * </tr>
      * </tbody>
      * </table>
@@ -1377,8 +1377,8 @@
      *
      * <li>If the previous step has found no resource bundle, proceed to
      * Step 6. If a bundle has been found that is a base bundle (a bundle
-     * for <code>Locale("")</code>), and the candidate locale list only contained
-     * <code>Locale("")</code>, return the bundle to the caller. If a bundle
+     * for {@code Locale("")}), and the candidate locale list only contained
+     * {@code Locale("")}, return the bundle to the caller. If a bundle
      * has been found that is a base bundle, but the candidate locale list
      * contained locales other than Locale(""), put the bundle on hold and
      * proceed to Step 6. If a bundle has been found that is not a base
@@ -1410,65 +1410,65 @@
      * String, ClassLoader, ResourceBundle, long) control.needsReload}
      * method to determine whether the resource bundle needs to be reloaded.
      * If reloading is required, the factory method calls
-     * <code>control.newBundle</code> to reload the resource bundle.  If
-     * <code>control.newBundle</code> returns <code>null</code>, the factory
+     * {@code control.newBundle} to reload the resource bundle.  If
+     * {@code control.newBundle} returns {@code null}, the factory
      * method puts a dummy resource bundle in the cache as a mark of
      * nonexistent resource bundles in order to avoid lookup overhead for
      * subsequent requests. Such dummy resource bundles are under the same
-     * expiration control as specified by <code>control</code>.
+     * expiration control as specified by {@code control}.
      *
      * <p>All resource bundles loaded are cached by default. Refer to
      * {@link Control#getTimeToLive(String,Locale)
      * control.getTimeToLive} for details.
      *
      * <p>The following is an example of the bundle loading process with the
-     * default <code>ResourceBundle.Control</code> implementation.
+     * default {@code ResourceBundle.Control} implementation.
      *
      * <p>Conditions:
      * <ul>
-     * <li>Base bundle name: <code>foo.bar.Messages</code>
-     * <li>Requested <code>Locale</code>: {@link Locale#ITALY}</li>
-     * <li>Default <code>Locale</code>: {@link Locale#FRENCH}</li>
+     * <li>Base bundle name: {@code foo.bar.Messages}
+     * <li>Requested {@code Locale}: {@link Locale#ITALY}</li>
+     * <li>Default {@code Locale}: {@link Locale#FRENCH}</li>
      * <li>Available resource bundles:
-     * <code>foo/bar/Messages_fr.properties</code> and
-     * <code>foo/bar/Messages.properties</code></li>
+     * {@code foo/bar/Messages_fr.properties} and
+     * {@code foo/bar/Messages.properties}</li>
      * </ul>
      *
-     * <p>First, <code>getBundle</code> tries loading a resource bundle in
+     * <p>First, {@code getBundle} tries loading a resource bundle in
      * the following sequence.
      *
      * <ul>
-     * <li>class <code>foo.bar.Messages_it_IT</code>
-     * <li>file <code>foo/bar/Messages_it_IT.properties</code>
-     * <li>class <code>foo.bar.Messages_it</code></li>
-     * <li>file <code>foo/bar/Messages_it.properties</code></li>
-     * <li>class <code>foo.bar.Messages</code></li>
-     * <li>file <code>foo/bar/Messages.properties</code></li>
+     * <li>class {@code foo.bar.Messages_it_IT}
+     * <li>file {@code foo/bar/Messages_it_IT.properties}
+     * <li>class {@code foo.bar.Messages_it}</li>
+     * <li>file {@code foo/bar/Messages_it.properties}</li>
+     * <li>class {@code foo.bar.Messages}</li>
+     * <li>file {@code foo/bar/Messages.properties}</li>
      * </ul>
      *
-     * <p>At this point, <code>getBundle</code> finds
-     * <code>foo/bar/Messages.properties</code>, which is put on hold
-     * because it's the base bundle.  <code>getBundle</code> calls {@link
+     * <p>At this point, {@code getBundle} finds
+     * {@code foo/bar/Messages.properties}, which is put on hold
+     * because it's the base bundle.  {@code getBundle} calls {@link
      * Control#getFallbackLocale(String, Locale)
      * control.getFallbackLocale("foo.bar.Messages", Locale.ITALY)} which
-     * returns <code>Locale.FRENCH</code>. Next, <code>getBundle</code>
+     * returns {@code Locale.FRENCH}. Next, {@code getBundle}
      * tries loading a bundle in the following sequence.
      *
      * <ul>
-     * <li>class <code>foo.bar.Messages_fr</code></li>
-     * <li>file <code>foo/bar/Messages_fr.properties</code></li>
-     * <li>class <code>foo.bar.Messages</code></li>
-     * <li>file <code>foo/bar/Messages.properties</code></li>
+     * <li>class {@code foo.bar.Messages_fr}</li>
+     * <li>file {@code foo/bar/Messages_fr.properties}</li>
+     * <li>class {@code foo.bar.Messages}</li>
+     * <li>file {@code foo/bar/Messages.properties}</li>
      * </ul>
      *
-     * <p><code>getBundle</code> finds
-     * <code>foo/bar/Messages_fr.properties</code> and creates a
-     * <code>ResourceBundle</code> instance. Then, <code>getBundle</code>
+     * <p>{@code getBundle} finds
+     * {@code foo/bar/Messages_fr.properties} and creates a
+     * {@code ResourceBundle} instance. Then, {@code getBundle}
      * sets up its parent chain from the list of the candidate locales.  Only
-     * <code>foo/bar/Messages.properties</code> is found in the list and
-     * <code>getBundle</code> creates a <code>ResourceBundle</code> instance
+     * {@code foo/bar/Messages.properties} is found in the list and
+     * {@code getBundle} creates a {@code ResourceBundle} instance
      * that becomes the parent of the instance for
-     * <code>foo/bar/Messages_fr.properties</code>.
+     * {@code foo/bar/Messages_fr.properties}.
      *
      * @param baseName
      *        the base name of the resource bundle, a fully qualified
@@ -1482,15 +1482,15 @@
      *        bundle loading process
      * @return a resource bundle for the given base name and locale
      * @throws NullPointerException
-     *         if <code>baseName</code>, <code>targetLocale</code>,
-     *         <code>loader</code>, or <code>control</code> is
-     *         <code>null</code>
+     *         if {@code baseName}, {@code targetLocale},
+     *         {@code loader}, or {@code control} is
+     *         {@code null}
      * @throws MissingResourceException
      *         if no resource bundle for the specified base name can be found
      * @throws IllegalArgumentException
-     *         if the given <code>control</code> doesn't perform properly
-     *         (e.g., <code>control.getCandidateLocales</code> returns null.)
-     *         Note that validation of <code>control</code> is performed as
+     *         if the given {@code control} doesn't perform properly
+     *         (e.g., {@code control.getCandidateLocales} returns null.)
+     *         Note that validation of {@code control} is performed as
      *         needed.
      * @throws UnsupportedOperationException
      *         if this method is called in a named module
@@ -1700,7 +1700,7 @@
     }
 
     /**
-     * Checks if the given <code>List</code> is not null, not empty,
+     * Checks if the given {@code List} is not null, not empty,
      * not having null in its elements.
      */
     private static boolean checkList(List<?> a) {
@@ -2066,7 +2066,7 @@
      * @param cacheKey the key to look up the cache
      * @param control the Control to be used for the expiration control
      * @return the cached bundle, or null if the bundle is not found in the
-     * cache or its parent has expired. <code>bundle.expire</code> is true
+     * cache or its parent has expired. {@code bundle.expire} is true
      * upon return if the bundle in the cache has expired.
      */
     private static ResourceBundle findBundleInCache(CacheKey cacheKey,
@@ -2250,7 +2250,7 @@
      * by the given class loader.
      *
      * @param loader the class loader
-     * @throws    NullPointerException if <code>loader</code> is null
+     * @throws    NullPointerException if {@code loader} is null
      * @since 1.6
      * @see ResourceBundle.Control#getTimeToLive(String,Locale)
      */
@@ -2271,7 +2271,7 @@
      * object for the given key.
      *
      * @param key the key for the desired object
-     * @throws    NullPointerException if <code>key</code> is <code>null</code>
+     * @throws    NullPointerException if {@code key} is {@code null}
      * @return the object for the given key, or null
      */
     protected abstract Object handleGetObject(String key);
@@ -2279,22 +2279,22 @@
     /**
      * Returns an enumeration of the keys.
      *
-     * @return an <code>Enumeration</code> of the keys contained in
-     *         this <code>ResourceBundle</code> and its parent bundles.
+     * @return an {@code Enumeration} of the keys contained in
+     *         this {@code ResourceBundle} and its parent bundles.
      */
     public abstract Enumeration<String> getKeys();
 
     /**
-     * Determines whether the given <code>key</code> is contained in
-     * this <code>ResourceBundle</code> or its parent bundles.
+     * Determines whether the given {@code key} is contained in
+     * this {@code ResourceBundle} or its parent bundles.
      *
      * @param key
-     *        the resource <code>key</code>
-     * @return <code>true</code> if the given <code>key</code> is
-     *        contained in this <code>ResourceBundle</code> or its
-     *        parent bundles; <code>false</code> otherwise.
+     *        the resource {@code key}
+     * @return {@code true} if the given {@code key} is
+     *        contained in this {@code ResourceBundle} or its
+     *        parent bundles; {@code false} otherwise.
      * @throws    NullPointerException
-     *         if <code>key</code> is <code>null</code>
+     *         if {@code key} is {@code null}
      * @since 1.6
      */
     public boolean containsKey(String key) {
@@ -2310,11 +2310,11 @@
     }
 
     /**
-     * Returns a <code>Set</code> of all keys contained in this
-     * <code>ResourceBundle</code> and its parent bundles.
+     * Returns a {@code Set} of all keys contained in this
+     * {@code ResourceBundle} and its parent bundles.
      *
-     * @return a <code>Set</code> of all keys contained in this
-     *         <code>ResourceBundle</code> and its parent bundles.
+     * @return a {@code Set} of all keys contained in this
+     *         {@code ResourceBundle} and its parent bundles.
      * @since 1.6
      */
     public Set<String> keySet() {
@@ -2326,20 +2326,20 @@
     }
 
     /**
-     * Returns a <code>Set</code> of the keys contained <em>only</em>
-     * in this <code>ResourceBundle</code>.
+     * Returns a {@code Set} of the keys contained <em>only</em>
+     * in this {@code ResourceBundle}.
      *
-     * <p>The default implementation returns a <code>Set</code> of the
+     * <p>The default implementation returns a {@code Set} of the
      * keys returned by the {@link #getKeys() getKeys} method except
      * for the ones for which the {@link #handleGetObject(String)
-     * handleGetObject} method returns <code>null</code>. Once the
-     * <code>Set</code> has been created, the value is kept in this
-     * <code>ResourceBundle</code> in order to avoid producing the
-     * same <code>Set</code> in subsequent calls. Subclasses can
+     * handleGetObject} method returns {@code null}. Once the
+     * {@code Set} has been created, the value is kept in this
+     * {@code ResourceBundle} in order to avoid producing the
+     * same {@code Set} in subsequent calls. Subclasses can
      * override this method for faster handling.
      *
-     * @return a <code>Set</code> of the keys contained only in this
-     *        <code>ResourceBundle</code>
+     * @return a {@code Set} of the keys contained only in this
+     *        {@code ResourceBundle}
      * @since 1.6
      */
     protected Set<String> handleKeySet() {
@@ -2364,11 +2364,11 @@
 
 
     /**
-     * <code>ResourceBundle.Control</code> defines a set of callback methods
+     * {@code ResourceBundle.Control} defines a set of callback methods
      * that are invoked by the {@link ResourceBundle#getBundle(String,
      * Locale, ClassLoader, Control) ResourceBundle.getBundle} factory
      * methods during the bundle loading process. In other words, a
-     * <code>ResourceBundle.Control</code> collaborates with the factory
+     * {@code ResourceBundle.Control} collaborates with the factory
      * methods for loading resource bundles. The default implementation of
      * the callback methods provides the information necessary for the
      * factory methods to perform the <a
@@ -2386,45 +2386,45 @@
      * #toBundleName(String, Locale) toBundleName} and {@link
      * #toResourceName(String, String) toResourceName} methods are defined
      * primarily for convenience in implementing the callback
-     * methods. However, the <code>toBundleName</code> method could be
+     * methods. However, the {@code toBundleName} method could be
      * overridden to provide different conventions in the organization and
-     * packaging of localized resources.  The <code>toResourceName</code>
-     * method is <code>final</code> to avoid use of wrong resource and class
+     * packaging of localized resources.  The {@code toResourceName}
+     * method is {@code final} to avoid use of wrong resource and class
      * name separators.
      *
      * <p>Two factory methods, {@link #getControl(List)} and {@link
      * #getNoFallbackControl(List)}, provide
-     * <code>ResourceBundle.Control</code> instances that implement common
+     * {@code ResourceBundle.Control} instances that implement common
      * variations of the default bundle loading process.
      *
      * <p>The formats returned by the {@link Control#getFormats(String)
      * getFormats} method and candidate locales returned by the {@link
      * ResourceBundle.Control#getCandidateLocales(String, Locale)
      * getCandidateLocales} method must be consistent in all
-     * <code>ResourceBundle.getBundle</code> invocations for the same base
-     * bundle. Otherwise, the <code>ResourceBundle.getBundle</code> methods
+     * {@code ResourceBundle.getBundle} invocations for the same base
+     * bundle. Otherwise, the {@code ResourceBundle.getBundle} methods
      * may return unintended bundles. For example, if only
-     * <code>"java.class"</code> is returned by the <code>getFormats</code>
-     * method for the first call to <code>ResourceBundle.getBundle</code>
-     * and only <code>"java.properties"</code> for the second call, then the
+     * {@code "java.class"} is returned by the {@code getFormats}
+     * method for the first call to {@code ResourceBundle.getBundle}
+     * and only {@code "java.properties"} for the second call, then the
      * second call will return the class-based one that has been cached
      * during the first call.
      *
-     * <p>A <code>ResourceBundle.Control</code> instance must be thread-safe
+     * <p>A {@code ResourceBundle.Control} instance must be thread-safe
      * if it's simultaneously used by multiple threads.
-     * <code>ResourceBundle.getBundle</code> does not synchronize to call
-     * the <code>ResourceBundle.Control</code> methods. The default
+     * {@code ResourceBundle.getBundle} does not synchronize to call
+     * the {@code ResourceBundle.Control} methods. The default
      * implementations of the methods are thread-safe.
      *
-     * <p>Applications can specify <code>ResourceBundle.Control</code>
-     * instances returned by the <code>getControl</code> factory methods or
-     * created from a subclass of <code>ResourceBundle.Control</code> to
+     * <p>Applications can specify {@code ResourceBundle.Control}
+     * instances returned by the {@code getControl} factory methods or
+     * created from a subclass of {@code ResourceBundle.Control} to
      * customize the bundle loading process. The following are examples of
      * changing the default bundle loading process.
      *
      * <p><b>Example 1</b>
      *
-     * <p>The following code lets <code>ResourceBundle.getBundle</code> look
+     * <p>The following code lets {@code ResourceBundle.getBundle} look
      * up only properties-based resources.
      *
      * <pre>
@@ -2438,12 +2438,12 @@
      *
      * Given the resource bundles in the <a
      * href="./ResourceBundle.html#default_behavior_example">example</a> in
-     * the <code>ResourceBundle.getBundle</code> description, this
-     * <code>ResourceBundle.getBundle</code> call loads
-     * <code>MyResources_fr_CH.properties</code> whose parent is
-     * <code>MyResources_fr.properties</code> whose parent is
-     * <code>MyResources.properties</code>. (<code>MyResources_fr_CH.properties</code>
-     * is not hidden, but <code>MyResources_fr_CH.class</code> is.)
+     * the {@code ResourceBundle.getBundle} description, this
+     * {@code ResourceBundle.getBundle} call loads
+     * {@code MyResources_fr_CH.properties} whose parent is
+     * {@code MyResources_fr.properties} whose parent is
+     * {@code MyResources.properties}. ({@code MyResources_fr_CH.properties}
+     * is not hidden, but {@code MyResources_fr_CH.class} is.)
      *
      * <p><b>Example 2</b>
      *
@@ -2529,9 +2529,9 @@
      */
     public static class Control {
         /**
-         * The default format <code>List</code>, which contains the strings
-         * <code>"java.class"</code> and <code>"java.properties"</code>, in
-         * this order. This <code>List</code> is unmodifiable.
+         * The default format {@code List}, which contains the strings
+         * {@code "java.class"} and {@code "java.properties"}, in
+         * this order. This {@code List} is unmodifiable.
          *
          * @see #getFormats(String)
          */
@@ -2539,16 +2539,16 @@
             = List.of("java.class", "java.properties");
 
         /**
-         * The class-only format <code>List</code> containing
-         * <code>"java.class"</code>. This <code>List</code> is unmodifiable.
+         * The class-only format {@code List} containing
+         * {@code "java.class"}. This {@code List} is unmodifiable.
          *
          * @see #getFormats(String)
          */
         public static final List<String> FORMAT_CLASS = List.of("java.class");
 
         /**
-         * The properties-only format <code>List</code> containing
-         * <code>"java.properties"</code>. This <code>List</code> is unmodifiable.
+         * The properties-only format {@code List} containing
+         * {@code "java.properties"}. This {@code List} is unmodifiable.
          *
          * @see #getFormats(String)
          */
@@ -2581,27 +2581,27 @@
         }
 
         /**
-         * Returns a <code>ResourceBundle.Control</code> in which the {@link
+         * Returns a {@code ResourceBundle.Control} in which the {@link
          * #getFormats(String) getFormats} method returns the specified
-         * <code>formats</code>. The <code>formats</code> must be equal to
+         * {@code formats}. The {@code formats} must be equal to
          * one of {@link Control#FORMAT_PROPERTIES}, {@link
          * Control#FORMAT_CLASS} or {@link
-         * Control#FORMAT_DEFAULT}. <code>ResourceBundle.Control</code>
+         * Control#FORMAT_DEFAULT}. {@code ResourceBundle.Control}
          * instances returned by this method are singletons and thread-safe.
          *
          * <p>Specifying {@link Control#FORMAT_DEFAULT} is equivalent to
-         * instantiating the <code>ResourceBundle.Control</code> class,
+         * instantiating the {@code ResourceBundle.Control} class,
          * except that this method returns a singleton.
          *
          * @param formats
          *        the formats to be returned by the
-         *        <code>ResourceBundle.Control.getFormats</code> method
-         * @return a <code>ResourceBundle.Control</code> supporting the
-         *        specified <code>formats</code>
+         *        {@code ResourceBundle.Control.getFormats} method
+         * @return a {@code ResourceBundle.Control} supporting the
+         *        specified {@code formats}
          * @throws    NullPointerException
-         *        if <code>formats</code> is <code>null</code>
+         *        if {@code formats} is {@code null}
          * @throws    IllegalArgumentException
-         *        if <code>formats</code> is unknown
+         *        if {@code formats} is unknown
          */
         public static final Control getControl(List<String> formats) {
             if (formats.equals(Control.FORMAT_PROPERTIES)) {
@@ -2617,26 +2617,26 @@
         }
 
         /**
-         * Returns a <code>ResourceBundle.Control</code> in which the {@link
+         * Returns a {@code ResourceBundle.Control} in which the {@link
          * #getFormats(String) getFormats} method returns the specified
-         * <code>formats</code> and the {@link
+         * {@code formats} and the {@link
          * Control#getFallbackLocale(String, Locale) getFallbackLocale}
-         * method returns <code>null</code>. The <code>formats</code> must
+         * method returns {@code null}. The {@code formats} must
          * be equal to one of {@link Control#FORMAT_PROPERTIES}, {@link
          * Control#FORMAT_CLASS} or {@link Control#FORMAT_DEFAULT}.
-         * <code>ResourceBundle.Control</code> instances returned by this
+         * {@code ResourceBundle.Control} instances returned by this
          * method are singletons and thread-safe.
          *
          * @param formats
          *        the formats to be returned by the
-         *        <code>ResourceBundle.Control.getFormats</code> method
-         * @return a <code>ResourceBundle.Control</code> supporting the
-         *        specified <code>formats</code> with no fallback
-         *        <code>Locale</code> support
+         *        {@code ResourceBundle.Control.getFormats} method
+         * @return a {@code ResourceBundle.Control} supporting the
+         *        specified {@code formats} with no fallback
+         *        {@code Locale} support
          * @throws    NullPointerException
-         *        if <code>formats</code> is <code>null</code>
+         *        if {@code formats} is {@code null}
          * @throws    IllegalArgumentException
-         *        if <code>formats</code> is unknown
+         *        if {@code formats} is unknown
          */
         public static final Control getNoFallbackControl(List<String> formats) {
             if (formats.equals(Control.FORMAT_DEFAULT)) {
@@ -2652,35 +2652,35 @@
         }
 
         /**
-         * Returns a <code>List</code> of <code>String</code>s containing
+         * Returns a {@code List} of {@code String}s containing
          * formats to be used to load resource bundles for the given
-         * <code>baseName</code>. The <code>ResourceBundle.getBundle</code>
+         * {@code baseName}. The {@code ResourceBundle.getBundle}
          * factory method tries to load resource bundles with formats in the
          * order specified by the list. The list returned by this method
-         * must have at least one <code>String</code>. The predefined
-         * formats are <code>"java.class"</code> for class-based resource
-         * bundles and <code>"java.properties"</code> for {@linkplain
+         * must have at least one {@code String}. The predefined
+         * formats are {@code "java.class"} for class-based resource
+         * bundles and {@code "java.properties"} for {@linkplain
          * PropertyResourceBundle properties-based} ones. Strings starting
-         * with <code>"java."</code> are reserved for future extensions and
+         * with {@code "java."} are reserved for future extensions and
          * must not be used by application-defined formats.
          *
          * <p>It is not a requirement to return an immutable (unmodifiable)
-         * <code>List</code>.  However, the returned <code>List</code> must
+         * {@code List}.  However, the returned {@code List} must
          * not be mutated after it has been returned by
-         * <code>getFormats</code>.
+         * {@code getFormats}.
          *
          * <p>The default implementation returns {@link #FORMAT_DEFAULT} so
-         * that the <code>ResourceBundle.getBundle</code> factory method
+         * that the {@code ResourceBundle.getBundle} factory method
          * looks up first class-based resource bundles, then
          * properties-based ones.
          *
          * @param baseName
          *        the base name of the resource bundle, a fully qualified class
          *        name
-         * @return a <code>List</code> of <code>String</code>s containing
+         * @return a {@code List} of {@code String}s containing
          *        formats for loading resource bundles.
          * @throws    NullPointerException
-         *        if <code>baseName</code> is null
+         *        if {@code baseName} is null
          * @see #FORMAT_DEFAULT
          * @see #FORMAT_CLASS
          * @see #FORMAT_PROPERTIES
@@ -2693,11 +2693,11 @@
         }
 
         /**
-         * Returns a <code>List</code> of <code>Locale</code>s as candidate
-         * locales for <code>baseName</code> and <code>locale</code>. This
-         * method is called by the <code>ResourceBundle.getBundle</code>
+         * Returns a {@code List} of {@code Locale}s as candidate
+         * locales for {@code baseName} and {@code locale}. This
+         * method is called by the {@code ResourceBundle.getBundle}
          * factory method each time the factory method tries finding a
-         * resource bundle for a target <code>Locale</code>.
+         * resource bundle for a target {@code Locale}.
          *
          * <p>The sequence of the candidate locales also corresponds to the
          * runtime resource lookup path (also known as the <I>parent
@@ -2707,42 +2707,42 @@
          * must be a {@linkplain Locale#ROOT root locale} if it is desired to
          * have the base bundle as the terminal of the parent chain.
          *
-         * <p>If the given locale is equal to <code>Locale.ROOT</code> (the
-         * root locale), a <code>List</code> containing only the root
-         * <code>Locale</code> must be returned. In this case, the
-         * <code>ResourceBundle.getBundle</code> factory method loads only
+         * <p>If the given locale is equal to {@code Locale.ROOT} (the
+         * root locale), a {@code List} containing only the root
+         * {@code Locale} must be returned. In this case, the
+         * {@code ResourceBundle.getBundle} factory method loads only
          * the base bundle as the resulting resource bundle.
          *
          * <p>It is not a requirement to return an immutable (unmodifiable)
-         * <code>List</code>. However, the returned <code>List</code> must not
+         * {@code List}. However, the returned {@code List} must not
          * be mutated after it has been returned by
-         * <code>getCandidateLocales</code>.
+         * {@code getCandidateLocales}.
          *
-         * <p>The default implementation returns a <code>List</code> containing
-         * <code>Locale</code>s using the rules described below.  In the
+         * <p>The default implementation returns a {@code List} containing
+         * {@code Locale}s using the rules described below.  In the
          * description below, <em>L</em>, <em>S</em>, <em>C</em> and <em>V</em>
          * respectively represent non-empty language, script, country, and
          * variant.  For example, [<em>L</em>, <em>C</em>] represents a
-         * <code>Locale</code> that has non-empty values only for language and
+         * {@code Locale} that has non-empty values only for language and
          * country.  The form <em>L</em>("xx") represents the (non-empty)
-         * language value is "xx".  For all cases, <code>Locale</code>s whose
+         * language value is "xx".  For all cases, {@code Locale}s whose
          * final component values are empty strings are omitted.
          *
-         * <ol><li>For an input <code>Locale</code> with an empty script value,
-         * append candidate <code>Locale</code>s by omitting the final component
+         * <ol><li>For an input {@code Locale} with an empty script value,
+         * append candidate {@code Locale}s by omitting the final component
          * one by one as below:
          *
          * <ul>
          * <li> [<em>L</em>, <em>C</em>, <em>V</em>] </li>
          * <li> [<em>L</em>, <em>C</em>] </li>
          * <li> [<em>L</em>] </li>
-         * <li> <code>Locale.ROOT</code> </li>
+         * <li> {@code Locale.ROOT} </li>
          * </ul></li>
          *
-         * <li>For an input <code>Locale</code> with a non-empty script value,
-         * append candidate <code>Locale</code>s by omitting the final component
+         * <li>For an input {@code Locale} with a non-empty script value,
+         * append candidate {@code Locale}s by omitting the final component
          * up to language, then append candidates generated from the
-         * <code>Locale</code> with country and variant restored:
+         * {@code Locale} with country and variant restored:
          *
          * <ul>
          * <li> [<em>L</em>, <em>S</em>, <em>C</em>, <em>V</em>]</li>
@@ -2751,13 +2751,13 @@
          * <li> [<em>L</em>, <em>C</em>, <em>V</em>]</li>
          * <li> [<em>L</em>, <em>C</em>]</li>
          * <li> [<em>L</em>]</li>
-         * <li> <code>Locale.ROOT</code></li>
+         * <li> {@code Locale.ROOT}</li>
          * </ul></li>
          *
-         * <li>For an input <code>Locale</code> with a variant value consisting
+         * <li>For an input {@code Locale} with a variant value consisting
          * of multiple subtags separated by underscore, generate candidate
-         * <code>Locale</code>s by omitting the variant subtags one by one, then
-         * insert them after every occurrence of <code> Locale</code>s with the
+         * {@code Locale}s by omitting the variant subtags one by one, then
+         * insert them after every occurrence of {@code  Locale}s with the
          * full variant value in the original list.  For example, if
          * the variant consists of two subtags <em>V1</em> and <em>V2</em>:
          *
@@ -2770,10 +2770,10 @@
          * <li> [<em>L</em>, <em>C</em>, <em>V1</em>]</li>
          * <li> [<em>L</em>, <em>C</em>]</li>
          * <li> [<em>L</em>]</li>
-         * <li> <code>Locale.ROOT</code></li>
+         * <li> {@code Locale.ROOT}</li>
          * </ul></li>
          *
-         * <li>Special cases for Chinese.  When an input <code>Locale</code> has the
+         * <li>Special cases for Chinese.  When an input {@code Locale} has the
          * language "zh" (Chinese) and an empty script value, either "Hans" (Simplified) or
          * "Hant" (Traditional) might be supplied, depending on the country.
          * When the country is "CN" (China) or "SG" (Singapore), "Hans" is supplied.
@@ -2786,20 +2786,20 @@
          * <li> [<em>L</em>("zh"), <em>S</em>("Hans")]</li>
          * <li> [<em>L</em>("zh"), <em>C</em>("CN")]</li>
          * <li> [<em>L</em>("zh")]</li>
-         * <li> <code>Locale.ROOT</code></li>
+         * <li> {@code Locale.ROOT}</li>
          * </ul>
          *
-         * For <code>Locale("zh", "TW")</code>, the candidate list will be:
+         * For {@code Locale("zh", "TW")}, the candidate list will be:
          * <ul>
          * <li> [<em>L</em>("zh"), <em>S</em>("Hant"), <em>C</em>("TW")]</li>
          * <li> [<em>L</em>("zh"), <em>S</em>("Hant")]</li>
          * <li> [<em>L</em>("zh"), <em>C</em>("TW")]</li>
          * <li> [<em>L</em>("zh")]</li>
-         * <li> <code>Locale.ROOT</code></li>
+         * <li> {@code Locale.ROOT}</li>
          * </ul></li>
          *
-         * <li>Special cases for Norwegian.  Both <code>Locale("no", "NO",
-         * "NY")</code> and <code>Locale("nn", "NO")</code> represent Norwegian
+         * <li>Special cases for Norwegian.  Both {@code Locale("no", "NO",
+         * "NY")} and {@code Locale("nn", "NO")} represent Norwegian
          * Nynorsk.  When a locale's language is "nn", the standard candidate
          * list is generated up to [<em>L</em>("nn")], and then the following
          * candidates are added:
@@ -2807,20 +2807,20 @@
          * <ul><li> [<em>L</em>("no"), <em>C</em>("NO"), <em>V</em>("NY")]</li>
          * <li> [<em>L</em>("no"), <em>C</em>("NO")]</li>
          * <li> [<em>L</em>("no")]</li>
-         * <li> <code>Locale.ROOT</code></li>
+         * <li> {@code Locale.ROOT}</li>
          * </ul>
          *
-         * If the locale is exactly <code>Locale("no", "NO", "NY")</code>, it is first
-         * converted to <code>Locale("nn", "NO")</code> and then the above procedure is
+         * If the locale is exactly {@code Locale("no", "NO", "NY")}, it is first
+         * converted to {@code Locale("nn", "NO")} and then the above procedure is
          * followed.
          *
          * <p>Also, Java treats the language "no" as a synonym of Norwegian
-         * Bokm&#xE5;l "nb".  Except for the single case <code>Locale("no",
-         * "NO", "NY")</code> (handled above), when an input <code>Locale</code>
-         * has language "no" or "nb", candidate <code>Locale</code>s with
+         * Bokm&#xE5;l "nb".  Except for the single case {@code Locale("no",
+         * "NO", "NY")} (handled above), when an input {@code Locale}
+         * has language "no" or "nb", candidate {@code Locale}s with
          * language code "no" and "nb" are interleaved, first using the
          * requested language, then using its synonym. For example,
-         * <code>Locale("nb", "NO", "POSIX")</code> generates the following
+         * {@code Locale("nb", "NO", "POSIX")} generates the following
          * candidate list:
          *
          * <ul>
@@ -2830,10 +2830,10 @@
          * <li> [<em>L</em>("no"), <em>C</em>("NO")]</li>
          * <li> [<em>L</em>("nb")]</li>
          * <li> [<em>L</em>("no")]</li>
-         * <li> <code>Locale.ROOT</code></li>
+         * <li> {@code Locale.ROOT}</li>
          * </ul>
          *
-         * <code>Locale("no", "NO", "POSIX")</code> would generate the same list
+         * {@code Locale("no", "NO", "POSIX")} would generate the same list
          * except that locales with "no" would appear before the corresponding
          * locales with "nb".</li>
          * </ol>
@@ -2841,19 +2841,19 @@
          * <p>The default implementation uses an {@link ArrayList} that
          * overriding implementations may modify before returning it to the
          * caller. However, a subclass must not modify it after it has
-         * been returned by <code>getCandidateLocales</code>.
+         * been returned by {@code getCandidateLocales}.
          *
-         * <p>For example, if the given <code>baseName</code> is "Messages"
-         * and the given <code>locale</code> is
+         * <p>For example, if the given {@code baseName} is "Messages"
+         * and the given {@code locale} is
          * <code>Locale("ja",&nbsp;"",&nbsp;"XX")</code>, then a
-         * <code>List</code> of <code>Locale</code>s:
+         * {@code List} of {@code Locale}s:
          * <pre>
          *     Locale("ja", "", "XX")
          *     Locale("ja")
          *     Locale.ROOT
          * </pre>
          * is returned. And if the resource bundles for the "ja" and
-         * "" <code>Locale</code>s are found, then the runtime resource
+         * "" {@code Locale}s are found, then the runtime resource
          * lookup path (parent chain) is:
          * <pre>{@code
          *     Messages_ja -> Messages
@@ -2864,11 +2864,11 @@
          *        qualified class name
          * @param locale
          *        the locale for which a resource bundle is desired
-         * @return a <code>List</code> of candidate
-         *        <code>Locale</code>s for the given <code>locale</code>
+         * @return a {@code List} of candidate
+         *        {@code Locale}s for the given {@code locale}
          * @throws    NullPointerException
-         *        if <code>baseName</code> or <code>locale</code> is
-         *        <code>null</code>
+         *        if {@code baseName} or {@code locale} is
+         *        {@code null}
          */
         public List<Locale> getCandidateLocales(String baseName, Locale locale) {
             if (baseName == null) {
@@ -3003,40 +3003,40 @@
         }
 
         /**
-         * Returns a <code>Locale</code> to be used as a fallback locale for
+         * Returns a {@code Locale} to be used as a fallback locale for
          * further resource bundle searches by the
-         * <code>ResourceBundle.getBundle</code> factory method. This method
+         * {@code ResourceBundle.getBundle} factory method. This method
          * is called from the factory method every time when no resulting
-         * resource bundle has been found for <code>baseName</code> and
-         * <code>locale</code>, where locale is either the parameter for
-         * <code>ResourceBundle.getBundle</code> or the previous fallback
+         * resource bundle has been found for {@code baseName} and
+         * {@code locale}, where locale is either the parameter for
+         * {@code ResourceBundle.getBundle} or the previous fallback
          * locale returned by this method.
          *
-         * <p>The method returns <code>null</code> if no further fallback
+         * <p>The method returns {@code null} if no further fallback
          * search is desired.
          *
          * <p>The default implementation returns the {@linkplain
-         * Locale#getDefault() default <code>Locale</code>} if the given
-         * <code>locale</code> isn't the default one.  Otherwise,
-         * <code>null</code> is returned.
+         * Locale#getDefault() default {@code Locale}} if the given
+         * {@code locale} isn't the default one.  Otherwise,
+         * {@code null} is returned.
          *
          * @param baseName
          *        the base name of the resource bundle, a fully
          *        qualified class name for which
-         *        <code>ResourceBundle.getBundle</code> has been
+         *        {@code ResourceBundle.getBundle} has been
          *        unable to find any resource bundles (except for the
          *        base bundle)
          * @param locale
-         *        the <code>Locale</code> for which
-         *        <code>ResourceBundle.getBundle</code> has been
+         *        the {@code Locale} for which
+         *        {@code ResourceBundle.getBundle} has been
          *        unable to find any resource bundles (except for the
          *        base bundle)
-         * @return a <code>Locale</code> for the fallback search,
-         *        or <code>null</code> if no further fallback search
+         * @return a {@code Locale} for the fallback search,
+         *        or {@code null} if no further fallback search
          *        is desired.
          * @throws    NullPointerException
-         *        if <code>baseName</code> or <code>locale</code>
-         *        is <code>null</code>
+         *        if {@code baseName} or {@code locale}
+         *        is {@code null}
          */
         public Locale getFallbackLocale(String baseName, Locale locale) {
             if (baseName == null) {
@@ -3049,14 +3049,14 @@
         /**
          * Instantiates a resource bundle for the given bundle name of the
          * given format and locale, using the given class loader if
-         * necessary. This method returns <code>null</code> if there is no
+         * necessary. This method returns {@code null} if there is no
          * resource bundle available for the given parameters. If a resource
          * bundle can't be instantiated due to an unexpected error, the
-         * error must be reported by throwing an <code>Error</code> or
-         * <code>Exception</code> rather than simply returning
-         * <code>null</code>.
+         * error must be reported by throwing an {@code Error} or
+         * {@code Exception} rather than simply returning
+         * {@code null}.
          *
-         * <p>If the <code>reload</code> flag is <code>true</code>, it
+         * <p>If the {@code reload} flag is {@code true}, it
          * indicates that this method is being called because the previously
          * loaded resource bundle has expired.
          *
@@ -3069,7 +3069,7 @@
          * to the resource bundle is open unconditionally.
          *
          * <p>The default implementation instantiates a
-         * <code>ResourceBundle</code> as follows.
+         * {@code ResourceBundle} as follows.
          *
          * <ul>
          *
@@ -3077,37 +3077,37 @@
          * #toBundleName(String, Locale) toBundleName(baseName,
          * locale)}.</li>
          *
-         * <li>If <code>format</code> is <code>"java.class"</code>, the
+         * <li>If {@code format} is {@code "java.class"}, the
          * {@link Class} specified by the bundle name is loaded with the
          * given class loader. If the {@code Class} is found and accessible
-         * then the <code>ResourceBundle</code> is instantiated.  The
+         * then the {@code ResourceBundle} is instantiated.  The
          * resource bundle is accessible if the package of the bundle class file
          * is open unconditionally; otherwise, {@code IllegalAccessException}
          * will be thrown.
-         * Note that the <code>reload</code> flag is ignored for loading
+         * Note that the {@code reload} flag is ignored for loading
          * class-based resource bundles in this default implementation.
          * </li>
          *
-         * <li>If <code>format</code> is <code>"java.properties"</code>,
+         * <li>If {@code format} is {@code "java.properties"},
          * {@link #toResourceName(String, String) toResourceName(bundlename,
          * "properties")} is called to get the resource name.
-         * If <code>reload</code> is <code>true</code>, {@link
+         * If {@code reload} is {@code true}, {@link
          * ClassLoader#getResource(String) load.getResource} is called
          * to get a {@link URL} for creating a {@link
-         * URLConnection}. This <code>URLConnection</code> is used to
+         * URLConnection}. This {@code URLConnection} is used to
          * {@linkplain URLConnection#setUseCaches(boolean) disable the
          * caches} of the underlying resource loading layers,
          * and to {@linkplain URLConnection#getInputStream() get an
-         * <code>InputStream</code>}.
+         * {@code InputStream}}.
          * Otherwise, {@link ClassLoader#getResourceAsStream(String)
          * loader.getResourceAsStream} is called to get an {@link
          * InputStream}. Then, a {@link
          * PropertyResourceBundle} is constructed with the
-         * <code>InputStream</code>.</li>
+         * {@code InputStream}.</li>
          *
-         * <li>If <code>format</code> is neither <code>"java.class"</code>
-         * nor <code>"java.properties"</code>, an
-         * <code>IllegalArgumentException</code> is thrown.</li>
+         * <li>If {@code format} is neither {@code "java.class"}
+         * nor {@code "java.properties"}, an
+         * {@code IllegalArgumentException} is thrown.</li>
          *
          * </ul>
          *
@@ -3120,23 +3120,23 @@
          * @param format
          *        the resource bundle format to be loaded
          * @param loader
-         *        the <code>ClassLoader</code> to use to load the bundle
+         *        the {@code ClassLoader} to use to load the bundle
          * @param reload
-         *        the flag to indicate bundle reloading; <code>true</code>
+         *        the flag to indicate bundle reloading; {@code true}
          *        if reloading an expired resource bundle,
-         *        <code>false</code> otherwise
+         *        {@code false} otherwise
          * @return the resource bundle instance,
-         *        or <code>null</code> if none could be found.
+         *        or {@code null} if none could be found.
          * @throws    NullPointerException
-         *        if <code>bundleName</code>, <code>locale</code>,
-         *        <code>format</code>, or <code>loader</code> is
-         *        <code>null</code>, or if <code>null</code> is returned by
+         *        if {@code bundleName}, {@code locale},
+         *        {@code format}, or {@code loader} is
+         *        {@code null}, or if {@code null} is returned by
          *        {@link #toBundleName(String, Locale) toBundleName}
          * @throws    IllegalArgumentException
-         *        if <code>format</code> is unknown, or if the resource
+         *        if {@code format} is unknown, or if the resource
          *        found for the given parameters contains malformed data.
          * @throws    ClassCastException
-         *        if the loaded class cannot be cast to <code>ResourceBundle</code>
+         *        if the loaded class cannot be cast to {@code ResourceBundle}
          * @throws    IllegalAccessException
          *        if the class or its nullary constructor is not
          *        accessible.
@@ -3256,7 +3256,7 @@
         /**
          * Returns the time-to-live (TTL) value for resource bundles that
          * are loaded under this
-         * <code>ResourceBundle.Control</code>. Positive time-to-live values
+         * {@code ResourceBundle.Control}. Positive time-to-live values
          * specify the number of milliseconds a bundle can remain in the
          * cache without being validated against the source data from which
          * it was constructed. The value 0 indicates that a bundle must be
@@ -3267,13 +3267,13 @@
          * expiration control.
          *
          * <p>The expiration affects only the bundle loading process by the
-         * <code>ResourceBundle.getBundle</code> factory method.  That is,
+         * {@code ResourceBundle.getBundle} factory method.  That is,
          * if the factory method finds a resource bundle in the cache that
          * has expired, the factory method calls the {@link
          * #needsReload(String, Locale, String, ClassLoader, ResourceBundle,
          * long) needsReload} method to determine whether the resource
-         * bundle needs to be reloaded. If <code>needsReload</code> returns
-         * <code>true</code>, the cached resource bundle instance is removed
+         * bundle needs to be reloaded. If {@code needsReload} returns
+         * {@code true}, the cached resource bundle instance is removed
          * from the cache. Otherwise, the instance stays in the cache,
          * updated with the new TTL value returned by this method.
          *
@@ -3296,8 +3296,8 @@
          *        expiration control, or {@link #TTL_DONT_CACHE} to disable
          *        caching.
          * @throws    NullPointerException
-         *        if <code>baseName</code> or <code>locale</code> is
-         *        <code>null</code>
+         *        if {@code baseName} or {@code locale} is
+         *        {@code null}
          */
         public long getTimeToLive(String baseName, Locale locale) {
             if (baseName == null || locale == null) {
@@ -3307,30 +3307,30 @@
         }
 
         /**
-         * Determines if the expired <code>bundle</code> in the cache needs
+         * Determines if the expired {@code bundle} in the cache needs
          * to be reloaded based on the loading time given by
-         * <code>loadTime</code> or some other criteria. The method returns
-         * <code>true</code> if reloading is required; <code>false</code>
-         * otherwise. <code>loadTime</code> is a millisecond offset since
-         * the <a href="Calendar.html#Epoch"> <code>Calendar</code>
+         * {@code loadTime} or some other criteria. The method returns
+         * {@code true} if reloading is required; {@code false}
+         * otherwise. {@code loadTime} is a millisecond offset since
+         * the <a href="Calendar.html#Epoch"> {@code Calendar}
          * Epoch</a>.
          *
          * <p>
-         * The calling <code>ResourceBundle.getBundle</code> factory method
-         * calls this method on the <code>ResourceBundle.Control</code>
+         * The calling {@code ResourceBundle.getBundle} factory method
+         * calls this method on the {@code ResourceBundle.Control}
          * instance used for its current invocation, not on the instance
          * used in the invocation that originally loaded the resource
          * bundle.
          *
-         * <p>The default implementation compares <code>loadTime</code> and
+         * <p>The default implementation compares {@code loadTime} and
          * the last modified time of the source data of the resource
          * bundle. If it's determined that the source data has been modified
-         * since <code>loadTime</code>, <code>true</code> is
-         * returned. Otherwise, <code>false</code> is returned. This
-         * implementation assumes that the given <code>format</code> is the
+         * since {@code loadTime}, {@code true} is
+         * returned. Otherwise, {@code false} is returned. This
+         * implementation assumes that the given {@code format} is the
          * same string as its file suffix if it's not one of the default
-         * formats, <code>"java.class"</code> or
-         * <code>"java.properties"</code>.
+         * formats, {@code "java.class"} or
+         * {@code "java.properties"}.
          *
          * @param baseName
          *        the base bundle name of the resource bundle, a
@@ -3341,19 +3341,19 @@
          * @param format
          *        the resource bundle format to be loaded
          * @param loader
-         *        the <code>ClassLoader</code> to use to load the bundle
+         *        the {@code ClassLoader} to use to load the bundle
          * @param bundle
          *        the resource bundle instance that has been expired
          *        in the cache
          * @param loadTime
-         *        the time when <code>bundle</code> was loaded and put
+         *        the time when {@code bundle} was loaded and put
          *        in the cache
-         * @return <code>true</code> if the expired bundle needs to be
-         *        reloaded; <code>false</code> otherwise.
+         * @return {@code true} if the expired bundle needs to be
+         *        reloaded; {@code false} otherwise.
          * @throws    NullPointerException
-         *        if <code>baseName</code>, <code>locale</code>,
-         *        <code>format</code>, <code>loader</code>, or
-         *        <code>bundle</code> is <code>null</code>
+         *        if {@code baseName}, {@code locale},
+         *        {@code format}, {@code loader}, or
+         *        {@code bundle} is {@code null}
          */
         public boolean needsReload(String baseName, Locale locale,
                                    String format, ClassLoader loader,
@@ -3400,7 +3400,7 @@
         }
 
         /**
-         * Converts the given <code>baseName</code> and <code>locale</code>
+         * Converts the given {@code baseName} and {@code locale}
          * to the bundle name. This method is called from the default
          * implementation of the {@link #newBundle(String, Locale, String,
          * ClassLoader, boolean) newBundle} and {@link #needsReload(String,
@@ -3411,20 +3411,20 @@
          * <pre>
          *     baseName + "_" + language + "_" + script + "_" + country + "_" + variant
          * </pre>
-         * where <code>language</code>, <code>script</code>, <code>country</code>,
-         * and <code>variant</code> are the language, script, country, and variant
-         * values of <code>locale</code>, respectively. Final component values that
+         * where {@code language}, {@code script}, {@code country},
+         * and {@code variant} are the language, script, country, and variant
+         * values of {@code locale}, respectively. Final component values that
          * are empty Strings are omitted along with the preceding '_'.  When the
          * script is empty, the script value is omitted along with the preceding '_'.
-         * If all of the values are empty strings, then <code>baseName</code>
+         * If all of the values are empty strings, then {@code baseName}
          * is returned.
          *
-         * <p>For example, if <code>baseName</code> is
-         * <code>"baseName"</code> and <code>locale</code> is
+         * <p>For example, if {@code baseName} is
+         * {@code "baseName"} and {@code locale} is
          * <code>Locale("ja",&nbsp;"",&nbsp;"XX")</code>, then
          * <code>"baseName_ja_&thinsp;_XX"</code> is returned. If the given
-         * locale is <code>Locale("en")</code>, then
-         * <code>"baseName_en"</code> is returned.
+         * locale is {@code Locale("en")}, then
+         * {@code "baseName_en"} is returned.
          *
          * <p>Overriding this method allows applications to use different
          * conventions in the organization and packaging of localized
@@ -3438,8 +3438,8 @@
          *        loaded
          * @return the bundle name for the resource bundle
          * @throws    NullPointerException
-         *        if <code>baseName</code> or <code>locale</code>
-         *        is <code>null</code>
+         *        if {@code baseName} or {@code locale}
+         *        is {@code null}
          * @see java.util.spi.AbstractResourceBundleProvider#toBundleName(String, Locale)
          */
         public String toBundleName(String baseName, Locale locale) {
--- a/src/java.base/share/classes/java/util/SimpleTimeZone.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/SimpleTimeZone.java	Wed Sep 25 22:40:41 2019 +0200
@@ -48,7 +48,7 @@
 import sun.util.calendar.Gregorian;
 
 /**
- * <code>SimpleTimeZone</code> is a concrete subclass of <code>TimeZone</code>
+ * {@code SimpleTimeZone} is a concrete subclass of {@code TimeZone}
  * that represents a time zone for use with a Gregorian calendar.
  * The class holds an offset from GMT, called <em>raw offset</em>, and start
  * and end rules for a daylight saving time schedule.  Since it only holds
@@ -57,7 +57,7 @@
  * #setStartYear setStartYear} method can specify the year when the daylight
  * saving time schedule starts in effect.
  * <p>
- * To construct a <code>SimpleTimeZone</code> with a daylight saving time
+ * To construct a {@code SimpleTimeZone} with a daylight saving time
  * schedule, the schedule can be described with a set of rules,
  * <em>start-rule</em> and <em>end-rule</em>. A day when daylight saving time
  * starts or ends is specified by a combination of <em>month</em>,
@@ -81,7 +81,7 @@
  * or after which the rule is applied, and <em>day-of-week</em> to a negative {@link
  * Calendar#DAY_OF_WEEK DAY_OF_WEEK} field value. For example, to specify the
  * second Sunday of April, set <em>month</em> to {@link Calendar#APRIL APRIL},
- * <em>day-of-month</em> to 8, and <em>day-of-week</em> to <code>-</code>{@link
+ * <em>day-of-month</em> to 8, and <em>day-of-week</em> to {@code -}{@link
  * Calendar#SUNDAY SUNDAY}.</li>
  *
  * <li><b>Day of week on or before day of month</b><br>
@@ -89,7 +89,7 @@
  * <em>day-of-month</em> and <em>day-of-week</em> to a negative value. For
  * example, to specify the last Wednesday on or before the 21st of March, set
  * <em>month</em> to {@link Calendar#MARCH MARCH}, <em>day-of-month</em> is -21
- * and <em>day-of-week</em> is <code>-</code>{@link Calendar#WEDNESDAY WEDNESDAY}. </li>
+ * and <em>day-of-week</em> is {@code -}{@link Calendar#WEDNESDAY WEDNESDAY}. </li>
  *
  * <li><b>Last day-of-week of month</b><br>
  * To specify, the last day-of-week of the month, set <em>day-of-week</em> to a
@@ -139,7 +139,7 @@
  *                     3600000)
  * </code></pre>
  * These parameter rules are also applicable to the set rule methods, such as
- * <code>setStartRule</code>.
+ * {@code setStartRule}.
  *
  * @since 1.1
  * @see      Calendar
@@ -167,7 +167,7 @@
      * Constructs a SimpleTimeZone with the given base time zone offset from
      * GMT, time zone ID, and rules for starting and ending the daylight
      * time.
-     * Both <code>startTime</code> and <code>endTime</code> are specified to be
+     * Both {@code startTime} and {@code endTime} are specified to be
      * represented in the wall clock time. The amount of daylight saving is
      * assumed to be 3600000 milliseconds (i.e., one hour). This constructor is
      * equivalent to:
@@ -226,7 +226,7 @@
      * Constructs a SimpleTimeZone with the given base time zone offset from
      * GMT, time zone ID, and rules for starting and ending the daylight
      * time.
-     * Both <code>startTime</code> and <code>endTime</code> are assumed to be
+     * Both {@code startTime} and {@code endTime} are assumed to be
      * represented in the wall clock time. This constructor is equivalent to:
      * <pre><code>
      *     SimpleTimeZone(rawOffset,
@@ -286,8 +286,8 @@
      * GMT, time zone ID, and rules for starting and ending the daylight
      * time.
      * This constructor takes the full set of the start and end rules
-     * parameters, including modes of <code>startTime</code> and
-     * <code>endTime</code>. The mode specifies either {@link #WALL_TIME wall
+     * parameters, including modes of {@code startTime} and
+     * {@code endTime}. The mode specifies either {@link #WALL_TIME wall
      * time} or {@link #STANDARD_TIME standard time} or {@link #UTC_TIME UTC
      * time}.
      *
@@ -301,7 +301,7 @@
      * @param startDayOfWeek  The daylight saving time starting day-of-week.
      *                        See the class description for the special cases of this parameter.
      * @param startTime       The daylight saving time starting time in the time mode
-     *                        specified by <code>startTimeMode</code>.
+     *                        specified by {@code startTimeMode}.
      * @param startTimeMode   The mode of the start time specified by startTime.
      * @param endMonth        The daylight saving time ending month. Month is
      *                        a {@link Calendar#MONTH MONTH} field
@@ -311,7 +311,7 @@
      * @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 mode
-     *                        specified by <code>endTimeMode</code>.
+     *                        specified by {@code endTimeMode}.
      * @param endTimeMode     The mode of the end time specified by endTime
      * @param dstSavings      The amount of time in milliseconds saved during
      *                        daylight saving time.
@@ -369,7 +369,7 @@
      * Sets the daylight saving time start rule. For example, if daylight saving
      * time starts on the first Sunday in April at 2 am in local wall clock
      * time, you can set the start rule by calling:
-     * <pre><code>setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 2*60*60*1000);</code></pre>
+     * <pre>{@code setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 2*60*60*1000);}</pre>
      *
      * @param startMonth      The daylight saving time starting month. Month is
      *                        a {@link Calendar#MONTH MONTH} field
@@ -380,8 +380,8 @@
      *                        See the class description for the special cases of this parameter.
      * @param startTime       The daylight saving time starting time in local wall clock
      *                        time, which is local standard time in this case.
-     * @throws    IllegalArgumentException if the <code>startMonth</code>, <code>startDay</code>,
-     * <code>startDayOfWeek</code>, or <code>startTime</code> parameters are out of range
+     * @throws    IllegalArgumentException if the {@code startMonth}, {@code startDay},
+     * {@code startDayOfWeek}, or {@code startTime} parameters are out of range
      */
     public void setStartRule(int startMonth, int startDay, int startDayOfWeek, int startTime)
     {
@@ -397,7 +397,7 @@
     /**
      * Sets the daylight saving time start rule to a fixed date within a month.
      * This method is equivalent to:
-     * <pre><code>setStartRule(startMonth, startDay, 0, startTime)</code></pre>
+     * <pre>{@code setStartRule(startMonth, startDay, 0, startTime)}</pre>
      *
      * @param startMonth      The daylight saving time starting month. Month is
      *                        a {@link Calendar#MONTH MONTH} field
@@ -406,8 +406,8 @@
      * @param startTime       The daylight saving time starting time in local wall clock
      *                        time, which is local standard time in this case.
      *                        See the class description for the special cases of this parameter.
-     * @throws    IllegalArgumentException if the <code>startMonth</code>,
-     * <code>startDayOfMonth</code>, or <code>startTime</code> parameters are out of range
+     * @throws    IllegalArgumentException if the {@code startMonth},
+     * {@code startDayOfMonth}, or {@code startTime} parameters are out of range
      * @since 1.2
      */
     public void setStartRule(int startMonth, int startDay, int startTime) {
@@ -425,12 +425,12 @@
      * @param startDayOfWeek  The daylight saving time starting day-of-week.
      * @param startTime       The daylight saving time starting time in local wall clock
      *                        time, which is local standard time in this case.
-     * @param after           If true, this rule selects the first <code>dayOfWeek</code> on or
-     *                        <em>after</em> <code>dayOfMonth</code>.  If false, this rule
-     *                        selects the last <code>dayOfWeek</code> on or <em>before</em>
-     *                        <code>dayOfMonth</code>.
-     * @throws    IllegalArgumentException if the <code>startMonth</code>, <code>startDay</code>,
-     * <code>startDayOfWeek</code>, or <code>startTime</code> parameters are out of range
+     * @param after           If true, this rule selects the first {@code dayOfWeek} on or
+     *                        <em>after</em> {@code dayOfMonth}.  If false, this rule
+     *                        selects the last {@code dayOfWeek} on or <em>before</em>
+     *                        {@code dayOfMonth}.
+     * @throws    IllegalArgumentException if the {@code startMonth}, {@code startDay},
+     * {@code startDayOfWeek}, or {@code startTime} parameters are out of range
      * @since 1.2
      */
     public void setStartRule(int startMonth, int startDay, int startDayOfWeek,
@@ -448,7 +448,7 @@
      * Sets the daylight saving time end rule. For example, if daylight saving time
      * ends on the last Sunday in October at 2 am in wall clock time,
      * you can set the end rule by calling:
-     * <code>setEndRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 2*60*60*1000);</code>
+     * {@code setEndRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 2*60*60*1000);}
      *
      * @param endMonth        The daylight saving time ending month. Month is
      *                        a {@link Calendar#MONTH MONTH} field
@@ -460,8 +460,8 @@
      * @param endTime         The daylight saving ending time in local wall clock time,
      *                        (in milliseconds within the day) which is local daylight
      *                        time in this case.
-     * @throws    IllegalArgumentException if the <code>endMonth</code>, <code>endDay</code>,
-     * <code>endDayOfWeek</code>, or <code>endTime</code> parameters are out of range
+     * @throws    IllegalArgumentException if the {@code endMonth}, {@code endDay},
+     * {@code endDayOfWeek}, or {@code endTime} parameters are out of range
      */
     public void setEndRule(int endMonth, int endDay, int endDayOfWeek,
                            int endTime)
@@ -478,7 +478,7 @@
     /**
      * Sets the daylight saving time end rule to a fixed date within a month.
      * This method is equivalent to:
-     * <pre><code>setEndRule(endMonth, endDay, 0, endTime)</code></pre>
+     * <pre>{@code setEndRule(endMonth, endDay, 0, endTime)}</pre>
      *
      * @param endMonth        The daylight saving time ending month. Month is
      *                        a {@link Calendar#MONTH MONTH} field
@@ -487,8 +487,8 @@
      * @param endTime         The daylight saving ending time in local wall clock time,
      *                        (in milliseconds within the day) which is local daylight
      *                        time in this case.
-     * @throws    IllegalArgumentException the <code>endMonth</code>, <code>endDay</code>,
-     * or <code>endTime</code> parameters are out of range
+     * @throws    IllegalArgumentException the {@code endMonth}, {@code endDay},
+     * or {@code endTime} parameters are out of range
      * @since 1.2
      */
     public void setEndRule(int endMonth, int endDay, int endTime)
@@ -508,12 +508,12 @@
      * @param endTime         The daylight saving ending time in local wall clock time,
      *                        (in milliseconds within the day) which is local daylight
      *                        time in this case.
-     * @param after           If true, this rule selects the first <code>endDayOfWeek</code> on
-     *                        or <em>after</em> <code>endDay</code>.  If false, this rule
-     *                        selects the last <code>endDayOfWeek</code> on or before
-     *                        <code>endDay</code> of the month.
-     * @throws    IllegalArgumentException the <code>endMonth</code>, <code>endDay</code>,
-     * <code>endDayOfWeek</code>, or <code>endTime</code> parameters are out of range
+     * @param after           If true, this rule selects the first {@code endDayOfWeek} on
+     *                        or <em>after</em> {@code endDay}.  If false, this rule
+     *                        selects the last {@code endDayOfWeek} on or before
+     *                        {@code endDay} of the month.
+     * @throws    IllegalArgumentException the {@code endMonth}, {@code endDay},
+     * {@code endDayOfWeek}, or {@code endTime} parameters are out of range
      * @since 1.2
      */
     public void setEndRule(int endMonth, int endDay, int endDayOfWeek, int endTime, boolean after)
@@ -583,10 +583,10 @@
      * uses a default {@link GregorianCalendar} object as its
      * underlying calendar, such as for determining leap years.  Do
      * not use the result of this method with a calendar other than a
-     * default <code>GregorianCalendar</code>.
+     * default {@code GregorianCalendar}.
      *
      * <p><em>Note:  In general, clients should use
-     * <code>Calendar.get(ZONE_OFFSET) + Calendar.get(DST_OFFSET)</code>
+     * {@code Calendar.get(ZONE_OFFSET) + Calendar.get(DST_OFFSET)}
      * instead of calling this method.</em>
      *
      * @param era       The era of the given date.
@@ -597,9 +597,9 @@
      * @param dayOfWeek The day-of-week of the given date.
      * @param millis    The milliseconds in day in <em>standard</em> local time.
      * @return          The milliseconds to add to UTC to get local time.
-     * @throws          IllegalArgumentException the <code>era</code>,
-     *                  <code>month</code>, <code>day</code>, <code>dayOfWeek</code>,
-     *                  or <code>millis</code> parameters are out of range
+     * @throws          IllegalArgumentException the {@code era},
+     *                  {@code month}, {@code day}, {@code dayOfWeek},
+     *                  or {@code millis} parameters are out of range
      */
     public int getOffset(int era, int year, int month, int day, int dayOfWeek,
                          int millis)
@@ -853,7 +853,7 @@
     }
 
     /**
-     * Returns a clone of this <code>SimpleTimeZone</code> instance.
+     * Returns a clone of this {@code SimpleTimeZone} instance.
      * @return a clone of this instance.
      */
     public Object clone()
@@ -872,11 +872,11 @@
     }
 
     /**
-     * Compares the equality of two <code>SimpleTimeZone</code> objects.
+     * Compares the equality of two {@code SimpleTimeZone} objects.
      *
-     * @param obj  The <code>SimpleTimeZone</code> object to be compared with.
-     * @return     True if the given <code>obj</code> is the same as this
-     *             <code>SimpleTimeZone</code> object; false otherwise.
+     * @param obj  The {@code SimpleTimeZone} object to be compared with.
+     * @return     True if the given {@code obj} is the same as this
+     *             {@code SimpleTimeZone} object; false otherwise.
      */
     public boolean equals(Object obj)
     {
@@ -894,9 +894,9 @@
     }
 
     /**
-     * Returns <code>true</code> if this zone has the same rules and offset as another zone.
+     * Returns {@code true} if this zone has the same rules and offset as another zone.
      * @param other the TimeZone object to be compared with
-     * @return <code>true</code> if the given zone is a SimpleTimeZone and has the
+     * @return {@code true} if the given zone is a SimpleTimeZone and has the
      * same rules and offset as this one
      * @since 1.2
      */
@@ -957,10 +957,10 @@
 
     /**
      * The month in which daylight saving time starts.  This value must be
-     * between <code>Calendar.JANUARY</code> and
-     * <code>Calendar.DECEMBER</code> inclusive.  This value must not equal
-     * <code>endMonth</code>.
-     * <p>If <code>useDaylight</code> is false, this value is ignored.
+     * between {@code Calendar.JANUARY} and
+     * {@code Calendar.DECEMBER} inclusive.  This value must not equal
+     * {@code endMonth}.
+     * <p>If {@code useDaylight} is false, this value is ignored.
      * @serial
      */
     private int startMonth;
@@ -968,34 +968,34 @@
     /**
      * This field has two possible interpretations:
      * <dl>
-     * <dt><code>startMode == DOW_IN_MONTH</code></dt>
+     * <dt>{@code startMode == DOW_IN_MONTH}</dt>
      * <dd>
-     * <code>startDay</code> indicates the day of the month of
-     * <code>startMonth</code> on which daylight
+     * {@code startDay} indicates the day of the month of
+     * {@code startMonth} on which daylight
      * saving time starts, from 1 to 28, 30, or 31, depending on the
-     * <code>startMonth</code>.
+     * {@code startMonth}.
      * </dd>
-     * <dt><code>startMode != DOW_IN_MONTH</code></dt>
+     * <dt>{@code startMode != DOW_IN_MONTH}</dt>
      * <dd>
-     * <code>startDay</code> indicates which <code>startDayOfWeek</code> in the
-     * month <code>startMonth</code> daylight
+     * {@code startDay} indicates which {@code startDayOfWeek} in the
+     * month {@code startMonth} daylight
      * saving time starts on.  For example, a value of +1 and a
-     * <code>startDayOfWeek</code> of <code>Calendar.SUNDAY</code> indicates the
-     * first Sunday of <code>startMonth</code>.  Likewise, +2 would indicate the
+     * {@code startDayOfWeek} of {@code Calendar.SUNDAY} indicates the
+     * first Sunday of {@code startMonth}.  Likewise, +2 would indicate the
      * second Sunday, and -1 the last Sunday.  A value of 0 is illegal.
      * </dd>
      * </dl>
-     * <p>If <code>useDaylight</code> is false, this value is ignored.
+     * <p>If {@code useDaylight} is false, this value is ignored.
      * @serial
      */
     private int startDay;
 
     /**
      * The day of the week on which daylight saving time starts.  This value
-     * must be between <code>Calendar.SUNDAY</code> and
-     * <code>Calendar.SATURDAY</code> inclusive.
-     * <p>If <code>useDaylight</code> is false or
-     * <code>startMode == DAY_OF_MONTH</code>, this value is ignored.
+     * must be between {@code Calendar.SUNDAY} and
+     * {@code Calendar.SATURDAY} inclusive.
+     * <p>If {@code useDaylight} is false or
+     * {@code startMode == DAY_OF_MONTH}, this value is ignored.
      * @serial
      */
     private int startDayOfWeek;
@@ -1003,8 +1003,8 @@
     /**
      * The time in milliseconds after midnight at which daylight saving
      * time starts.  This value is expressed as wall time, standard time,
-     * or UTC time, depending on the setting of <code>startTimeMode</code>.
-     * <p>If <code>useDaylight</code> is false, this value is ignored.
+     * or UTC time, depending on the setting of {@code startTimeMode}.
+     * <p>If {@code useDaylight} is false, this value is ignored.
      * @serial
      */
     private int startTime;
@@ -1018,10 +1018,10 @@
 
     /**
      * The month in which daylight saving time ends.  This value must be
-     * between <code>Calendar.JANUARY</code> and
-     * <code>Calendar.UNDECIMBER</code>.  This value must not equal
-     * <code>startMonth</code>.
-     * <p>If <code>useDaylight</code> is false, this value is ignored.
+     * between {@code Calendar.JANUARY} and
+     * {@code Calendar.UNDECIMBER}.  This value must not equal
+     * {@code startMonth}.
+     * <p>If {@code useDaylight} is false, this value is ignored.
      * @serial
      */
     private int endMonth;
@@ -1029,34 +1029,34 @@
     /**
      * This field has two possible interpretations:
      * <dl>
-     * <dt><code>endMode == DOW_IN_MONTH</code></dt>
+     * <dt>{@code endMode == DOW_IN_MONTH}</dt>
      * <dd>
-     * <code>endDay</code> indicates the day of the month of
-     * <code>endMonth</code> on which daylight
+     * {@code endDay} indicates the day of the month of
+     * {@code endMonth} on which daylight
      * saving time ends, from 1 to 28, 30, or 31, depending on the
-     * <code>endMonth</code>.
+     * {@code endMonth}.
      * </dd>
-     * <dt><code>endMode != DOW_IN_MONTH</code></dt>
+     * <dt>{@code endMode != DOW_IN_MONTH}</dt>
      * <dd>
-     * <code>endDay</code> indicates which <code>endDayOfWeek</code> in th
-     * month <code>endMonth</code> daylight
+     * {@code endDay} indicates which {@code endDayOfWeek} in th
+     * month {@code endMonth} daylight
      * saving time ends on.  For example, a value of +1 and a
-     * <code>endDayOfWeek</code> of <code>Calendar.SUNDAY</code> indicates the
-     * first Sunday of <code>endMonth</code>.  Likewise, +2 would indicate the
+     * {@code endDayOfWeek} of {@code Calendar.SUNDAY} indicates the
+     * first Sunday of {@code endMonth}.  Likewise, +2 would indicate the
      * second Sunday, and -1 the last Sunday.  A value of 0 is illegal.
      * </dd>
      * </dl>
-     * <p>If <code>useDaylight</code> is false, this value is ignored.
+     * <p>If {@code useDaylight} is false, this value is ignored.
      * @serial
      */
     private int endDay;
 
     /**
      * The day of the week on which daylight saving time ends.  This value
-     * must be between <code>Calendar.SUNDAY</code> and
-     * <code>Calendar.SATURDAY</code> inclusive.
-     * <p>If <code>useDaylight</code> is false or
-     * <code>endMode == DAY_OF_MONTH</code>, this value is ignored.
+     * must be between {@code Calendar.SUNDAY} and
+     * {@code Calendar.SATURDAY} inclusive.
+     * <p>If {@code useDaylight} is false or
+     * {@code endMode == DAY_OF_MONTH}, this value is ignored.
      * @serial
      */
     private int endDayOfWeek;
@@ -1064,15 +1064,15 @@
     /**
      * The time in milliseconds after midnight at which daylight saving
      * time ends.  This value is expressed as wall time, standard time,
-     * or UTC time, depending on the setting of <code>endTimeMode</code>.
-     * <p>If <code>useDaylight</code> is false, this value is ignored.
+     * or UTC time, depending on the setting of {@code endTimeMode}.
+     * <p>If {@code useDaylight} is false, this value is ignored.
      * @serial
      */
     private int endTime;
 
     /**
-     * The format of endTime, either <code>WALL_TIME</code>,
-     * <code>STANDARD_TIME</code>, or <code>UTC_TIME</code>.
+     * The format of endTime, either {@code WALL_TIME},
+     * {@code STANDARD_TIME}, or {@code UTC_TIME}.
      * @serial
      * @since 1.3
      */
@@ -1081,8 +1081,8 @@
     /**
      * The year in which daylight saving time is first observed.  This is an {@link GregorianCalendar#AD AD}
      * value.  If this value is less than 1 then daylight saving time is observed
-     * for all <code>AD</code> years.
-     * <p>If <code>useDaylight</code> is false, this value is ignored.
+     * for all {@code AD} years.
+     * <p>If {@code useDaylight} is false, this value is ignored.
      * @serial
      */
     private int startYear;
@@ -1091,7 +1091,7 @@
      * The offset in milliseconds between this zone and GMT.  Negative offsets
      * are to the west of Greenwich.  To obtain local <em>standard</em> time,
      * add the offset to GMT time.  To obtain local wall time it may also be
-     * necessary to add <code>dstSavings</code>.
+     * necessary to add {@code dstSavings}.
      * @serial
      */
     private int rawOffset;
@@ -1122,26 +1122,26 @@
      * Variables specifying the mode of the start rule.  Takes the following
      * values:
      * <dl>
-     * <dt><code>DOM_MODE</code></dt>
+     * <dt>{@code DOM_MODE}</dt>
      * <dd>
      * Exact day of week; e.g., March 1.
      * </dd>
-     * <dt><code>DOW_IN_MONTH_MODE</code></dt>
+     * <dt>{@code DOW_IN_MONTH_MODE}</dt>
      * <dd>
      * Day of week in month; e.g., last Sunday in March.
      * </dd>
-     * <dt><code>DOW_GE_DOM_MODE</code></dt>
+     * <dt>{@code DOW_GE_DOM_MODE}</dt>
      * <dd>
      * Day of week after day of month; e.g., Sunday on or after March 15.
      * </dd>
-     * <dt><code>DOW_LE_DOM_MODE</code></dt>
+     * <dt>{@code DOW_LE_DOM_MODE}</dt>
      * <dd>
      * Day of week before day of month; e.g., Sunday on or before March 15.
      * </dd>
      * </dl>
      * The setting of this field affects the interpretation of the
-     * <code>startDay</code> field.
-     * <p>If <code>useDaylight</code> is false, this value is ignored.
+     * {@code startDay} field.
+     * <p>If {@code useDaylight} is false, this value is ignored.
      * @serial
      * @since 1.1.4
      */
@@ -1151,26 +1151,26 @@
      * Variables specifying the mode of the end rule.  Takes the following
      * values:
      * <dl>
-     * <dt><code>DOM_MODE</code></dt>
+     * <dt>{@code DOM_MODE}</dt>
      * <dd>
      * Exact day of week; e.g., March 1.
      * </dd>
-     * <dt><code>DOW_IN_MONTH_MODE</code></dt>
+     * <dt>{@code DOW_IN_MONTH_MODE}</dt>
      * <dd>
      * Day of week in month; e.g., last Sunday in March.
      * </dd>
-     * <dt><code>DOW_GE_DOM_MODE</code></dt>
+     * <dt>{@code DOW_GE_DOM_MODE}</dt>
      * <dd>
      * Day of week after day of month; e.g., Sunday on or after March 15.
      * </dd>
-     * <dt><code>DOW_LE_DOM_MODE</code></dt>
+     * <dt>{@code DOW_LE_DOM_MODE}</dt>
      * <dd>
      * Day of week before day of month; e.g., Sunday on or before March 15.
      * </dd>
      * </dl>
      * The setting of this field affects the interpretation of the
-     * <code>endDay</code> field.
-     * <p>If <code>useDaylight</code> is false, this value is ignored.
+     * {@code endDay} field.
+     * <p>If {@code useDaylight} is false, this value is ignored.
      * @serial
      * @since 1.1.4
      */
@@ -1180,7 +1180,7 @@
      * A positive value indicating the amount of time saved during DST in
      * milliseconds.
      * Typically one hour (3600000); sometimes 30 minutes (1800000).
-     * <p>If <code>useDaylight</code> is false, this value is ignored.
+     * <p>If {@code useDaylight} is false, this value is ignored.
      * @serial
      * @since 1.1.4
      */
@@ -1260,17 +1260,17 @@
      * </dd>
      * <dt><b>1</b></dt>
      * <dd>
-     * JDK 1.1.4 or later.  Includes three new fields: <code>startMode</code>,
-     * <code>endMode</code>, and <code>dstSavings</code>.
+     * JDK 1.1.4 or later.  Includes three new fields: {@code startMode},
+     * {@code endMode}, and {@code dstSavings}.
      * </dd>
      * <dt><b>2</b></dt>
      * <dd>
-     * JDK 1.3 or later.  Includes two new fields: <code>startTimeMode</code>
-     * and <code>endTimeMode</code>.
+     * JDK 1.3 or later.  Includes two new fields: {@code startTimeMode}
+     * and {@code endTimeMode}.
      * </dd>
      * </dl>
      * When streaming out this class, the most recent format
-     * and the highest allowable <code>serialVersionOnStream</code>
+     * and the highest allowable {@code serialVersionOnStream}
      * is written.
      * @serial
      * @since 1.1.4
@@ -1625,16 +1625,16 @@
      * Save the state of this object to a stream (i.e., serialize it).
      *
      * @serialData We write out two formats, a JDK 1.1 compatible format, using
-     * <code>DOW_IN_MONTH_MODE</code> rules, in the required section, followed
+     * {@code DOW_IN_MONTH_MODE} rules, in the required section, followed
      * by the full rules, in packed format, in the optional section.  The
      * optional section will be ignored by JDK 1.1 code upon stream in.
      * <p> Contents of the optional section: The length of a byte array is
      * emitted (int); this is 4 as of this release. The byte array of the given
      * length is emitted. The contents of the byte array are the true values of
-     * the fields <code>startDay</code>, <code>startDayOfWeek</code>,
-     * <code>endDay</code>, and <code>endDayOfWeek</code>.  The values of these
+     * the fields {@code startDay}, {@code startDayOfWeek},
+     * {@code endDay}, and {@code endDayOfWeek}.  The values of these
      * fields in the required section are approximate values suited to the rule
-     * mode <code>DOW_IN_MONTH_MODE</code>, which is the only mode recognized by
+     * mode {@code DOW_IN_MONTH_MODE}, which is the only mode recognized by
      * JDK 1.1.
      */
     @java.io.Serial
--- a/src/java.base/share/classes/java/util/TimeZone.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/TimeZone.java	Wed Sep 25 22:40:41 2019 +0200
@@ -48,44 +48,44 @@
 import sun.util.locale.provider.TimeZoneNameUtility;
 
 /**
- * <code>TimeZone</code> represents a time zone offset, and also figures out daylight
+ * {@code TimeZone} represents a time zone offset, and also figures out daylight
  * savings.
  *
  * <p>
- * Typically, you get a <code>TimeZone</code> using <code>getDefault</code>
- * which creates a <code>TimeZone</code> based on the time zone where the program
- * is running. For example, for a program running in Japan, <code>getDefault</code>
- * creates a <code>TimeZone</code> object based on Japanese Standard Time.
+ * Typically, you get a {@code TimeZone} using {@code getDefault}
+ * which creates a {@code TimeZone} based on the time zone where the program
+ * is running. For example, for a program running in Japan, {@code getDefault}
+ * creates a {@code TimeZone} object based on Japanese Standard Time.
  *
  * <p>
- * You can also get a <code>TimeZone</code> using <code>getTimeZone</code>
+ * You can also get a {@code TimeZone} using {@code getTimeZone}
  * along with a time zone ID. For instance, the time zone ID for the
  * U.S. Pacific Time zone is "America/Los_Angeles". So, you can get a
- * U.S. Pacific Time <code>TimeZone</code> object with:
+ * U.S. Pacific Time {@code TimeZone} object with:
  * <blockquote><pre>
  * TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");
  * </pre></blockquote>
- * You can use the <code>getAvailableIDs</code> method to iterate through
+ * You can use the {@code getAvailableIDs} method to iterate through
  * all the supported time zone IDs. You can then choose a
- * supported ID to get a <code>TimeZone</code>.
+ * supported ID to get a {@code TimeZone}.
  * If the time zone you want is not represented by one of the
  * supported IDs, then a custom time zone ID can be specified to
  * produce a TimeZone. The syntax of a custom time zone ID is:
  *
  * <blockquote><pre>
  * <a id="CustomID"><i>CustomID:</i></a>
- *         <code>GMT</code> <i>Sign</i> <i>Hours</i> <code>:</code> <i>Minutes</i>
- *         <code>GMT</code> <i>Sign</i> <i>Hours</i> <i>Minutes</i>
- *         <code>GMT</code> <i>Sign</i> <i>Hours</i>
+ *         {@code GMT} <i>Sign</i> <i>Hours</i> {@code :} <i>Minutes</i>
+ *         {@code GMT} <i>Sign</i> <i>Hours</i> <i>Minutes</i>
+ *         {@code GMT} <i>Sign</i> <i>Hours</i>
  * <i>Sign:</i> one of
- *         <code>+ -</code>
+ *         {@code + -}
  * <i>Hours:</i>
  *         <i>Digit</i>
  *         <i>Digit</i> <i>Digit</i>
  * <i>Minutes:</i>
  *         <i>Digit</i> <i>Digit</i>
  * <i>Digit:</i> one of
- *         <code>0 1 2 3 4 5 6 7 8 9</code>
+ *         {@code 0 1 2 3 4 5 6 7 8 9}
  * </pre></blockquote>
  *
  * <i>Hours</i> must be between 0 to 23 and <i>Minutes</i> must be
@@ -95,22 +95,22 @@
  * The format is locale independent and digits must be taken from the
  * Basic Latin block of the Unicode standard. No daylight saving time
  * transition schedule can be specified with a custom time zone ID. If
- * the specified string doesn't match the syntax, <code>"GMT"</code>
+ * the specified string doesn't match the syntax, {@code "GMT"}
  * is used.
  * <p>
- * When creating a <code>TimeZone</code>, the specified custom time
+ * When creating a {@code TimeZone}, the specified custom time
  * zone ID is normalized in the following syntax:
  * <blockquote><pre>
  * <a id="NormalizedCustomID"><i>NormalizedCustomID:</i></a>
- *         <code>GMT</code> <i>Sign</i> <i>TwoDigitHours</i> <code>:</code> <i>Minutes</i>
+ *         {@code GMT} <i>Sign</i> <i>TwoDigitHours</i> {@code :} <i>Minutes</i>
  * <i>Sign:</i> one of
- *         <code>+ -</code>
+ *         {@code + -}
  * <i>TwoDigitHours:</i>
  *         <i>Digit</i> <i>Digit</i>
  * <i>Minutes:</i>
  *         <i>Digit</i> <i>Digit</i>
  * <i>Digit:</i> one of
- *         <code>0 1 2 3 4 5 6 7 8 9</code>
+ *         {@code 0 1 2 3 4 5 6 7 8 9}
  * </pre></blockquote>
  * For example, TimeZone.getTimeZone("GMT-8").getID() returns "GMT-08:00".
  *
@@ -139,7 +139,7 @@
     }
 
     /**
-     * A style specifier for <code>getDisplayName()</code> indicating
+     * A style specifier for {@code getDisplayName()} indicating
      * a short name, such as "PST."
      * @see #LONG
      * @since 1.2
@@ -147,7 +147,7 @@
     public static final int SHORT = 0;
 
     /**
-     * A style specifier for <code>getDisplayName()</code> indicating
+     * A style specifier for {@code getDisplayName()} indicating
      * a long name, such as "Pacific Standard Time."
      * @see #SHORT
      * @since 1.2
@@ -168,7 +168,7 @@
      * daylight savings. This is the offset to add to UTC to get local time.
      * <p>
      * This method returns a historically correct offset if an
-     * underlying <code>TimeZone</code> implementation subclass
+     * underlying {@code TimeZone} implementation subclass
      * supports historical Daylight Saving Time schedule and GMT
      * offset changes.
      *
@@ -246,7 +246,7 @@
      * Sets the base time zone offset to GMT.
      * This is the offset to add to UTC to get local time.
      * <p>
-     * If an underlying <code>TimeZone</code> implementation subclass
+     * If an underlying {@code TimeZone} implementation subclass
      * supports historical GMT offset changes, the specified GMT
      * offset is set as the latest GMT offset and the difference from
      * the known latest GMT offset value is used to adjust all
@@ -262,7 +262,7 @@
      * affected by daylight saving time, it is called <I>raw
      * offset</I>.
      * <p>
-     * If an underlying <code>TimeZone</code> implementation subclass
+     * If an underlying {@code TimeZone} implementation subclass
      * supports historical GMT offset changes, the method returns the
      * raw offset value of the current date. In Honolulu, for example,
      * its raw offset changed from GMT-10:30 to GMT-10:00 in 1947, and
@@ -376,10 +376,10 @@
      *
      * <p>When looking up a time zone name, the {@linkplain
      * ResourceBundle.Control#getCandidateLocales(String,Locale) default
-     * <code>Locale</code> search path of <code>ResourceBundle</code>} derived
+     * {@code Locale} search path of {@code ResourceBundle}} derived
      * from the specified {@code locale} is used. (No {@linkplain
      * ResourceBundle.Control#getFallbackLocale(String,Locale) fallback
-     * <code>Locale</code>} search is performed.) If a time zone name in any
+     * {@code Locale}} search is performed.) If a time zone name in any
      * {@code Locale} of the search path, including {@link Locale#ROOT}, is
      * found, the name is returned. Otherwise, a string in the
      * <a href="#NormalizedCustomID">normalized custom ID format</a> is returned.
@@ -504,14 +504,14 @@
     public abstract boolean inDaylightTime(Date date);
 
     /**
-     * Gets the <code>TimeZone</code> for the given ID.
+     * Gets the {@code TimeZone} for the given ID.
      *
-     * @param ID the ID for a <code>TimeZone</code>, either an abbreviation
+     * @param ID the ID for a {@code TimeZone}, either an abbreviation
      * such as "PST", a full name such as "America/Los_Angeles", or a custom
      * ID such as "GMT-8:00". Note that the support of abbreviations is
      * for JDK 1.1.x compatibility only and full names should be used.
      *
-     * @return the specified <code>TimeZone</code>, or the GMT zone if the given ID
+     * @return the specified {@code TimeZone}, or the GMT zone if the given ID
      * cannot be understood.
      */
     public static synchronized TimeZone getTimeZone(String ID) {
@@ -733,7 +733,7 @@
      * Returns true if this zone has the same rule and offset as another zone.
      * That is, if this zone differs only in ID, if at all.  Returns false
      * if the other zone is null.
-     * @param other the <code>TimeZone</code> object to be compared with
+     * @param other the {@code TimeZone} object to be compared with
      * @return true if the other zone is not null and is the same as this one,
      * with the possible exception of the ID
      * @since 1.2
@@ -744,9 +744,9 @@
     }
 
     /**
-     * Creates a copy of this <code>TimeZone</code>.
+     * Creates a copy of this {@code TimeZone}.
      *
-     * @return a clone of this <code>TimeZone</code>
+     * @return a clone of this {@code TimeZone}
      */
     public Object clone()
     {
@@ -765,10 +765,10 @@
     // =======================privates===============================
 
     /**
-     * The string identifier of this <code>TimeZone</code>.  This is a
-     * programmatic identifier used internally to look up <code>TimeZone</code>
+     * The string identifier of this {@code TimeZone}.  This is a
+     * programmatic identifier used internally to look up {@code TimeZone}
      * objects from the system table and also to map them to their localized
-     * display names.  <code>ID</code> values are unique in the system
+     * display names.  {@code ID} values are unique in the system
      * table but may not be for dynamically created zones.
      * @serial
      */
--- a/src/java.base/share/classes/java/util/TooManyListenersException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/TooManyListenersException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -27,7 +27,7 @@
 
 /**
  * <p>
- * The <code> TooManyListenersException </code> Exception is used as part of
+ * The {@code  TooManyListenersException } Exception is used as part of
  * the Java Event model to annotate and implement a unicast special case of
  * a multicast Event Source.
  * </p>
--- a/src/java.base/share/classes/java/util/jar/JarEntry.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/jar/JarEntry.java	Wed Sep 25 22:40:41 2019 +0200
@@ -42,11 +42,11 @@
     CodeSigner[] signers;
 
     /**
-     * Creates a new <code>JarEntry</code> for the specified JAR file
+     * Creates a new {@code JarEntry} for the specified JAR file
      * entry name.
      *
      * @param name the JAR file entry name
-     * @throws    NullPointerException if the entry name is <code>null</code>
+     * @throws    NullPointerException if the entry name is {@code null}
      * @throws    IllegalArgumentException if the entry name is longer than
      *            0xFFFF bytes.
      */
@@ -55,20 +55,20 @@
     }
 
     /**
-     * Creates a new <code>JarEntry</code> with fields taken from the
-     * specified <code>ZipEntry</code> object.
-     * @param ze the <code>ZipEntry</code> object to create the
-     *           <code>JarEntry</code> from
+     * Creates a new {@code JarEntry} with fields taken from the
+     * specified {@code ZipEntry} object.
+     * @param ze the {@code ZipEntry} object to create the
+     *           {@code JarEntry} from
      */
     public JarEntry(ZipEntry ze) {
         super(ze);
     }
 
     /**
-     * Creates a new <code>JarEntry</code> with fields taken from the
-     * specified <code>JarEntry</code> object.
+     * Creates a new {@code JarEntry} with fields taken from the
+     * specified {@code JarEntry} object.
      *
-     * @param je the <code>JarEntry</code> to copy
+     * @param je the {@code JarEntry} to copy
      */
     public JarEntry(JarEntry je) {
         this((ZipEntry)je);
@@ -78,11 +78,11 @@
     }
 
     /**
-     * Returns the <code>Manifest</code> <code>Attributes</code> for this
-     * entry, or <code>null</code> if none.
+     * Returns the {@code Manifest} {@code Attributes} for this
+     * entry, or {@code null} if none.
      *
-     * @return the <code>Manifest</code> <code>Attributes</code> for this
-     * entry, or <code>null</code> if none
+     * @return the {@code Manifest} {@code Attributes} for this
+     * entry, or {@code null} if none
      * @throws IOException  if an I/O error has occurred
      */
     public Attributes getAttributes() throws IOException {
@@ -90,11 +90,11 @@
     }
 
     /**
-     * Returns the <code>Certificate</code> objects for this entry, or
-     * <code>null</code> if none. This method can only be called once
-     * the <code>JarEntry</code> has been completely verified by reading
+     * Returns the {@code Certificate} objects for this entry, or
+     * {@code null} if none. This method can only be called once
+     * the {@code JarEntry} has been completely verified by reading
      * from the entry input stream until the end of the stream has been
-     * reached. Otherwise, this method will return <code>null</code>.
+     * reached. Otherwise, this method will return {@code null}.
      *
      * <p>The returned certificate array comprises all the signer certificates
      * that were used to verify this entry. Each signer certificate is
@@ -103,25 +103,25 @@
      * bottom-to-top (i.e., with the signer certificate first and the (root)
      * certificate authority last).
      *
-     * @return the <code>Certificate</code> objects for this entry, or
-     * <code>null</code> if none.
+     * @return the {@code Certificate} objects for this entry, or
+     * {@code null} if none.
      */
     public Certificate[] getCertificates() {
         return certs == null ? null : certs.clone();
     }
 
     /**
-     * Returns the <code>CodeSigner</code> objects for this entry, or
-     * <code>null</code> if none. This method can only be called once
-     * the <code>JarEntry</code> has been completely verified by reading
+     * Returns the {@code CodeSigner} objects for this entry, or
+     * {@code null} if none. This method can only be called once
+     * the {@code JarEntry} has been completely verified by reading
      * from the entry input stream until the end of the stream has been
-     * reached. Otherwise, this method will return <code>null</code>.
+     * reached. Otherwise, this method will return {@code null}.
      *
      * <p>The returned array comprises all the code signers that have signed
      * this entry.
      *
-     * @return the <code>CodeSigner</code> objects for this entry, or
-     * <code>null</code> if none.
+     * @return the {@code CodeSigner} objects for this entry, or
+     * {@code null} if none.
      *
      * @since 1.5
      */
--- a/src/java.base/share/classes/java/util/jar/JarInputStream.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/jar/JarInputStream.java	Wed Sep 25 22:40:41 2019 +0200
@@ -31,10 +31,10 @@
 import jdk.internal.util.jar.JarIndex;
 
 /**
- * The <code>JarInputStream</code> class is used to read the contents of
+ * The {@code JarInputStream} class is used to read the contents of
  * a JAR file from any input stream. It extends the class
- * <code>java.util.zip.ZipInputStream</code> with support for reading
- * an optional <code>Manifest</code> entry. The <code>Manifest</code>
+ * {@code java.util.zip.ZipInputStream} with support for reading
+ * an optional {@code Manifest} entry. The {@code Manifest}
  * can be used to store meta-information about the JAR file and its entries.
  *
  * @author  David Connelly
@@ -52,7 +52,7 @@
     private boolean tryManifest;
 
     /**
-     * Creates a new <code>JarInputStream</code> and reads the optional
+     * Creates a new {@code JarInputStream} and reads the optional
      * manifest. If a manifest is present, also attempts to verify
      * the signatures if the JarInputStream is signed.
      * @param in the actual input stream
@@ -63,7 +63,7 @@
     }
 
     /**
-     * Creates a new <code>JarInputStream</code> and reads the optional
+     * Creates a new {@code JarInputStream} and reads the optional
      * manifest. If a manifest is present and verify is true, also attempts
      * to verify the signatures if the JarInputStream is signed.
      *
@@ -116,11 +116,11 @@
     }
 
     /**
-     * Returns the <code>Manifest</code> for this JAR file, or
-     * <code>null</code> if none.
+     * Returns the {@code Manifest} for this JAR file, or
+     * {@code null} if none.
      *
-     * @return the <code>Manifest</code> for this JAR file, or
-     *         <code>null</code> if none.
+     * @return the {@code Manifest} for this JAR file, or
+     *         {@code null} if none.
      */
     public Manifest getManifest() {
         return man;
@@ -181,21 +181,21 @@
 
     /**
      * Reads from the current JAR file entry into an array of bytes.
-     * If <code>len</code> is not zero, the method
+     * If {@code len} is not zero, the method
      * blocks until some input is available; otherwise, no
-     * bytes are read and <code>0</code> is returned.
+     * bytes are read and {@code 0} is returned.
      * If verification has been enabled, any invalid signature
      * on the current entry will be reported at some point before the
      * end of the entry is reached.
      * @param b the buffer into which the data is read
-     * @param off the start offset in the destination array <code>b</code>
+     * @param off the start offset in the destination array {@code b}
      * @param len the maximum number of bytes to read
      * @return the actual number of bytes read, or -1 if the end of the
      *         entry is reached
-     * @throws     NullPointerException If <code>b</code> is <code>null</code>.
-     * @throws     IndexOutOfBoundsException If <code>off</code> is negative,
-     * <code>len</code> is negative, or <code>len</code> is greater than
-     * <code>b.length - off</code>
+     * @throws     NullPointerException If {@code b} is {@code null}.
+     * @throws     IndexOutOfBoundsException If {@code off} is negative,
+     * {@code len} is negative, or {@code len} is greater than
+     * {@code b.length - off}
      * @throws    ZipException if a ZIP file error has occurred
      * @throws    IOException if an I/O error has occurred
      * @throws    SecurityException if any of the jar file entries
@@ -215,13 +215,13 @@
     }
 
     /**
-     * Creates a new <code>JarEntry</code> (<code>ZipEntry</code>) for the
+     * Creates a new {@code JarEntry} ({@code ZipEntry}) for the
      * specified JAR file entry name. The manifest attributes of
      * the specified JAR file entry name will be copied to the new
      * <CODE>JarEntry</CODE>.
      *
      * @param name the name of the JAR/ZIP file entry
-     * @return the <code>JarEntry</code> object just created
+     * @return the {@code JarEntry} object just created
      */
     protected ZipEntry createZipEntry(String name) {
         JarEntry e = new JarEntry(name);
--- a/src/java.base/share/classes/java/util/jar/JarOutputStream.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/jar/JarOutputStream.java	Wed Sep 25 22:40:41 2019 +0200
@@ -29,11 +29,11 @@
 import java.io.*;
 
 /**
- * The <code>JarOutputStream</code> class is used to write the contents
+ * The {@code JarOutputStream} class is used to write the contents
  * of a JAR file to any output stream. It extends the class
- * <code>java.util.zip.ZipOutputStream</code> with support
- * for writing an optional <code>Manifest</code> entry. The
- * <code>Manifest</code> can be used to specify meta-information about
+ * {@code java.util.zip.ZipOutputStream} with support
+ * for writing an optional {@code Manifest} entry. The
+ * {@code Manifest} can be used to specify meta-information about
  * the JAR file and its entries.
  *
  * @author  David Connelly
@@ -46,12 +46,12 @@
     private static final int JAR_MAGIC = 0xCAFE;
 
     /**
-     * Creates a new <code>JarOutputStream</code> with the specified
-     * <code>Manifest</code>. The manifest is written as the first
+     * Creates a new {@code JarOutputStream} with the specified
+     * {@code Manifest}. The manifest is written as the first
      * entry to the output stream.
      *
      * @param out the actual output stream
-     * @param man the optional <code>Manifest</code>
+     * @param man the optional {@code Manifest}
      * @throws    IOException if an I/O error has occurred
      */
     public JarOutputStream(OutputStream out, Manifest man) throws IOException {
@@ -66,7 +66,7 @@
     }
 
     /**
-     * Creates a new <code>JarOutputStream</code> with no manifest.
+     * Creates a new {@code JarOutputStream} with no manifest.
      * @param out the actual output stream
      * @throws    IOException if an I/O error has occurred
      */
--- a/src/java.base/share/classes/java/util/jar/package-info.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/jar/package-info.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -31,7 +31,7 @@
  *
  * <h2>Package Specification</h2>
  *
- * The <code>java.util.jar</code> package is based on the following
+ * The {@code java.util.jar} package is based on the following
  * specifications:
  *
  * <ul>
--- a/src/java.base/share/classes/java/util/regex/Pattern.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/regex/Pattern.java	Wed Sep 25 22:40:41 2019 +0200
@@ -357,7 +357,7 @@
  * <a href="#UNIX_LINES">d</a> <a href="#MULTILINE">m</a> <a href="#DOTALL">s</a>
  * <a href="#UNICODE_CASE">u</a> <a href="#COMMENTS">x</a> <a href="#UNICODE_CHARACTER_CLASS">U</a>
  * on - off</td></tr>
- * <tr><th style="vertical-align:top; font-weight:normal" id="non_capture_group_flags"><code>(?idmsuxU-idmsuxU:</code><i>X</i>{@code )}&nbsp;&nbsp;</th>
+ * <tr><th style="vertical-align:top; font-weight:normal" id="non_capture_group_flags">{@code (?idmsuxU-idmsuxU:}<i>X</i>{@code )}&nbsp;&nbsp;</th>
  *     <td headers="matches special non_capture_group_flags"><i>X</i>, as a <a href="#cg">non-capturing group</a> with the
  *         given flags <a href="#CASE_INSENSITIVE">i</a> <a href="#UNIX_LINES">d</a>
  * <a href="#MULTILINE">m</a> <a href="#DOTALL">s</a> <a href="#UNICODE_CASE">u</a >
--- a/src/java.base/share/classes/java/util/regex/package-info.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/regex/package-info.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, 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
@@ -37,7 +37,7 @@
  * interface in order to support matching against characters from a
  * wide variety of input sources. </p>
  *
- * <p> Unless otherwise noted, passing a <code>null</code> argument to a
+ * <p> Unless otherwise noted, passing a {@code null} argument to a
  * method in any class or interface in this package will cause a
  * {@link java.lang.NullPointerException NullPointerException} to be
  * thrown.
--- a/src/java.base/share/classes/java/util/spi/CalendarNameProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/spi/CalendarNameProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -190,9 +190,9 @@
 
     /**
      * Returns the string representation (display name) of the calendar
-     * <code>field value</code> in the given <code>style</code> and
-     * <code>locale</code>.  If no string representation is
-     * applicable, <code>null</code> is returned.
+     * {@code field value} in the given {@code style} and
+     * {@code locale}.  If no string representation is
+     * applicable, {@code null} is returned.
      *
      * <p>{@code field} is a {@code Calendar} field index, such as {@link
      * Calendar#MONTH}. The time zone fields, {@link Calendar#ZONE_OFFSET} and
--- a/src/java.base/share/classes/java/util/spi/CurrencyNameProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/spi/CurrencyNameProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -63,10 +63,10 @@
      * @param locale the desired locale
      * @return the symbol of the given currency code for the specified locale, or null if
      *     the symbol is not available for the locale
-     * @throws    NullPointerException if <code>currencyCode</code> or
-     *     <code>locale</code> is null
-     * @throws    IllegalArgumentException if <code>currencyCode</code> is not in
-     *     the form of three upper-case letters, or <code>locale</code> isn't
+     * @throws    NullPointerException if {@code currencyCode} or
+     *     {@code locale} is null
+     * @throws    IllegalArgumentException if {@code currencyCode} is not in
+     *     the form of three upper-case letters, or {@code locale} isn't
      *     one of the locales returned from
      *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
      *     getAvailableLocales()}.
@@ -84,13 +84,13 @@
      * @param locale the desired locale
      * @return the name for the currency that is appropriate for display to the
      *     user, or null if the name is not available for the locale
-     * @throws    IllegalArgumentException if <code>currencyCode</code> is not in
-     *     the form of three upper-case letters, or <code>locale</code> isn't
+     * @throws    IllegalArgumentException if {@code currencyCode} is not in
+     *     the form of three upper-case letters, or {@code locale} isn't
      *     one of the locales returned from
      *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
      *     getAvailableLocales()}.
-     * @throws    NullPointerException if <code>currencyCode</code> or
-     *     <code>locale</code> is <code>null</code>
+     * @throws    NullPointerException if {@code currencyCode} or
+     *     {@code locale} is {@code null}
      * @since 1.7
      */
     public String getDisplayName(String currencyCode, Locale locale) {
--- a/src/java.base/share/classes/java/util/spi/LocaleNameProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/spi/LocaleNameProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -48,10 +48,10 @@
      * Returns a localized name for the given <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt">
      * IETF BCP47</a> language code and the given locale that is appropriate for
      * display to the user.
-     * For example, if <code>languageCode</code> is "fr" and <code>locale</code>
-     * is en_US, getDisplayLanguage() will return "French"; if <code>languageCode</code>
-     * is "en" and <code>locale</code> is fr_FR, getDisplayLanguage() will return "anglais".
-     * If the name returned cannot be localized according to <code>locale</code>,
+     * For example, if {@code languageCode} is "fr" and {@code locale}
+     * is en_US, getDisplayLanguage() will return "French"; if {@code languageCode}
+     * is "en" and {@code locale} is fr_FR, getDisplayLanguage() will return "anglais".
+     * If the name returned cannot be localized according to {@code locale},
      * (say, the provider does not have a Japanese name for Croatian),
      * this method returns null.
      * @param languageCode the language code string in the form of two to eight
@@ -59,9 +59,9 @@
      * @param locale the desired locale
      * @return the name of the given language code for the specified locale, or null if it's not
      *     available.
-     * @throws    NullPointerException if <code>languageCode</code> or <code>locale</code> is null
-     * @throws    IllegalArgumentException if <code>languageCode</code> is not in the form of
-     *     two or three lower-case letters, or <code>locale</code> isn't
+     * @throws    NullPointerException if {@code languageCode} or {@code locale} is null
+     * @throws    IllegalArgumentException if {@code languageCode} is not in the form of
+     *     two or three lower-case letters, or {@code locale} isn't
      *     one of the locales returned from
      *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
      *     getAvailableLocales()}.
@@ -73,10 +73,10 @@
      * Returns a localized name for the given <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt">
      * IETF BCP47</a> script code and the given locale that is appropriate for
      * display to the user.
-     * For example, if <code>scriptCode</code> is "Latn" and <code>locale</code>
-     * is en_US, getDisplayScript() will return "Latin"; if <code>scriptCode</code>
-     * is "Cyrl" and <code>locale</code> is fr_FR, getDisplayScript() will return "cyrillique".
-     * If the name returned cannot be localized according to <code>locale</code>,
+     * For example, if {@code scriptCode} is "Latn" and {@code locale}
+     * is en_US, getDisplayScript() will return "Latin"; if {@code scriptCode}
+     * is "Cyrl" and {@code locale} is fr_FR, getDisplayScript() will return "cyrillique".
+     * If the name returned cannot be localized according to {@code locale},
      * (say, the provider does not have a Japanese name for Cyrillic),
      * this method returns null. The default implementation returns null.
      * @param scriptCode the four letter script code string in the form of title-case
@@ -86,9 +86,9 @@
      * @param locale the desired locale
      * @return the name of the given script code for the specified locale, or null if it's not
      *     available.
-     * @throws    NullPointerException if <code>scriptCode</code> or <code>locale</code> is null
-     * @throws    IllegalArgumentException if <code>scriptCode</code> is not in the form of
-     *     four title case letters, or <code>locale</code> isn't
+     * @throws    NullPointerException if {@code scriptCode} or {@code locale} is null
+     * @throws    IllegalArgumentException if {@code scriptCode} is not in the form of
+     *     four title case letters, or {@code locale} isn't
      *     one of the locales returned from
      *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
      *     getAvailableLocales()}.
@@ -103,10 +103,10 @@
      * Returns a localized name for the given <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt">
      * IETF BCP47</a> region code (either ISO 3166 country code or UN M.49 area
      * codes) and the given locale that is appropriate for display to the user.
-     * For example, if <code>countryCode</code> is "FR" and <code>locale</code>
-     * is en_US, getDisplayCountry() will return "France"; if <code>countryCode</code>
-     * is "US" and <code>locale</code> is fr_FR, getDisplayCountry() will return "Etats-Unis".
-     * If the name returned cannot be localized according to <code>locale</code>,
+     * For example, if {@code countryCode} is "FR" and {@code locale}
+     * is en_US, getDisplayCountry() will return "France"; if {@code countryCode}
+     * is "US" and {@code locale} is fr_FR, getDisplayCountry() will return "Etats-Unis".
+     * If the name returned cannot be localized according to {@code locale},
      * (say, the provider does not have a Japanese name for Croatia),
      * this method returns null.
      * @param countryCode the country(region) code string in the form of two
@@ -115,9 +115,9 @@
      * @param locale the desired locale
      * @return the name of the given country code for the specified locale, or null if it's not
      *     available.
-     * @throws    NullPointerException if <code>countryCode</code> or <code>locale</code> is null
-     * @throws    IllegalArgumentException if <code>countryCode</code> is not in the form of
-     *     two upper-case letters or three digit letters, or <code>locale</code> isn't
+     * @throws    NullPointerException if {@code countryCode} or {@code locale} is null
+     * @throws    IllegalArgumentException if {@code countryCode} is not in the form of
+     *     two upper-case letters or three digit letters, or {@code locale} isn't
      *     one of the locales returned from
      *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
      *     getAvailableLocales()}.
@@ -128,14 +128,14 @@
     /**
      * Returns a localized name for the given variant code and the given locale that
      * is appropriate for display to the user.
-     * If the name returned cannot be localized according to <code>locale</code>,
+     * If the name returned cannot be localized according to {@code locale},
      * this method returns null.
      * @param variant the variant string
      * @param locale the desired locale
      * @return the name of the given variant string for the specified locale, or null if it's not
      *     available.
-     * @throws    NullPointerException if <code>variant</code> or <code>locale</code> is null
-     * @throws    IllegalArgumentException if <code>locale</code> isn't
+     * @throws    NullPointerException if {@code variant} or {@code locale} is null
+     * @throws    IllegalArgumentException if {@code locale} isn't
      *     one of the locales returned from
      *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
      *     getAvailableLocales()}.
--- a/src/java.base/share/classes/java/util/spi/LocaleServiceProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/spi/LocaleServiceProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -33,12 +33,12 @@
  * interfaces (SPIs).
  * <p>
  * Locale sensitive  service provider interfaces are interfaces that
- * correspond to locale sensitive classes in the <code>java.text</code>
- * and <code>java.util</code> packages. The interfaces enable the
+ * correspond to locale sensitive classes in the {@code java.text}
+ * and {@code java.util} packages. The interfaces enable the
  * construction of locale sensitive objects and the retrieval of
  * localized names for these packages. Locale sensitive factory methods
- * and methods for name retrieval in the <code>java.text</code> and
- * <code>java.util</code> packages use implementations of the provider
+ * and methods for name retrieval in the {@code java.text} and
+ * {@code java.util} packages use implementations of the provider
  * interfaces to offer support for locales beyond the set of locales
  * supported by the Java runtime environment itself.
  *
@@ -68,17 +68,17 @@
  * <pre>
  * META-INF/services/java.text.spi.DateFormatProvider
  * </pre>
- * And the file <code>java.text.spi.DateFormatProvider</code> should have
+ * And the file {@code java.text.spi.DateFormatProvider} should have
  * a line such as:
  * <pre>
- * <code>com.foo.DateFormatProviderImpl</code>
+ * {@code com.foo.DateFormatProviderImpl}
  * </pre>
  * which is the fully qualified class name of the class implementing
- * <code>DateFormatProvider</code>.
+ * {@code DateFormatProvider}.
  * <h3>Invocation of Locale Sensitive Services</h3>
  * <p>
  * Locale sensitive factory methods and methods for name retrieval in the
- * <code>java.text</code> and <code>java.util</code> packages invoke
+ * {@code java.text} and {@code java.util} packages invoke
  * service provider methods when needed to support the requested locale.
  * The methods first check whether the Java runtime environment itself
  * supports the requested locale, and use its support if available.
@@ -93,7 +93,7 @@
  * supports the requested locale, the methods go through a list of candidate
  * locales and repeat the availability check for each until a match is found.
  * The algorithm used for creating a list of candidate locales is same as
- * the one used by <code>ResourceBundle</code> by default (see
+ * the one used by {@code ResourceBundle} by default (see
  * {@link java.util.ResourceBundle.Control#getCandidateLocales getCandidateLocales}
  * for the details).  Even if a locale is resolved from the candidate list,
  * methods that return requested objects or names are invoked with the original
@@ -104,7 +104,7 @@
  * Providers of names (but not providers of other objects) are allowed to
  * return null for some name requests even for locales that they claim to
  * support by including them in their return value for
- * <code>getAvailableLocales</code>. Similarly, the Java runtime
+ * {@code getAvailableLocales}. Similarly, the Java runtime
  * environment itself may not have all names for all locales that it
  * supports. This is because the sets of objects for which names are
  * requested can be large and vary over time, so that it's not always
--- a/src/java.base/share/classes/java/util/spi/TimeZoneNameProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/spi/TimeZoneNameProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -57,7 +57,7 @@
      * "tzdata", and the specification of the data format is part of the zic.8
      * man page, which is contained in a file whose name starts with "tzcode".
      * <p>
-     * If <code>daylight</code> is true, the method should return a name
+     * If {@code daylight} is true, the method should return a name
      * appropriate for daylight saving time even if the specified time zone
      * has not observed daylight saving time in the past.
      *
@@ -68,11 +68,11 @@
      * @param locale the desired locale
      * @return the human-readable name of the given time zone in the
      *     given locale, or null if it's not available.
-     * @throws    IllegalArgumentException if <code>style</code> is invalid,
-     *     or <code>locale</code> isn't one of the locales returned from
+     * @throws    IllegalArgumentException if {@code style} is invalid,
+     *     or {@code locale} isn't one of the locales returned from
      *     {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
      *     getAvailableLocales()}.
-     * @throws    NullPointerException if <code>ID</code> or <code>locale</code>
+     * @throws    NullPointerException if {@code ID} or {@code locale}
      *     is null
      * @see java.util.TimeZone#getDisplayName(boolean, int, java.util.Locale)
      */
@@ -96,11 +96,11 @@
      * @param locale the desired locale
      * @return the human-readable generic name of the given time zone in the
      *     given locale, or {@code null} if it's not available.
-     * @throws    IllegalArgumentException if <code>style</code> is invalid,
-     *     or <code>locale</code> isn't one of the locales returned from
+     * @throws    IllegalArgumentException if {@code style} is invalid,
+     *     or {@code locale} isn't one of the locales returned from
      *     {@link LocaleServiceProvider#getAvailableLocales()
      *     getAvailableLocales()}.
-     * @throws    NullPointerException if <code>ID</code> or <code>locale</code>
+     * @throws    NullPointerException if {@code ID} or {@code locale}
      *     is {@code null}
      * @since 1.8
      */
--- a/src/java.base/share/classes/java/util/zip/CheckedInputStream.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/zip/CheckedInputStream.java	Wed Sep 25 22:40:41 2019 +0200
@@ -65,18 +65,18 @@
     }
 
     /**
-     * Reads into an array of bytes. If <code>len</code> is not zero, the method
+     * Reads into an array of bytes. If {@code len} is not zero, the method
      * blocks until some input is available; otherwise, no
-     * bytes are read and <code>0</code> is returned.
+     * bytes are read and {@code 0} is returned.
      * @param buf the buffer into which the data is read
-     * @param off the start offset in the destination array <code>b</code>
+     * @param off the start offset in the destination array {@code b}
      * @param len the maximum number of bytes read
      * @return    the actual number of bytes read, or -1 if the end
      *            of the stream is reached.
-     * @throws     NullPointerException If <code>buf</code> is <code>null</code>.
-     * @throws     IndexOutOfBoundsException If <code>off</code> is negative,
-     * <code>len</code> is negative, or <code>len</code> is greater than
-     * <code>buf.length - off</code>
+     * @throws     NullPointerException If {@code buf} is {@code null}.
+     * @throws     IndexOutOfBoundsException If {@code off} is negative,
+     * {@code len} is negative, or {@code len} is greater than
+     * {@code buf.length - off}
      * @throws    IOException if an I/O error has occurred
      */
     public int read(byte[] buf, int off, int len) throws IOException {
--- a/src/java.base/share/classes/java/util/zip/GZIPInputStream.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/zip/GZIPInputStream.java	Wed Sep 25 22:40:41 2019 +0200
@@ -93,19 +93,19 @@
     }
 
     /**
-     * Reads uncompressed data into an array of bytes. If <code>len</code> is not
+     * Reads uncompressed data into an array of bytes. If {@code len} is not
      * zero, the method will block until some input can be decompressed; otherwise,
-     * no bytes are read and <code>0</code> is returned.
+     * no bytes are read and {@code 0} is returned.
      * @param buf the buffer into which the data is read
-     * @param off the start offset in the destination array <code>b</code>
+     * @param off the start offset in the destination array {@code b}
      * @param len the maximum number of bytes read
      * @return  the actual number of bytes read, or -1 if the end of the
      *          compressed input stream is reached
      *
-     * @throws     NullPointerException If <code>buf</code> is <code>null</code>.
-     * @throws     IndexOutOfBoundsException If <code>off</code> is negative,
-     * <code>len</code> is negative, or <code>len</code> is greater than
-     * <code>buf.length - off</code>
+     * @throws     NullPointerException If {@code buf} is {@code null}.
+     * @throws     IndexOutOfBoundsException If {@code off} is negative,
+     * {@code len} is negative, or {@code len} is greater than
+     * {@code buf.length - off}
      * @throws    ZipException if the compressed input data is corrupt.
      * @throws    IOException if an I/O error has occurred.
      *
--- a/src/java.base/share/classes/java/util/zip/InflaterInputStream.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/zip/InflaterInputStream.java	Wed Sep 25 22:40:41 2019 +0200
@@ -124,18 +124,18 @@
     }
 
     /**
-     * Reads uncompressed data into an array of bytes. If <code>len</code> is not
+     * Reads uncompressed data into an array of bytes. If {@code len} is not
      * zero, the method will block until some input can be decompressed; otherwise,
-     * no bytes are read and <code>0</code> is returned.
+     * no bytes are read and {@code 0} is returned.
      * @param b the buffer into which the data is read
-     * @param off the start offset in the destination array <code>b</code>
+     * @param off the start offset in the destination array {@code b}
      * @param len the maximum number of bytes read
      * @return the actual number of bytes read, or -1 if the end of the
      *         compressed input is reached or a preset dictionary is needed
-     * @throws     NullPointerException If <code>b</code> is <code>null</code>.
-     * @throws     IndexOutOfBoundsException If <code>off</code> is negative,
-     * <code>len</code> is negative, or <code>len</code> is greater than
-     * <code>b.length - off</code>
+     * @throws     NullPointerException If {@code b} is {@code null}.
+     * @throws     IndexOutOfBoundsException If {@code off} is negative,
+     * {@code len} is negative, or {@code len} is greater than
+     * {@code b.length - off}
      * @throws    ZipException if a ZIP format error has occurred
      * @throws    IOException if an I/O error has occurred
      */
@@ -248,13 +248,13 @@
     }
 
     /**
-     * Tests if this input stream supports the <code>mark</code> and
-     * <code>reset</code> methods. The <code>markSupported</code>
-     * method of <code>InflaterInputStream</code> returns
-     * <code>false</code>.
+     * Tests if this input stream supports the {@code mark} and
+     * {@code reset} methods. The {@code markSupported}
+     * method of {@code InflaterInputStream} returns
+     * {@code false}.
      *
-     * @return  a <code>boolean</code> indicating if this stream type supports
-     *          the <code>mark</code> and <code>reset</code> methods.
+     * @return  a {@code boolean} indicating if this stream type supports
+     *          the {@code mark} and {@code reset} methods.
      * @see     java.io.InputStream#mark(int)
      * @see     java.io.InputStream#reset()
      */
@@ -265,7 +265,7 @@
     /**
      * Marks the current position in this input stream.
      *
-     * <p> The <code>mark</code> method of <code>InflaterInputStream</code>
+     * <p> The {@code mark} method of {@code InflaterInputStream}
      * does nothing.
      *
      * @param   readlimit   the maximum limit of bytes that can be read before
@@ -277,11 +277,11 @@
 
     /**
      * Repositions this stream to the position at the time the
-     * <code>mark</code> method was last called on this input stream.
+     * {@code mark} method was last called on this input stream.
      *
-     * <p> The method <code>reset</code> for class
-     * <code>InflaterInputStream</code> does nothing except throw an
-     * <code>IOException</code>.
+     * <p> The method {@code reset} for class
+     * {@code InflaterInputStream} does nothing except throw an
+     * {@code IOException}.
      *
      * @throws     IOException  if this method is invoked.
      * @see     java.io.InputStream#mark(int)
--- a/src/java.base/share/classes/java/util/zip/ZipException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/zip/ZipException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -41,7 +41,7 @@
     private static final long serialVersionUID = 8000196834066748623L;
 
     /**
-     * Constructs a <code>ZipException</code> with <code>null</code>
+     * Constructs a {@code ZipException} with {@code null}
      * as its error detail message.
      */
     public ZipException() {
@@ -49,7 +49,7 @@
     }
 
     /**
-     * Constructs a <code>ZipException</code> with the specified detail
+     * Constructs a {@code ZipException} with the specified detail
      * message.
      *
      * @param   s   the detail message.
--- a/src/java.base/share/classes/java/util/zip/ZipInputStream.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/classes/java/util/zip/ZipInputStream.java	Wed Sep 25 22:40:41 2019 +0200
@@ -164,18 +164,18 @@
 
     /**
      * Reads from the current ZIP entry into an array of bytes.
-     * If <code>len</code> is not zero, the method
+     * If {@code len} is not zero, the method
      * blocks until some input is available; otherwise, no
-     * bytes are read and <code>0</code> is returned.
+     * bytes are read and {@code 0} is returned.
      * @param b the buffer into which the data is read
-     * @param off the start offset in the destination array <code>b</code>
+     * @param off the start offset in the destination array {@code b}
      * @param len the maximum number of bytes read
      * @return the actual number of bytes read, or -1 if the end of the
      *         entry is reached
-     * @throws     NullPointerException if <code>b</code> is <code>null</code>.
-     * @throws     IndexOutOfBoundsException if <code>off</code> is negative,
-     * <code>len</code> is negative, or <code>len</code> is greater than
-     * <code>b.length - off</code>
+     * @throws     NullPointerException if {@code b} is {@code null}.
+     * @throws     IndexOutOfBoundsException if {@code off} is negative,
+     * {@code len} is negative, or {@code len} is greater than
+     * {@code b.length - off}
      * @throws    ZipException if a ZIP file error has occurred
      * @throws    IOException if an I/O error has occurred
      */
@@ -327,7 +327,7 @@
     }
 
     /**
-     * Creates a new <code>ZipEntry</code> object for the specified
+     * Creates a new {@code ZipEntry} object for the specified
      * entry name.
      *
      * @param name the ZIP file entry name
--- a/src/java.base/share/native/libjli/java.c	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/native/libjli/java.c	Wed Sep 25 22:40:41 2019 +0200
@@ -338,9 +338,6 @@
     /* Set the -Dsun.java.launcher pseudo property */
     SetJavaLauncherProp();
 
-    /* set the -Dsun.java.launcher.* platform properties */
-    SetJavaLauncherPlatformProps();
-
     return JVMInit(&ifn, threadStackSize, argc, argv, mode, what, ret);
 }
 /*
--- a/src/java.base/share/native/libjli/java.h	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/share/native/libjli/java.h	Wed Sep 25 22:40:41 2019 +0200
@@ -161,7 +161,6 @@
 int CallJavaMainInNewThread(jlong stack_size, void* args);
 
 /* sun.java.launcher.* platform properties. */
-void SetJavaLauncherPlatformProps(void);
 void SetJavaCommandLineProp(char* what, int argc, char** argv);
 void SetJavaLauncherProp(void);
 
--- a/src/java.base/unix/classes/sun/nio/ch/InheritedChannel.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/unix/classes/sun/nio/ch/InheritedChannel.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, 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
@@ -43,6 +43,12 @@
     private static final int SOCK_STREAM        = 1;
     private static final int SOCK_DGRAM         = 2;
 
+    // socket address type
+    private static final int AF_UNKNOWN         = -1;
+    private static final int AF_INET            = 1;
+    private static final int AF_INET6           = 2;
+    private static final int AF_UNIX            = 3;
+
     // oflag values when opening a file
     private static final int O_RDONLY           = 0;
     private static final int O_WRONLY           = 1;
@@ -89,6 +95,20 @@
         }
     }
 
+    public static class InheritedUnixChannelImpl extends UnixDomainSocketChannelImpl {
+
+        InheritedUnixChannelImpl(FileDescriptor fd)
+            throws IOException
+        {
+            super(fd);
+        }
+
+        protected void implCloseSelectableChannel() throws IOException {
+            super.implCloseChannel();
+            detachIOStreams();
+        }
+    }
+
     public static class InheritedServerSocketChannelImpl extends
         ServerSocketChannelImpl {
 
@@ -160,7 +180,6 @@
             return null;
         }
 
-
         // Next we create a FileDescriptor for the dup'ed file descriptor
         // Have to use reflection and also make assumption on how FD
         // is implemented.
@@ -182,6 +201,17 @@
 
         Channel c;
         if (st == SOCK_STREAM) {
+            int family = addressFamily(fdVal);
+            if (family == AF_UNKNOWN)
+                return null;
+            if (family == AF_UNIX) {
+                if (isConnected(fdVal)) {
+                    return new InheritedUnixChannelImpl(fd);
+                } else {
+                    // listener. unsupported.
+                    return null;
+                }
+            }
             InetAddress ia = peerAddress0(fdVal);
             if (ia == null) {
                c = new InheritedServerSocketChannelImpl(provider, fd);
@@ -232,9 +262,13 @@
     private static native int open0(String path, int oflag) throws IOException;
     private static native void close0(int fd) throws IOException;
     private static native int soType0(int fd);
+    private static native int addressFamily(int fd);
     private static native InetAddress peerAddress0(int fd);
     private static native int peerPort0(int fd);
 
+    // return true if socket is connected to a peer
+    private static native boolean isConnected(int fd);
+
     static {
         IOUtil.load();
         initIDs();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/unix/classes/sun/nio/ch/UnixDomainSocketChannelImpl.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,266 @@
+/*
+ * 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.nio.ch;
+
+import java.io.FileDescriptor;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.channels.AsynchronousCloseException;
+import java.nio.channels.ByteChannel;
+import java.nio.channels.ClosedChannelException;
+import java.nio.channels.NotYetConnectedException;
+import java.nio.channels.spi.AbstractInterruptibleChannel;
+import java.util.Objects;
+import java.util.concurrent.locks.ReentrantLock;
+
+import static java.util.concurrent.TimeUnit.NANOSECONDS;
+
+class UnixDomainSocketChannelImpl
+    extends AbstractInterruptibleChannel
+    implements ByteChannel
+{
+    // Used to make native read and write calls
+    private static final NativeDispatcher nd = new SocketDispatcher();
+
+    // Our file descriptor object
+    private final FileDescriptor fd;
+    // Lock held by current reading or connecting thread
+    private final ReentrantLock readLock = new ReentrantLock();
+
+    // Lock held by current writing or connecting thread
+    private final ReentrantLock writeLock = new ReentrantLock();
+
+    // Lock for managing close state
+    private final Object stateLock = new Object();
+
+    // Channel state
+    private static final int ST_INUSE = 0;
+    private static final int ST_CLOSING = 1;
+    private static final int ST_CLOSED = 2;
+    private int state;
+
+    // IDs of native threads doing reads and writes, for signalling
+    private long readerThread;
+    private long writerThread;
+
+    UnixDomainSocketChannelImpl(FileDescriptor fd)
+        throws IOException
+    {
+        this.fd = fd;
+    }
+
+    /**
+     * Checks that the channel is open.
+     *
+     * @throws ClosedChannelException if channel is closed (or closing)
+     */
+    private void ensureOpen() throws ClosedChannelException {
+        if (!isOpen())
+            throw new ClosedChannelException();
+    }
+
+    /**
+     * Closes the socket if there are no I/O operations in progress
+     */
+    private boolean tryClose() throws IOException {
+        assert Thread.holdsLock(stateLock) && state == ST_CLOSING;
+        if (readerThread == 0 && writerThread == 0) {
+            state = ST_CLOSED;
+            nd.close(fd);
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * Complete closure of pre-closed socket (release the file descriptor)
+     */
+    private void tryFinishClose() {
+        try {
+            tryClose();
+        } catch (IOException ignore) { }
+    }
+
+    /**
+     * Marks the beginning of a read operation
+     *
+     * @throws ClosedChannelException if the channel is closed
+     * @throws NotYetConnectedException if the channel is not yet connected
+     */
+    private void beginRead() throws ClosedChannelException {
+        // set hook for Thread.interrupt
+        begin();
+        synchronized (stateLock) {
+            ensureOpen();
+            readerThread = NativeThread.current();
+        }
+    }
+
+    /**
+     * Marks the end of a read operation that may have blocked.
+     *
+     * @throws AsynchronousCloseException if the channel was closed due to this
+     * thread being interrupted on a blocking read operation.
+     */
+    private void endRead(boolean completed)
+        throws AsynchronousCloseException
+    {
+        synchronized (stateLock) {
+            readerThread = 0;
+            if (state == ST_CLOSING) {
+                tryFinishClose();
+            }
+        }
+        end(completed);
+    }
+
+    @Override
+    public int read(ByteBuffer buf) throws IOException {
+        Objects.requireNonNull(buf);
+
+        readLock.lock();
+        try {
+            int n = 0;
+            try {
+                beginRead();
+                n = IOUtil.read(fd, buf, -1, nd);
+                while (IOStatus.okayToRetry(n) && isOpen()) {
+                    park(Net.POLLIN, 0L);
+                    n = IOUtil.read(fd, buf, -1, nd);
+                }
+            } finally {
+                endRead(n > 0);
+            }
+            return n;
+        } finally {
+            readLock.unlock();
+        }
+    }
+
+    /**
+     * Marks the beginning of a write operation that might block.
+     *
+     * @throws ClosedChannelException if the channel is closed
+     * @throws NotYetConnectedException if the channel is not yet connected
+     */
+    private void beginWrite() throws ClosedChannelException {
+        begin();
+        synchronized (stateLock) {
+            // set hook for Thread.interrupt
+            ensureOpen();
+            writerThread = NativeThread.current();
+        }
+    }
+
+    /**
+     * Marks the end of a write operation that may have blocked.
+     *
+     * @throws AsynchronousCloseException if the channel was closed due to this
+     * thread being interrupted on a blocking write operation.
+     */
+    private void endWrite(boolean completed)
+        throws AsynchronousCloseException
+    {
+        synchronized (stateLock) {
+            writerThread = 0;
+            if (state == ST_CLOSING) {
+                tryFinishClose();
+            }
+        }
+        end(completed);
+    }
+
+    void park(int event, long nanos) throws IOException {
+        long millis;
+        if (nanos <= 0) {
+            millis = -1;
+        } else {
+            millis = NANOSECONDS.toMillis(nanos);
+        }
+        Net.poll(fd, event, millis);
+    }
+
+    @Override
+    public int write(ByteBuffer buf) throws IOException {
+        Objects.requireNonNull(buf);
+
+        writeLock.lock();
+        try {
+            int n = 0;
+            try {
+                beginWrite();
+                n = IOUtil.write(fd, buf, -1, nd);
+                while (IOStatus.okayToRetry(n) && isOpen()) {
+                    park(Net.POLLOUT, 0L);
+                    n = IOUtil.write(fd, buf, -1, nd);
+                }
+            } finally {
+                endWrite(n > 0);
+            }
+            return n;
+        } finally {
+            writeLock.unlock();
+        }
+    }
+
+    /**
+     * Closes this channel
+     *
+     * If there is an I/O operation in progress then the socket is pre-closed
+     * and the I/O threads signalled, in which case the final close is deferred
+     * until all I/O operations complete.
+     */
+    @Override
+    protected void implCloseChannel() throws IOException {
+        synchronized (stateLock) {
+            assert state == ST_INUSE;
+            state = ST_CLOSING;
+            if (!tryClose()) {
+                long reader = readerThread;
+                long writer = writerThread;
+                if (reader != 0 || writer != 0) {
+                    nd.preClose(fd);
+                    if (reader != 0)
+                        NativeThread.signal(reader);
+                    if (writer != 0)
+                        NativeThread.signal(writer);
+                }
+            }
+        }
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(this.getClass().getSuperclass().getName());
+        sb.append('[');
+        if (!isOpen())
+            sb.append("closed");
+        sb.append(']');
+        return sb.toString();
+    }
+}
--- a/src/java.base/unix/native/libjli/java_md_solinux.c	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/unix/native/libjli/java_md_solinux.c	Wed Sep 25 22:40:41 2019 +0200
@@ -790,16 +790,6 @@
 /* Coarse estimation of number of digits assuming the worst case is a 64-bit pid. */
 #define MAX_PID_STR_SZ   20
 
-void SetJavaLauncherPlatformProps() {
-   /* Linux only */
-#ifdef __linux__
-    const char *substr = "-Dsun.java.launcher.pid=";
-    char *pid_prop_str = (char *)JLI_MemAlloc(JLI_StrLen(substr) + MAX_PID_STR_SZ + 1);
-    sprintf(pid_prop_str, "%s%d", substr, getpid());
-    AddOption(pid_prop_str, NULL);
-#endif /* __linux__ */
-}
-
 int
 JVMInit(InvocationFunctions* ifn, jlong threadStackSize,
         int argc, char **argv,
--- a/src/java.base/unix/native/libnio/ch/InheritedChannel.c	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/unix/native/libnio/ch/InheritedChannel.c	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -82,6 +82,39 @@
 }
 
 JNIEXPORT jint JNICALL
+Java_sun_nio_ch_InheritedChannel_addressFamily(JNIEnv *env, jclass cla, jint fd)
+{
+    SOCKETADDRESS addr;
+    socklen_t addrlen = sizeof(addr);
+
+    if (getsockname(fd, (struct sockaddr *)&addr, &addrlen) < 0) {
+        return sun_nio_ch_InheritedChannel_AF_UNKNOWN;
+    }
+    if (addr.sa.sa_family == AF_INET) {
+        return sun_nio_ch_InheritedChannel_AF_INET;
+    }
+    if (addr.sa.sa_family == AF_INET6) {
+        return sun_nio_ch_InheritedChannel_AF_INET6;
+    }
+    if (addr.sa.sa_family == AF_UNIX) {
+        return sun_nio_ch_InheritedChannel_AF_UNIX;
+    }
+    return sun_nio_ch_InheritedChannel_AF_UNKNOWN;
+}
+
+JNIEXPORT jboolean JNICALL
+Java_sun_nio_ch_InheritedChannel_isConnected(JNIEnv *env, jclass cla, jint fd)
+{
+    SOCKETADDRESS addr;
+    socklen_t addrlen = sizeof(addr);
+
+    if (getpeername(fd, (struct sockaddr *)&addr, &addrlen) < 0) {
+        return JNI_FALSE;
+    }
+    return JNI_TRUE;
+}
+
+JNIEXPORT jint JNICALL
 Java_sun_nio_ch_InheritedChannel_soType0(JNIEnv *env, jclass cla, jint fd)
 {
     int sotype;
--- a/src/java.base/windows/classes/sun/nio/fs/WindowsFileAttributes.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/windows/classes/sun/nio/fs/WindowsFileAttributes.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2012, 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
@@ -108,8 +108,9 @@
     private static final short OFFSETOF_FIND_DATA_SIZELOW = 32;
     private static final short OFFSETOF_FIND_DATA_RESERVED0 = 36;
 
-    // used to adjust values between Windows and java epoch
-    private static final long WINDOWS_EPOCH_IN_MICROSECONDS = -11644473600000000L;
+    // used to adjust values between Windows and java epochs
+    private static final long WINDOWS_EPOCH_IN_MICROS = -11644473600000000L;
+    private static final long WINDOWS_EPOCH_IN_100NS  = -116444736000000000L;
 
     // indicates if accurate metadata is required (interesting on NTFS only)
     private static final boolean ensureAccurateMetadata;
@@ -137,24 +138,23 @@
      * since January 1, 1601 to a FileTime.
      */
     static FileTime toFileTime(long time) {
-        // 100ns -> us
-        time /= 10L;
-        // adjust to java epoch
-        time += WINDOWS_EPOCH_IN_MICROSECONDS;
-        return FileTime.from(time, TimeUnit.MICROSECONDS);
+        try {
+            long adjusted = Math.addExact(time, WINDOWS_EPOCH_IN_100NS);
+            long nanos = Math.multiplyExact(adjusted, 100L);
+            return FileTime.from(nanos, TimeUnit.NANOSECONDS);
+        } catch (ArithmeticException e) {
+            long micros = Math.addExact(time/10L, WINDOWS_EPOCH_IN_MICROS);
+            return FileTime.from(micros, TimeUnit.MICROSECONDS);
+        }
     }
 
     /**
-     * Convert FileTime to 64-bit value representing the number of 100-nanosecond
-     * intervals since January 1, 1601.
+     * Convert FileTime to 64-bit value representing the number of
+     * 100-nanosecond intervals since January 1, 1601.
      */
     static long toWindowsTime(FileTime time) {
-        long value = time.to(TimeUnit.MICROSECONDS);
-        // adjust to Windows epoch+= 11644473600000000L;
-        value -= WINDOWS_EPOCH_IN_MICROSECONDS;
-        // us -> 100ns
-        value *= 10L;
-        return value;
+        long adjusted = time.to(TimeUnit.NANOSECONDS)/100L;
+        return adjusted - WINDOWS_EPOCH_IN_100NS;
     }
 
     /**
--- a/src/java.base/windows/native/libjli/java_md.c	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.base/windows/native/libjli/java_md.c	Wed Sep 25 22:40:41 2019 +0200
@@ -803,9 +803,6 @@
     return rslt;
 }
 
-/* Unix only, empty on windows. */
-void SetJavaLauncherPlatformProps() {}
-
 /*
  * The implementation for finding classes from the bootstrap
  * class loader, refer to java.h
--- a/src/java.desktop/macosx/classes/sun/java2d/opengl/CGLGraphicsConfig.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/macosx/classes/sun/java2d/opengl/CGLGraphicsConfig.java	Wed Sep 25 22:40:41 2019 +0200
@@ -75,7 +75,7 @@
     private BufferCapabilities bufferCaps;
     private long pConfigInfo;
     private ContextCapabilities oglCaps;
-    private OGLContext context;
+    private final OGLContext context;
     private final Object disposerReferent = new Object();
     private final int maxTextureSize;
 
@@ -105,7 +105,7 @@
         this.pConfigInfo = configInfo;
         this.oglCaps = oglCaps;
         this.maxTextureSize = maxTextureSize;
-        context = new OGLContext(OGLRenderQueue.getInstance(), this);
+        context = new OGLContext(OGLRenderQueue.getInstance());
 
         // add a record to the Disposer so that we destroy the native
         // CGLGraphicsConfigInfo data when this object goes away
--- a/src/java.desktop/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,8 +48,9 @@
 
     native void validate(int xoff, int yoff, int width, int height, boolean isOpaque);
 
-    private native void initOps(long pConfigInfo, long pPeerData, long layerPtr,
-                                int xoff, int yoff, boolean isOpaque);
+    private native void initOps(OGLGraphicsConfig gc, long pConfigInfo,
+                                long pPeerData, long layerPtr, int xoff,
+                                int yoff, boolean isOpaque);
 
     protected CGLSurfaceData(CGLGraphicsConfig gc, ColorModel cm, int type,
                              int width, int height) {
@@ -74,7 +75,7 @@
             pPeerData = pView.getAWTView();
             isOpaque = pView.isOpaque();
         }
-        initOps(pConfigInfo, pPeerData, 0, 0, 0, isOpaque);
+        initOps(gc, pConfigInfo, pPeerData, 0, 0, 0, isOpaque);
     }
 
     protected CGLSurfaceData(CGLLayer layer, CGLGraphicsConfig gc,
@@ -90,7 +91,7 @@
             layerPtr = layer.getPointer();
             isOpaque = layer.isOpaque();
         }
-        initOps(pConfigInfo, 0, layerPtr, 0, 0, isOpaque);
+        initOps(gc, pConfigInfo, 0, layerPtr, 0, 0, isOpaque);
     }
 
     @Override //SurfaceData
--- a/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m	Wed Sep 25 22:40:41 2019 +0200
@@ -1408,10 +1408,8 @@
     JNF_COCOA_ENTER(env);
 
     NSView *view = (NSView *)jlong_to_ptr(viewPtr);
-    NSWindow *window = [view window];
-
     [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
-
+        NSWindow *window = [view window];
         ret = (jint)[[AWTWindow getNSWindowDisplayID_AppKitThread: window] intValue];
     }];
 
--- a/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLSurfaceData.m	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLSurfaceData.m	Wed Sep 25 22:40:41 2019 +0200
@@ -131,31 +131,6 @@
 }
 
 /**
- * Returns a pointer (as a jlong) to the native CGLGraphicsConfigInfo
- * associated with the given OGLSDOps.  This method can be called from
- * shared code to retrieve the native GraphicsConfig data in a platform-
- * independent manner.
- */
-jlong
-OGLSD_GetNativeConfigInfo(OGLSDOps *oglsdo)
-{
-    J2dTraceLn(J2D_TRACE_INFO, "OGLSD_GetNativeConfigInfo");
-
-    if (oglsdo == NULL) {
-        J2dRlsTraceLn(J2D_TRACE_ERROR, "OGLSD_GetNativeConfigInfo: ops are null");
-        return 0L;
-    }
-
-    CGLSDOps *cglsdo = (CGLSDOps *)oglsdo->privOps;
-    if (cglsdo == NULL) {
-        J2dRlsTraceLn(J2D_TRACE_ERROR, "OGLSD_GetNativeConfigInfo: cgl ops are null");
-        return 0L;
-    }
-
-    return ptr_to_jlong(cglsdo->configInfo);
-}
-
-/**
  * Makes the given GraphicsConfig's context current to its associated
  * "scratch" surface.  If there is a problem making the context current,
  * this method will return NULL; otherwise, returns a pointer to the
@@ -359,7 +334,7 @@
 
 JNIEXPORT void JNICALL
 Java_sun_java2d_opengl_CGLSurfaceData_initOps
-    (JNIEnv *env, jobject cglsd,
+    (JNIEnv *env, jobject cglsd, jobject gc,
      jlong pConfigInfo, jlong pPeerData, jlong layerPtr,
      jint xoff, jint yoff, jboolean isOpaque)
 {
@@ -367,8 +342,22 @@
     J2dTraceLn1(J2D_TRACE_INFO, "  pPeerData=%p", jlong_to_ptr(pPeerData));
     J2dTraceLn2(J2D_TRACE_INFO, "  xoff=%d, yoff=%d", (int)xoff, (int)yoff);
 
+    gc = (*env)->NewGlobalRef(env, gc);
+    if (gc == NULL) {
+        JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
+        return;
+    }
+
     OGLSDOps *oglsdo = (OGLSDOps *)
         SurfaceData_InitOps(env, cglsd, sizeof(OGLSDOps));
+    if (oglsdo == NULL) {
+        (*env)->DeleteGlobalRef(env, gc);
+        JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
+        return;
+    }
+    // later the graphicsConfig will be used for deallocation of oglsdo
+    oglsdo->graphicsConfig = gc;
+
     CGLSDOps *cglsdo = (CGLSDOps *)malloc(sizeof(CGLSDOps));
     if (cglsdo == NULL) {
         JNU_ThrowOutOfMemoryError(env, "creating native cgl ops");
--- a/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Ports.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Ports.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -414,11 +414,18 @@
                                AudioControl **audioControls, int offset, int len) {
     void *jControl = NULL;
     PortControl *control = (PortControl *)calloc(1, sizeof(PortControl));
+    if (control == NULL) {
+        return NULL;
+    }
     float precision = 0.01;
 
     control->type = type;
     control->controlCount = len;
     control->audioControls = (AudioControl **)malloc(len * sizeof(AudioControl *));
+    if (control->audioControls == NULL) {
+        free(control);
+        return NULL;
+    }
     memcpy(control->audioControls, audioControls + offset, len * sizeof(AudioControl *));
 
     switch (control->type) {
@@ -482,6 +489,9 @@
                 OS_ERROR1(err, "PORT_GetControls (portIndex = %d) get OwnedObject values", portIndex);
             } else {
                 mixer->deviceControls = (AudioControl *)calloc(mixer->deviceControlCount, sizeof(AudioControl));
+                if (mixer->deviceControls == NULL) {
+                    return;
+                }
 
                 for (int i = 0; i < mixer->deviceControlCount; i++) {
                     AudioControl *control = &mixer->deviceControls[i];
@@ -615,10 +625,16 @@
                 if (err == noErr) {
                     CFIndex length = CFStringGetLength(cfname) + 1;
                     channelName = (char *)malloc(length);
+                    if (channelName == NULL) {
+                        return;
+                    }
                     CFStringGetCString(cfname, channelName, length, kCFStringEncodingUTF8);
                     CFRelease(cfname);
                 } else {
                     channelName = (char *)malloc(16);
+                    if (channelName == NULL) {
+                        return;
+                    }
                     sprintf(channelName, "Ch %d", ch);
                 }
 
--- a/src/java.desktop/share/classes/java/applet/Applet.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/applet/Applet.java	Wed Sep 25 22:40:41 2019 +0200
@@ -544,6 +544,7 @@
     /**
      * The accessible context associated with this {@code Applet}.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     AccessibleContext accessibleContext = null;
 
     /**
--- a/src/java.desktop/share/classes/java/awt/BorderLayout.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/BorderLayout.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,11 +92,10 @@
  * Here is an example of five buttons in an applet laid out using
  * the {@code BorderLayout} layout manager:
  * <p>
- * <img src="doc-files/BorderLayout-1.gif"
- * alt="Diagram of an applet demonstrating BorderLayout.
- *      Each section of the BorderLayout contains a Button corresponding to its position in the layout, one of:
- *      North, West, Center, East, or South."
- * style="float:center; margin: 7px 10px;">
+ * <img src="doc-files/BorderLayout-1.gif" alt="Diagram of an applet
+ * demonstrating BorderLayout. Each section of the BorderLayout contains a
+ * Button corresponding to its position in the layout, one of: North, West,
+ * Center, East, or South." style="margin: 7px 10px;">
  * <p>
  * The code for this applet is as follows:
  *
--- a/src/java.desktop/share/classes/java/awt/Button.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/Button.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,8 +40,8 @@
  * depicts three views of a "{@code Quit}" button as it appears
  * under the Solaris operating system:
  * <p>
- * <img src="doc-files/Button-1.gif" alt="The following context describes the graphic"
- * style="float:center; margin: 7px 10px;">
+ * <img src="doc-files/Button-1.gif" alt="The following context describes the
+ * graphic" style="margin: 7px 10px;">
  * <p>
  * The first view shows the button as it appears normally.
  * The second view shows the button
--- a/src/java.desktop/share/classes/java/awt/Checkbox.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/Checkbox.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,8 +52,8 @@
  * This image depicts the check boxes and grid layout
  * created by this code example:
  * <p>
- * <img src="doc-files/Checkbox-1.gif" alt="The following context describes the graphic."
- * style="float:center; margin: 7px 10px;">
+ * <img src="doc-files/Checkbox-1.gif" alt="The following context describes the
+ * graphic." style="margin: 7px 10px;">
  * <p>
  * The button labeled {@code one} is in the "on" state, and the
  * other two are in the "off" state. In this example, which uses the
--- a/src/java.desktop/share/classes/java/awt/CheckboxGroup.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/CheckboxGroup.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,9 +46,9 @@
  * <p>
  * This image depicts the check box group created by this example:
  * <p>
- * <img src="doc-files/CheckboxGroup-1.gif"
- * alt="Shows three checkboxes, arranged vertically, labeled one, two, and three. Checkbox one is in the on state."
- * style="float:center; margin: 7px 10px;">
+ * <img src="doc-files/CheckboxGroup-1.gif" alt="Shows three checkboxes,
+ * arranged vertically, labeled one, two, and three. Checkbox one is in the on
+ * state." style="margin: 7px 10px;">
  *
  * @author      Sami Shaio
  * @see         java.awt.Checkbox
--- a/src/java.desktop/share/classes/java/awt/CheckboxMenuItem.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/CheckboxMenuItem.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,7 @@
  * <img src="doc-files/MenuBar-1.gif"
  * alt="Menu labeled Examples, containing items Basic, Simple, Check, and More
  * Examples. The Check item is a CheckBoxMenuItem instance, in the off state."
- * style="float:center; margin: 7px 10px;">
+ * style="margin: 7px 10px;">
  * <p>
  * The item labeled {@code Check} shows a check box menu item
  * in its "off" state.
--- a/src/java.desktop/share/classes/java/awt/Choice.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/Choice.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,8 +51,8 @@
  * After this choice menu has been added to a panel,
  * it appears as follows in its normal state:
  * <p>
- * <img src="doc-files/Choice-1.gif" alt="The following text describes the graphic"
- * style="float:center; margin: 7px 10px;">
+ * <img src="doc-files/Choice-1.gif" alt="The following text describes the
+ * graphic" style="margin: 7px 10px;">
  * <p>
  * In the picture, {@code "Green"} is the current choice.
  * Pushing the mouse button down on the object causes a menu to
--- a/src/java.desktop/share/classes/java/awt/Component.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/Component.java	Wed Sep 25 22:40:41 2019 +0200
@@ -469,6 +469,7 @@
      * @see #getFocusTraversalKeys
      * @since 1.4
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     Set<AWTKeyStroke>[] focusTraversalKeys;
 
     private static final String[] focusTraversalKeyPropertyNames = {
@@ -9293,6 +9294,7 @@
     /**
      * The {@code AccessibleContext} associated with this {@code Component}.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     protected AccessibleContext accessibleContext = null;
 
     /**
@@ -9344,12 +9346,14 @@
          * A component listener to track show/hide/resize events
          * and convert them to PropertyChange events.
          */
+        @SuppressWarnings("serial") // Not statically typed as Serializable
         protected ComponentListener accessibleAWTComponentHandler = null;
 
         /**
          * A listener to track focus events
          * and convert them to PropertyChange events.
          */
+        @SuppressWarnings("serial") // Not statically typed as Serializable
         protected FocusListener accessibleAWTFocusHandler = null;
 
         /**
--- a/src/java.desktop/share/classes/java/awt/Container.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/Container.java	Wed Sep 25 22:40:41 2019 +0200
@@ -3851,6 +3851,7 @@
          * The handler to fire {@code PropertyChange}
          * when children are added or removed
          */
+        @SuppressWarnings("serial") // Not statically typed as Serializable
         protected ContainerListener accessibleContainerHandler = null;
 
         /**
--- a/src/java.desktop/share/classes/java/awt/Event.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/Event.java	Wed Sep 25 22:40:41 2019 +0200
@@ -455,6 +455,7 @@
      * @serial
      * @see java.awt.AWTEvent#getSource()
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     public Object target;
 
     /**
@@ -537,6 +538,7 @@
      *
      * @serial
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     public Object arg;
 
     /**
--- a/src/java.desktop/share/classes/java/awt/FileDialog.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/FileDialog.java	Wed Sep 25 22:40:41 2019 +0200
@@ -125,6 +125,7 @@
      * @see #setFilenameFilter()
      * @see FileNameFilter
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     FilenameFilter filter;
 
     private static final String base = "filedlg";
--- a/src/java.desktop/share/classes/java/awt/FlowLayout.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/FlowLayout.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,7 +54,7 @@
  * <p>
  * <img src="doc-files/FlowLayout-1.gif"
  * ALT="Graphic of Layout for Three Buttons"
- * style="float:center; margin: 7px 10px;">
+ * style="margin: 7px 10px;">
  * <p>
  * Here is the code for this applet:
  *
--- a/src/java.desktop/share/classes/java/awt/Frame.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/Frame.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,10 +83,10 @@
  * of the primary screen in the virtual device, negative coordinates
  * are possible, as shown in the following figure.
  * <p>
- * <img src="doc-files/MultiScreen.gif"
- * alt="Diagram of virtual device encompassing three physical screens and one primary physical screen. The primary physical screen
- * shows (0,0) coords while a different physical screen shows (-80,-100) coords."
- * style="float:center; margin: 7px 10px;">
+ * <img src="doc-files/MultiScreen.gif" alt="Diagram of virtual device
+ * encompassing three physical screens and one primary physical screen. The
+ * primary physical screen shows (0,0) coords while a different physical screen
+ * shows (-80,-100) coords." style="margin: 7px 10px;">
  * <p>
  * In such an environment, when calling {@code setLocation},
  * you must pass a virtual coordinate to this method.  Similarly,
--- a/src/java.desktop/share/classes/java/awt/GridBagLayout.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/GridBagLayout.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,64 +116,49 @@
  * <dt>{@link GridBagConstraints#anchor}
  * <dd>Specifies where the component should be positioned in its display area.
  * There are three kinds of possible values: absolute, orientation-relative,
- * and baseline-relative
+ * and baseline-relative.
  * Orientation relative values are interpreted relative to the container's
  * {@code ComponentOrientation} property while absolute values
  * are not.  Baseline relative values are calculated relative to the
  * baseline.  Valid values are:
  *
- * <table class="striped" style="margin: 0px auto">
- * <caption>Absolute, relative and baseline values as described above</caption>
- * <thead>
- * <tr>
- * <th><p style="text-align:center">Absolute Values</th>
- * <th><p style="text-align:center">Orientation Relative Values</th>
- * <th><p style="text-align:center">Baseline Relative Values</th>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <td>
- * <ul style="list-style-type:none">
- * <li>{@code GridBagConstraints.NORTH}</li>
- * <li>{@code GridBagConstraints.SOUTH}</li>
- * <li>{@code GridBagConstraints.WEST}</li>
- * <li>{@code GridBagConstraints.EAST}</li>
- * <li>{@code GridBagConstraints.NORTHWEST}</li>
- * <li>{@code GridBagConstraints.NORTHEAST}</li>
- * <li>{@code GridBagConstraints.SOUTHWEST}</li>
- * <li>{@code GridBagConstraints.SOUTHEAST}</li>
- * <li>{@code GridBagConstraints.CENTER} (the default)</li>
+ * <ul>
+ *   <li>Absolute Values:
+ *     <ul>
+ *       <li>{@code GridBagConstraints.NORTH}
+ *       <li>{@code GridBagConstraints.SOUTH}
+ *       <li>{@code GridBagConstraints.WEST}
+ *       <li>{@code GridBagConstraints.EAST}
+ *       <li>{@code GridBagConstraints.NORTHWEST}
+ *       <li>{@code GridBagConstraints.NORTHEAST}
+ *       <li>{@code GridBagConstraints.SOUTHWEST}
+ *       <li>{@code GridBagConstraints.SOUTHEAST}
+ *       <li>{@code GridBagConstraints.CENTER} (the default)
+ *     </ul>
+ *   <li>Orientation Relative Values:
+ *     <ul >
+ *       <li>{@code GridBagConstraints.PAGE_START}
+ *       <li>{@code GridBagConstraints.PAGE_END}
+ *       <li>{@code GridBagConstraints.LINE_START}
+ *       <li>{@code GridBagConstraints.LINE_END}
+ *       <li>{@code GridBagConstraints.FIRST_LINE_START}
+ *       <li>{@code GridBagConstraints.FIRST_LINE_END}
+ *       <li>{@code GridBagConstraints.LAST_LINE_START}
+ *       <li>{@code GridBagConstraints.LAST_LINE_END}
+ *     </ul>
+ *   <li>Baseline Relative Values:
+ *     <ul>
+ *       <li>{@code GridBagConstraints.BASELINE}
+ *       <li>{@code GridBagConstraints.BASELINE_LEADING}
+ *       <li>{@code GridBagConstraints.BASELINE_TRAILING}
+ *       <li>{@code GridBagConstraints.ABOVE_BASELINE}
+ *       <li>{@code GridBagConstraints.ABOVE_BASELINE_LEADING}
+ *       <li>{@code GridBagConstraints.ABOVE_BASELINE_TRAILING}
+ *       <li>{@code GridBagConstraints.BELOW_BASELINE}
+ *       <li>{@code GridBagConstraints.BELOW_BASELINE_LEADING}
+ *       <li>{@code GridBagConstraints.BELOW_BASELINE_TRAILING}
+ *     </ul>
  * </ul>
- * </td>
- * <td>
- * <ul style="list-style-type:none">
- * <li>{@code GridBagConstraints.PAGE_START}</li>
- * <li>{@code GridBagConstraints.PAGE_END}</li>
- * <li>{@code GridBagConstraints.LINE_START}</li>
- * <li>{@code GridBagConstraints.LINE_END}</li>
- * <li>{@code GridBagConstraints.FIRST_LINE_START}</li>
- * <li>{@code GridBagConstraints.FIRST_LINE_END}</li>
- * <li>{@code GridBagConstraints.LAST_LINE_START}</li>
- * <li>{@code GridBagConstraints.LAST_LINE_END}</li>
- * </ul>
- * </td>
- * <td>
- * <ul style="list-style-type:none">
- * <li>{@code GridBagConstraints.BASELINE}</li>
- * <li>{@code GridBagConstraints.BASELINE_LEADING}</li>
- * <li>{@code GridBagConstraints.BASELINE_TRAILING}</li>
- * <li>{@code GridBagConstraints.ABOVE_BASELINE}</li>
- * <li>{@code GridBagConstraints.ABOVE_BASELINE_LEADING}</li>
- * <li>{@code GridBagConstraints.ABOVE_BASELINE_TRAILING}</li>
- * <li>{@code GridBagConstraints.BELOW_BASELINE}</li>
- * <li>{@code GridBagConstraints.BELOW_BASELINE_LEADING}</li>
- * <li>{@code GridBagConstraints.BELOW_BASELINE_TRAILING}</li>
- * </ul>
- * </td>
- * </tr>
- * </tbody>
- * </table>
  * <dt>{@link GridBagConstraints#weightx},
  * {@link GridBagConstraints#weighty}
  * <dd>Used to determine how to distribute space, which is
@@ -201,14 +186,10 @@
  * <p>
  * The following figure shows a baseline layout and includes a
  * component that spans rows:
- * <table class="borderless" style="margin: 0px auto">
- * <caption>Baseline Layout</caption>
- * <tr style="text-align:center">
- * <td>
- * <img src="doc-files/GridBagLayout-baseline.png"
- *  alt="The following text describes this graphic (Figure 1)." style="float:center">
- * </td>
- * </table>
+ * <p style="text-align: center">
+ *   <img src="doc-files/GridBagLayout-baseline.png"
+ *   alt="The following text describes this graphic (Figure 1).">
+ * </p>
  * This layout consists of three components:
  * <ul><li>A panel that starts in row 0 and ends in row 1.  The panel
  *   has a baseline-resize behavior of {@code CONSTANT_DESCENT} and has
@@ -257,20 +238,21 @@
  * left-to-right container and Figure 3 shows the layout for a horizontal,
  * right-to-left container.
  *
- * <table class="borderless" style="margin: 0px auto">
- * <caption style="width:600;display:none">Figures</caption>
- * <tr style="text-align:center">
- * <td>
- * <img src="doc-files/GridBagLayout-1.gif" alt="The preceding text describes this graphic (Figure 1)." style="float:center; margin: 7px 10px;">
- * </td>
- * <td>
- * <img src="doc-files/GridBagLayout-2.gif" alt="The preceding text describes this graphic (Figure 2)." style="float:center; margin: 7px 10px;">
- * </td>
- * <tr style="text-align:center">
- * <td>Figure 2: Horizontal, Left-to-Right</td>
- * <td>Figure 3: Horizontal, Right-to-Left</td>
- * </tr>
- * </table>
+ * <div style="margin:0 auto;width:680px;text-align:center;font-weight:bold">
+ *   <div style="float:left">
+ *     <p><img src="doc-files/GridBagLayout-1.gif"
+ *        alt="The preceding text describes this graphic (Figure 2)."
+ *        style="margin: 7px 10px;">
+ *     <p>Figure 2: Horizontal, Left-to-Right
+ *   </div>
+ *   <div style="float:right">
+ *     <p><img src="doc-files/GridBagLayout-2.gif"
+ *        alt="The preceding text describes this graphic (Figure 3)."
+ *        style="margin: 7px 10px;">
+ *     <p>Figure 3: Horizontal, Right-to-Left
+ *   </div>
+ *   <br style="clear:both;">
+ * </div>
  * <p>
  * Each of the ten components has the {@code fill} field
  * of its associated {@code GridBagConstraints} object
--- a/src/java.desktop/share/classes/java/awt/GridLayout.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/GridLayout.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,26 +55,21 @@
  * If the container's {@code ComponentOrientation} property is horizontal
  * and right-to-left, the example produces the output shown in Figure 2.
  *
- * <table style="float:center;width:600">
- * <caption style="display:none">Figures</caption>
- * <tr style="text-align:center">
- * <td><img SRC="doc-files/GridLayout-1.gif"
- *      alt="Shows 6 buttons in rows of 2. Row 1 shows buttons 1 then 2.
- * Row 2 shows buttons 3 then 4. Row 3 shows buttons 5 then 6.">
- * </td>
- *
- * <td style="text-align:center"><img SRC="doc-files/GridLayout-2.gif"
- *              alt="Shows 6 buttons in rows of 2. Row 1 shows buttons 2 then 1.
- * Row 2 shows buttons 4 then 3. Row 3 shows buttons 6 then 5.">
- * </td>
- * </tr>
- *
- * <tr style="text-align:center">
- * <td>Figure 1: Horizontal, Left-to-Right</td>
- *
- * <td>Figure 2: Horizontal, Right-to-Left</td>
- * </tr>
- * </table>
+ * <div style="margin:0 auto;width:600px;text-align:center;font-weight:bold">
+ *   <div style="float:left">
+ *     <p><img SRC="doc-files/GridLayout-1.gif"
+ *        alt="Shows 6 buttons in rows of 2. Row 1 shows buttons 1 then 2.
+ *        Row 2 shows buttons 3 then 4. Row 3 shows buttons 5 then 6.">
+ *     <p>Figure 1: Horizontal, Left-to-Right
+ *   </div>
+ *   <div style="float:right">
+ *     <p><img SRC="doc-files/GridLayout-2.gif"
+ *        alt="Shows 6 buttons in rows of 2. Row 1 shows buttons 2 then 1.
+ *        Row 2 shows buttons 4 then 3. Row 3 shows buttons 6 then 5.">
+ *     <p>Figure 2: Horizontal, Right-to-Left
+ *   </div>
+ *   <br style="clear:both;">
+ * </div>
  * <p>
  * When both the number of rows and the number of columns have
  * been set to non-zero values, either by a constructor or
--- a/src/java.desktop/share/classes/java/awt/Label.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/Label.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
  * <p>
  * produces the following labels:
  * <p>
- * <img src="doc-files/Label-1.gif" alt="Two labels: 'Hi There!' and 'Another label'"
- * style="float:center; margin: 7px 10px;">
+ * <img src="doc-files/Label-1.gif" alt="Two labels: 'Hi There!' and
+ * 'Another label'" style="margin: 7px 10px;">
  *
  * @author      Sami Shaio
  * @since       1.0
--- a/src/java.desktop/share/classes/java/awt/List.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/List.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,7 +61,8 @@
  * scrolling list:
  * <p>
  * <img src="doc-files/List-1.gif"
- * alt="Shows a list containing: Venus, Earth, JavaSoft, and Mars. Javasoft is selected." style="float:center; margin: 7px 10px;">
+ * alt="Shows a list containing: Venus, Earth, JavaSoft, and Mars. Javasoft is
+ * selected." style="margin: 7px 10px;">
  * <p>
  * If the List allows multiple selections, then clicking on
  * an item that is already selected deselects it. In the preceding
--- a/src/java.desktop/share/classes/java/awt/MediaTracker.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/MediaTracker.java	Wed Sep 25 22:40:41 2019 +0200
@@ -185,6 +185,7 @@
      * @see #addImage(Image, int)
      * @see #removeImage(Image)
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     MediaEntry head;
 
     /*
@@ -922,8 +923,10 @@
     }
 }
 
+@SuppressWarnings("serial") // MediaEntry does not have a no-arg ctor
 class ImageMediaEntry extends MediaEntry implements ImageObserver,
 java.io.Serializable {
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     Image image;
     int width;
     int height;
--- a/src/java.desktop/share/classes/java/awt/MenuBar.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/MenuBar.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,9 +50,9 @@
  * This is what a menu bar might look like:
  * <p>
  * <img src="doc-files/MenuBar-1.gif"
- * alt="Diagram of MenuBar containing 2 menus: Examples and Options.
- * Examples menu is expanded showing items: Basic, Simple, Check, and More Examples."
- * style="float:center; margin: 7px 10px;">
+ * alt="Diagram of MenuBar containing 2 menus: Examples and Options. Examples
+ * menu is expanded showing items: Basic, Simple, Check, and More Examples."
+ * style="margin: 7px 10px;">
  * <p>
  * A menu bar handles keyboard shortcuts for menu items, passing them
  * along to its child menus.
--- a/src/java.desktop/share/classes/java/awt/MenuComponent.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/MenuComponent.java	Wed Sep 25 22:40:41 2019 +0200
@@ -470,7 +470,7 @@
      *  though it won't actually implement the interface - that will be up
      *  to the individual objects which extend MenuComponent.
      */
-
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     AccessibleContext accessibleContext = null;
 
     /**
--- a/src/java.desktop/share/classes/java/awt/MenuItem.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/MenuItem.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,8 +51,8 @@
  * a simple labeled menu item.
  * <p>
  * This picture of a menu bar shows five menu items:
- * <IMG SRC="doc-files/MenuBar-1.gif" alt="The following text describes this graphic."
- * style="float:center; margin: 7px 10px;">
+ * <IMG SRC="doc-files/MenuBar-1.gif" alt="The following text describes this
+ * graphic." style="margin: 7px 10px;">
  * <br style="clear:left;">
  * The first two items are simple menu items, labeled
  * {@code "Basic"} and {@code "Simple"}.
--- a/src/java.desktop/share/classes/java/awt/ScrollPaneAdjustable.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/ScrollPaneAdjustable.java	Wed Sep 25 22:40:41 2019 +0200
@@ -138,6 +138,7 @@
      */
     private int blockIncrement = 1;
 
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private AdjustmentListener adjustmentListener;
 
     /**
--- a/src/java.desktop/share/classes/java/awt/Scrollbar.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/Scrollbar.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,8 +41,8 @@
  * scroll bars could be used as slider controls to pick
  * the red, green, and blue components of a color:
  * <p>
- * <img src="doc-files/Scrollbar-1.gif" alt="Image shows 3 vertical sliders, side-by-side."
- * style="float:center; margin: 7px 10px;">
+ * <img src="doc-files/Scrollbar-1.gif" alt="Image shows 3 vertical sliders,
+ * side-by-side." style="margin: 7px 10px;">
  * <p>
  * Each scroll bar in this example could be created with
  * code similar to the following:
@@ -59,8 +59,8 @@
  * Here is an example of a scroll bar that represents a range:
  * <p>
  * <img src="doc-files/Scrollbar-2.gif"
- * alt="Image shows horizontal slider with starting range of 0 and ending range of 300. The slider thumb is labeled 60."
- * style="float:center; margin: 7px 10px;">
+ * alt="Image shows horizontal slider with starting range of 0 and ending range
+ * of 300. The slider thumb is labeled 60." style="margin: 7px 10px;">
  * <p>
  * The value range represented by the bubble in this example
  * is the <em>visible amount</em>. The horizontal scroll bar
--- a/src/java.desktop/share/classes/java/awt/SentEvent.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/SentEvent.java	Wed Sep 25 22:40:41 2019 +0200
@@ -47,6 +47,7 @@
 
     boolean dispatched;
     private AWTEvent nested;
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private AppContext toNotify;
 
     SentEvent() {
--- a/src/java.desktop/share/classes/java/awt/SequencedEvent.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/SequencedEvent.java	Wed Sep 25 22:40:41 2019 +0200
@@ -55,11 +55,13 @@
     private static final LinkedList<SequencedEvent> list = new LinkedList<>();
 
     private final AWTEvent nested;
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private AppContext appContext;
     private boolean disposed;
     private final LinkedList<AWTEvent> pendingEvents = new LinkedList<>();
 
     private static boolean fxAppThreadIsDispatchThread;
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private Thread fxCheckSequenceThread;
     static {
         AWTAccessor.setSequencedEventAccessor(new AWTAccessor.SequencedEventAccessor() {
--- a/src/java.desktop/share/classes/java/awt/TextArea.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/TextArea.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,8 +41,8 @@
  * <p>
  * The following image shows the appearance of a text area:
  * <p>
- * <img src="doc-files/TextArea-1.gif" alt="A TextArea showing the word 'Hello!'"
- * style="float:center; margin: 7px 10px;">
+ * <img src="doc-files/TextArea-1.gif" alt="A TextArea showing the word
+ * 'Hello!'" style="margin: 7px 10px;">
  * <p>
  * This text area could be created by the following line of code:
  *
--- a/src/java.desktop/share/classes/java/awt/TextField.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/TextField.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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,8 +41,8 @@
  * text fields of varying widths. Two of these text fields
  * display the predefined text {@code "Hello"}.
  * <p>
- * <img src="doc-files/TextField-1.gif" alt="The preceding text describes this image."
- * style="float:center; margin: 7px 10px;">
+ * <img src="doc-files/TextField-1.gif" alt="The preceding text describes this
+ * image." style="margin: 7px 10px;">
  * <p>
  * Here is the code that produces these four text fields:
  *
--- a/src/java.desktop/share/classes/java/awt/Window.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/Window.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -96,8 +96,9 @@
  * possible, as shown in the following figure.
  * <p>
  * <img src="doc-files/MultiScreen.gif"
- * alt="Diagram shows virtual device containing 4 physical screens. Primary physical screen shows coords (0,0), other screen shows (-80,-100)."
- * style="float:center; margin: 7px 10px;">
+ * alt="Diagram shows virtual device containing 4 physical screens. Primary
+ * physical screen shows coords (0,0), other screen shows (-80,-100)."
+ * style="margin: 7px 10px;">
  * <p>
  * In such an environment, when calling {@code setLocation},
  * you must pass a virtual coordinate to this method.  Similarly,
@@ -371,6 +372,7 @@
      * @see #setShape(Shape)
      * @since 1.7
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private Shape shape = null;
 
     private static final String base = "win";
--- a/src/java.desktop/share/classes/java/awt/desktop/FilesEvent.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/desktop/FilesEvent.java	Wed Sep 25 22:40:41 2019 +0200
@@ -47,6 +47,7 @@
     /**
      * The list of files.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     final List<File> files;
 
     /**
--- a/src/java.desktop/share/classes/java/awt/doc-files/DesktopProperties.html	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/doc-files/DesktopProperties.html	Wed Sep 25 22:40:41 2019 +0200
@@ -5,7 +5,7 @@
   <title>AWT Desktop Properties</title>
 </head>
 <!--
- 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
@@ -57,22 +57,26 @@
 The following table summarizes the desktop properties documented
 here, and their value types.
 <br><br>
-<table>
-<tr bgcolor="#ccccff">
-<th>Property Name</th>
-<th>Value Type</th>
-<th>Summary Description</th>
+<table border=1>
+<thead>
+<tr>
+<th scope="col">Property Name</th>
+<th scope="col">Value Type</th>
+<th scope="col">Summary Description</th>
 </tr>
+</thead>
+<tbody>
 <tr>
-<td><A href="#awt.font.desktophints">awt.font.desktophints</A></td>
+<th scope="row"><A href="#awt.font.desktophints">awt.font.desktophints</A></th>
 <td>{@link java.util.Map java.util.Map}</td>
 <td>Font smoothing (text antialiasing) settings.</td>
 </tr>
 <tr>
-<td><A href="#sun.awt.enableExtraMouseButtons">sun.awt.enableExtraMouseButtons</A></td>
+<th scope="row"><A href="#sun.awt.enableExtraMouseButtons">sun.awt.enableExtraMouseButtons</A></th>
 <td>{@link java.lang.Boolean java.lang.Boolean}</td>
 <td>Controls if mouse events from extra buttons are to be generated or not</td>
 </tr>
+</tbody>
 </table>
 
 <h2>Desktop Font Rendering Hints</h2>
--- a/src/java.desktop/share/classes/java/awt/doc-files/Modality.html	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/doc-files/Modality.html	Wed Sep 25 22:40:41 2019 +0200
@@ -9,7 +9,7 @@
   </style>
 </head>
 <!--
- 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
@@ -57,14 +57,14 @@
     <h2>Definitions</h2>
 
     <p>
-      <u>Document</u> - a window without an owner that, together with
+      Document - a window without an owner that, together with
       all its child hierarchy, may be operated on as a single self-contained
       document.
       Every window belongs to some document &mdash; its root can be found as
       the closest ancestor window without an owner.
     </p><p>
       <a id="ModalBlocked"></a>
-      <u>Modal blocked window</u> - a window, that:
+      Modal blocked window - a window, that:
       </p><ul>
         <li>doesn't receive any user input events
         </li><li>doesn't receive input focus
@@ -78,15 +78,15 @@
         <hr>
       </blockquote>
     <p>
-      <u>Modal dialog</u> - a dialog that blocks some windows while it is
+      Modal dialog - a dialog that blocks some windows while it is
       visible. The blocked windows are determined according to the dialog's
       scope of blocking.
     </p><p>
-      <u>Modal excluded window</u> - a window that stays unblocked
+      Modal excluded window - a window that stays unblocked
       while the modal dialog is visible. If a window is modal excluded
       then all its owned windows and child components are also excluded.
     </p><p>
-      <u>Scope of blocking (SB)</u> - the set of windows (instances of
+      Scope of blocking (SB) - the set of windows (instances of
       <code>java.awt.Window</code> and all derived classes) that are blocked by
       the modal dialog while it is visible.
      <blockquote><hr>
@@ -109,20 +109,20 @@
       A dialog is, by default, modeless.  A modal dialog is, by default,
       application-modal.
     <ol>
-      <li><u>Modeless dialogs</u><br>
+      <li>Modeless dialogs<br>
         A modeless dialog doesn't block any windows while visible.
-      </li><li><u>Document-modal dialogs</u><br>
+      </li><li>Document-modal dialogs<br>
         A document-modal dialog blocks all windows from the same
         document except those from its child hierarchy. The document root
         is determined as the closest ancestor window without an
         owner.
-      </li><li><u>Application-modal dialogs</u><br>
+      </li><li>Application-modal dialogs<br>
         An application-modal dialog blocks all windows from the same
         application except for those from its child hierarchy.
         If there are several applets launched in a browser, they can be
         treated either as separate applications or a single application.
 	This behavior is implementation-dependent.
-      </li><li><u>Toolkit-modal dialogs</u><br>
+      </li><li>Toolkit-modal dialogs<br>
         A toolkit-modal dialog blocks all windows that run in the same
         toolkit except those from its child hierarchy. If there
         are several applets launched all of them run with the same toolkit,
@@ -163,13 +163,13 @@
     <h2>Show/hide blocking</h2>
 
     <p>
-      <u>Showing the window or modeless dialog: "F"</u><br>
+      Showing the window or modeless dialog: "F"<br>
       All the visible modal dialogs are looked through &mdash; if F is from the SB
       of one of them, it becomes blocked by it. If there are several such
       dialogs, the first shown is used. If no such dialogs exist, F remains
       unblocked.
     </p><p>
-      <u>Showing the modal dialog: "M"</u><br>
+      Showing the modal dialog: "M"<br>
       When modal dialog M is shown, all the visible windows fall into one of
       three distinct groups:
       <ul>
@@ -188,57 +188,57 @@
       second one become blocked by M, and all the windows from the third group
       remain untouched.
     </p><p>
-      <u>In typical cases</u>, when no child dialogs are shown before their owners,
+      In typical cases, when no child dialogs are shown before their owners,
       this rule can be simplified. (The following, simplified case, may
       leave out some details).
       </p><p>
-      <u>Showing the document-modal dialog: "M"</u><br>
+      Showing the document-modal dialog: "M"<br>
       All the visible application- and toolkit-modal dialogs are looked
       through &mdash; if M is from the SB of one of them,
       it becomes blocked by it. If there are several such dialogs,
       the first shown is used. If no such dialogs exist, M remains unblocked.
       </p><p>
-      <u>Showing the application-modal dialog: "M"</u><br>
+      Showing the application-modal dialog: "M"<br>
       All the visible toolkit-modal dialogs are looked through &mdash;
       if M is from the SB of one of them, it becomes blocked by it.
       If there are several such dialogs, the first shown is used.
       If no such dialogs exist, M remains unblocked.
       </p><p>
-      <u>Showing the toolkit-modal dialog: "M"</u><br>
+      Showing the toolkit-modal dialog: "M"<br>
       M remains unblocked.
 
           <table border="1">
-	  <caption>The Standard Blocking Matrix</caption>
+	        <caption>The Standard Blocking Matrix</caption>
             <tbody><tr>
-              <td>current/shown</td>
-              <td>frame &amp; modeless</td>
-              <td>document</td>
-              <td>application</td>
-              <td>toolkit</td>
+              <th scope="col">current/shown</th>
+              <th scope="col">frame &amp; modeless</th>
+              <th scope="col">document</th>
+              <th scope="col">application</th>
+              <th scope="col">toolkit</th>
             </tr>
             <tr>
-              <td>-</td>
+              <th scope="row">-</th>
               <td>-</td>
               <td>-</td>
               <td>-</td>
               <td>-</td>
             </tr>
             <tr>
-              <td>document</td>
+              <th scope="row">document</th>
               <td>blocked</td>
               <td>-</td>
               <td>-</td>
               <td>-</td>
             </tr>
             <tr>
-              <td>application</td>
+              <th scope="row">application</th>
               <td>blocked</td>
               <td>blocked</td>
               <td>-</td>
               <td>-</td>
             </tr>
             <tr>
-              <td>toolkit</td>
+              <th scope="row">toolkit</th>
               <td>blocked</td>
               <td>blocked</td>
               <td>blocked</td>
@@ -250,11 +250,11 @@
       After the modal dialog is shown, all the windows from its SB are blocked,
       except those that block this modal dialog.
     </p><p>
-      <u>Hiding the window or modeless dialog: "F"</u><br>
+      Hiding the window or modeless dialog: "F"<br>
       If F was blocked by any modal dialog M, it becomes unblocked and is
       removed from M's blocked windows list.
     </p><p>
-      <u>Hiding the modal dialog: "M"</u><br>
+      Hiding the modal dialog: "M"<br>
       If M was blocked by any other modal dialog, for example, "N",
       it becomes unblocked and
       is removed from N's blocked windows list. Then, all the windows and dialogs
@@ -273,11 +273,11 @@
       </li></ul>
       By default, a window's modal exclusion property is turned off.
       <ol>
-        <li><u>Application-modal exclusion</u><br>
+        <li>Application-modal exclusion<br>
           If a window is application-modal excluded, it is not blocked by any
           application-modal dialogs. Also, it is not blocked by document-modal
           dialogs from outside of its child hierarchy.
-        </li><li><u>Toolkit-modal exclusion</u><br>
+        </li><li>Toolkit-modal exclusion<br>
           If a window is toolkit-modal excluded, it is not blocked
           by any application- or toolkit-modal dialogs. Also, it is not
           blocked by document-modal dialogs from outside of their child hierarchy.
@@ -285,19 +285,19 @@
     <blockquote>
       <hr>
         <b>Implementation note</b>: Changing the modal exclusion type for a visible window
-        may have no effect until it is hidden and then shown again.
+        may have no effect until it is hidden and then shown again.<hr>
     </blockquote>
 
     <a id="Related"></a>
     <h2>Related AWT features</h2>
 
     <p>
-      <u>Always-On-Top</u><br>
+      Always-On-Top<br>
       When a modal dialog that is not always-on-top blocks an always-on-top window,
       their relative Z-order is unspecified and platform-dependent.
     </p>
     <p>
-      <u>The <code>toFront()</code> and <code>toBack()</code> methods</u><br>
+      The <code>toFront()</code> and <code>toBack()</code> methods<br>
       A modal dialog should always be above all its blocked windows. Thus, if a blocked
       window is brought to the front, its blocking dialog, if any, is also brought to the
       front and remains above the blocked window. Likewise, if a modal dialog is sent to
@@ -305,7 +305,7 @@
       blocking dialog.
     </p>
     <p>
-      <u>Minimizing, maximizing and closing blocked windows</u><br>
+      Minimizing, maximizing and closing blocked windows<br>
       When a modal dialog blocks a window, the user may not be able to maximize or
       minimize the blocked window&mdash; however, the actual behavior is unspecified
       and platform-dependent. In any case, the user can't close the blocked window
@@ -314,13 +314,13 @@
       window.
     </p>
     <p>
-      <u>Blocked windows activations</u><br>
+      Blocked windows activations<br>
       When the user selects a blocked window, it may be brought to the front, along
       with the blocking modal dialog which would then become the active window&mdash;
       however, the actual behavior is unspecified and platform-dependent.
     </p>
     <p>
-      <u>Hiding a modal dialog</u><br>
+      Hiding a modal dialog<br>
       When the modal dialog that currently has focus is hidden, it is unspecified
       and platform-dependent, which other window will become the active window.
       Any of the following may become the active window:
@@ -378,87 +378,67 @@
     <a id="Examples"></a>
     </p><h2>Examples</h2>
 
-    <table border="0">
-      <tbody><tr>
-        <td style="text-align:left" >
-	<ol>
-          <li>Frame "F" is shown<br>
-          <li>Document-modal dialog "D<sub>i</sub>" is shown<br>
-          <li>F becomes blocked by D<sub>i</sub> &mdash; it's in the same document<br>
-          <li>Document-modal dialog "D<sub>ii</sub>" is shown<br>
-          <li>D<sub>i</sub> becomes blocked by D<sub>ii</sub> &mdash; it's in the
-              same document<br>
-	  </ol>
-          <br>
-        </td>
-        <td>
-          <img src="modal-example1.gif" alt="Example 1">
-          <br>
-        </td>
-      </tr>
-      <tr>
-        <td style="text-align:left">
-	<ol>
-         <li>Frame "F" is shown<br>
-         <li>Document-modal dialog "D<sub>i</sub>" is shown<br>
-         <li>F becomes blocked by D<sub>i</sub> &mdash; it's in the same document<br>
-         <li>Document-modal dialog "D<sub>ii</sub>" is shown<br>
-         <li>D<sub>i</sub> becomes blocked by D<sub>ii</sub> &mdash;
-             it's in the same document<br>
-         <li>D<sub>i</sub> is hidden<br>
-         <li>F becomes blocked by D<sub>ii</sub> &mdash; it's in the same document<br>
-         </ol>
-	 <br>
-        </td>
-        <td>
-          <img src="modal-example2.gif" alt="Example 2">
-          <br>
-        </td>
-      </tr>
-      <tr>
-        <td style="text-align:left">
-	<ol>
-          <li>Frame "F" is shown<br>
-          <li>Toolkit-modal dialog "D<sub>i</sub>" is created, but not shown<br>
-          <li>Document-modal dialog "D<sub>ii</sub>" is shown<br>
-          <li>F becomes blocked by D<sub>ii</sub> &mdash; it's in the same document<br>
-          <li>Application-modal dialog "D<sub>iii</sub>" is shown<br>
-          <li>D<sub>ii</sub> becomes blocked by D<sub>iii</sub> &mdash;
-              it's in the same application<br>
-          <li>D<sub>i</sub> is shown<br>
-          <li>D<sub>i</sub> becomes blocked by D<sub>ii</sub> &mdash; it's its owner<br>
-          <li>D<sub>iii</sub> remains unblocked &mdash; it blocks D<sub>ii</sub> and
-              D<sub>ii</sub> blocks D<sub>i</sub><br>
-	  </ol>
-          <br>
-        </td>
-        <td>
-          <img src="modal-example3.gif" alt="Example 3">
-          <br>
-        </td>
-      </tr>
-      <tr>
-        <td style="text-align:left">
-    <ol>
-          <li>Frame "F" is shown<br>
-          <li>Toolkit-modal dialog "D<sub>i</sub>" is created, but not shown<br>
-          <li>Document-modal dialog "D<sub>ii</sub>" is shown<br>
-          <li>F becomes blocked by D<sub>ii</sub> &mdash; it's in the same document<br>
-          <li>Application-modal dialog "D<sub>iii</sub>" is shown<br>
-          <li>D<sub>ii</sub> becomes blocked by D<sub>iii</sub> &mdash; it's in the
-              same application<br>
-          <li>D<sub>i</sub> is shown<br>
-          <li>D<sub>iii</sub> becomes blocked by D<sub>i</sub> &mdash; D<sub>i</sub>
-              is not blocked<br>
-          <li>D<sub>i</sub> remains unblocked<br>
-	  </ol>
-          <br>
-        </td>
-        <td>
-          <img src="modal-example4.gif" alt="Example 4">
-          <br>
-        </td>
-      </tr>
-    </tbody></table>
+    <h3>Example 1</h3>
+    <ol style="float: left">
+        <li>Frame F is shown<br>
+        <li>Document-modal dialog D<sub>i</sub> is shown<br>
+        <li>F becomes blocked by D<sub>i</sub> &mdash; it's in the same document<br>
+        <li>Document-modal dialog D<sub>ii</sub> is shown<br>
+        <li>D<sub>i</sub> becomes blocked by D<sub>ii</sub> &mdash; it's in the
+            same document<br>
+    </ol>
+    <p style="float: left; margin-left: 1em">
+        <img src="modal-example1.gif" alt="Example 1">
+    </p>
+
+    <h3 style="clear: left">Example 2</h3>
+    <ol style="float: left">
+        <li>Frame F is shown<br>
+        <li>Document-modal dialog D<sub>i</sub> is shown<br>
+        <li>F becomes blocked by D<sub>i</sub> &mdash; it's in the same document<br>
+        <li>Document-modal dialog D<sub>ii</sub> is shown<br>
+        <li>D<sub>i</sub> becomes blocked by D<sub>ii</sub> &mdash; it's in the
+            same document<br>
+    </ol>
+    <p style="float: left; margin-left: 1em">
+        <img src="modal-example2.gif" alt="Example 2">
+    </p>
+
+    <h3 style="clear: left">Example 3</h3>
+    <ol style="float: left">
+        <li>Frame F is shown<br>
+        <li>Toolkit-modal dialog D<sub>i</sub> is created, but not shown<br>
+        <li>Document-modal dialog D<sub>ii</sub> is shown<br>
+        <li>F becomes blocked by D<sub>ii</sub> &mdash; it's in the same document<br>
+        <li>Application-modal dialog D<sub>iii</sub> is shown<br>
+        <li>D<sub>ii</sub> becomes blocked by D<sub>iii</sub> &mdash;
+            it's in the same application<br>
+        <li>D<sub>i</sub> is shown<br>
+        <li>D<sub>i</sub> becomes blocked by D<sub>ii</sub> &mdash; it's its owner<br>
+        <li>D<sub>iii</sub> remains unblocked &mdash; it blocks D<sub>ii</sub> and
+            D<sub>ii</sub> blocks D<sub>i</sub><br>
+    </ol>
+    <p style="float: left; margin-left: 1em">
+        <img src="modal-example3.gif" alt="Example 3">
+    </p>
+
+    <h3 style="clear: left">Example 4</h3>
+    <ol style="float: left">
+        <li>Frame F is shown<br>
+        <li>Toolkit-modal dialog D<sub>i</sub> is created, but not shown<br>
+        <li>Document-modal dialog D<sub>ii</sub> is shown<br>
+        <li>F becomes blocked by D<sub>ii</sub> &mdash; it's in the same document<br>
+        <li>Application-modal dialog D<sub>iii</sub> is shown<br>
+        <li>D<sub>ii</sub> becomes blocked by D<sub>iii</sub> &mdash; it's in the
+            same application<br>
+        <li>D<sub>i</sub> is shown<br>
+        <li>D<sub>iii</sub> becomes blocked by D<sub>i</sub> &mdash; D<sub>i</sub>
+            is not blocked<br>
+        <li>D<sub>i</sub> remains unblocked<br>
+    </ol>
+    <p style="float: left; margin-left: 1em">
+        <img src="modal-example4.gif" alt="Example 4">
+    </p>
+    <br style="clear:both;">
 </main>
 </body></html>
--- a/src/java.desktop/share/classes/java/awt/event/AdjustmentEvent.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/event/AdjustmentEvent.java	Wed Sep 25 22:40:41 2019 +0200
@@ -104,6 +104,7 @@
      * @serial
      * @see #getAdjustable
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     Adjustable adjustable;
 
     /**
--- a/src/java.desktop/share/classes/java/awt/event/InvocationEvent.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/event/InvocationEvent.java	Wed Sep 25 22:40:41 2019 +0200
@@ -85,6 +85,7 @@
     /**
      * The Runnable whose run() method will be called.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     protected Runnable runnable;
 
     /**
@@ -94,6 +95,7 @@
      *
      * @see #isDispatched
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     protected volatile Object notifier;
 
     /**
@@ -103,6 +105,7 @@
      * @see #isDispatched
      * @since 1.8
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private final Runnable listener;
 
     /**
--- a/src/java.desktop/share/classes/java/awt/event/ItemEvent.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/event/ItemEvent.java	Wed Sep 25 22:40:41 2019 +0200
@@ -95,6 +95,7 @@
      * @serial
      * @see #getItem()
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     Object item;
 
     /**
--- a/src/java.desktop/share/classes/java/awt/font/NumericShaper.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/font/NumericShaper.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -116,17 +116,19 @@
  * </thead>
  * <tbody>
  *   <tr>
- *     <th scope="row" rowspan="2">Arabic
+ *     <th scope="rowgroup" rowspan="2">Arabic
  *     <td>{@link NumericShaper#ARABIC NumericShaper.ARABIC}
  *     <br>
  *     {@link NumericShaper#EASTERN_ARABIC NumericShaper.EASTERN_ARABIC}
  *     <td>{@link NumericShaper#EASTERN_ARABIC NumericShaper.EASTERN_ARABIC}
  *   </tr>
  *   <tr>
- *     <th scope="row">{@link NumericShaper.Range#ARABIC}
+ *     <td>{@link NumericShaper.Range#ARABIC}
  *     <br>
  *     {@link NumericShaper.Range#EASTERN_ARABIC}
  *     <td>{@link NumericShaper.Range#EASTERN_ARABIC}
+ * </tbody>
+ * <tbody>
  *   <tr>
  *     <th scope="row">Tai Tham
  *     <td>{@link NumericShaper.Range#TAI_THAM_HORA}
--- a/src/java.desktop/share/classes/java/awt/geom/Path2D.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/awt/geom/Path2D.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -892,83 +892,83 @@
          * <caption>Constants</caption>
          * <thead>
          * <tr>
-         * <th>Constant Name</th>
-         * <th>Byte Value</th>
-         * <th>Followed by</th>
-         * <th>Description</th>
+         * <th scope="col">Constant Name</th>
+         * <th scope="col">Byte Value</th>
+         * <th scope="col">Followed by</th>
+         * <th scope="col">Description</th>
          * </tr>
          * </thead>
          * <tbody>
          * <tr>
-         * <td>{@code SERIAL_STORAGE_FLT_ARRAY}</td>
+         * <th scope="row">{@code SERIAL_STORAGE_FLT_ARRAY}</th>
          * <td>0x30</td>
          * <td></td>
          * <td>A hint that the original {@code Path2D} object stored
          * the coordinates in a Java array of floats.</td>
          * </tr>
          * <tr>
-         * <td>{@code SERIAL_STORAGE_DBL_ARRAY}</td>
+         * <th scope="row">{@code SERIAL_STORAGE_DBL_ARRAY}</th>
          * <td>0x31</td>
          * <td></td>
          * <td>A hint that the original {@code Path2D} object stored
          * the coordinates in a Java array of doubles.</td>
          * </tr>
          * <tr>
-         * <td>{@code SERIAL_SEG_FLT_MOVETO}</td>
+         * <th scope="row">{@code SERIAL_SEG_FLT_MOVETO}</th>
          * <td>0x40</td>
          * <td>2 floats</td>
          * <td>A {@link #moveTo moveTo} path segment follows.</td>
          * </tr>
          * <tr>
-         * <td>{@code SERIAL_SEG_FLT_LINETO}</td>
+         * <th scope="row">{@code SERIAL_SEG_FLT_LINETO}</th>
          * <td>0x41</td>
          * <td>2 floats</td>
          * <td>A {@link #lineTo lineTo} path segment follows.</td>
          * </tr>
          * <tr>
-         * <td>{@code SERIAL_SEG_FLT_QUADTO}</td>
+         * <th scope="row">{@code SERIAL_SEG_FLT_QUADTO}</th>
          * <td>0x42</td>
          * <td>4 floats</td>
          * <td>A {@link #quadTo quadTo} path segment follows.</td>
          * </tr>
          * <tr>
-         * <td>{@code SERIAL_SEG_FLT_CUBICTO}</td>
+         * <th scope="row">{@code SERIAL_SEG_FLT_CUBICTO}</th>
          * <td>0x43</td>
          * <td>6 floats</td>
          * <td>A {@link #curveTo curveTo} path segment follows.</td>
          * </tr>
          * <tr>
-         * <td>{@code SERIAL_SEG_DBL_MOVETO}</td>
+         * <th scope="row">{@code SERIAL_SEG_DBL_MOVETO}</th>
          * <td>0x50</td>
          * <td>2 doubles</td>
          * <td>A {@link #moveTo moveTo} path segment follows.</td>
          * </tr>
          * <tr>
-         * <td>{@code SERIAL_SEG_DBL_LINETO}</td>
+         * <th scope="row">{@code SERIAL_SEG_DBL_LINETO}</th>
          * <td>0x51</td>
          * <td>2 doubles</td>
          * <td>A {@link #lineTo lineTo} path segment follows.</td>
          * </tr>
          * <tr>
-         * <td>{@code SERIAL_SEG_DBL_QUADTO}</td>
+         * <th scope="row">{@code SERIAL_SEG_DBL_QUADTO}</th>
          * <td>0x52</td>
          * <td>4 doubles</td>
          * <td>A {@link #curveTo curveTo} path segment follows.</td>
          * </tr>
          * <tr>
-         * <td>{@code SERIAL_SEG_DBL_CUBICTO}</td>
+         * <th scope="row">{@code SERIAL_SEG_DBL_CUBICTO}</th>
          * <td>0x53</td>
          * <td>6 doubles</td>
          * <td>A {@link #curveTo curveTo} path segment follows.</td>
          * </tr>
          * <tr>
-         * <td>{@code SERIAL_SEG_CLOSE}</td>
+         * <th scope="row">{@code SERIAL_SEG_CLOSE}</th>
          * <td>0x60</td>
          * <td></td>
          * <td>A {@link #closePath closePath} path segment.</td>
          * </tr>
          * <tr>
-         * <td>{@code SERIAL_PATH_END}</td>
+         * <th scope="row">{@code SERIAL_PATH_END}</th>
          * <td>0x61</td>
          * <td></td>
          * <td>There are no more path segments following.</td>
@@ -1666,83 +1666,83 @@
          * <caption>Constants</caption>
          * <thead>
          * <tr>
-         * <th>Constant Name</th>
-         * <th>Byte Value</th>
-         * <th>Followed by</th>
-         * <th>Description</th>
+         * <th scope="col">Constant Name</th>
+         * <th scope="col">Byte Value</th>
+         * <th scope="col">Followed by</th>
+         * <th scope="col">Description</th>
          * </tr>
          * </thead>
          * <tbody>
          * <tr>
-         * <td>{@code SERIAL_STORAGE_FLT_ARRAY}</td>
+         * <th scope="row">{@code SERIAL_STORAGE_FLT_ARRAY}</th>
          * <td>0x30</td>
          * <td></td>
          * <td>A hint that the original {@code Path2D} object stored
          * the coordinates in a Java array of floats.</td>
          * </tr>
          * <tr>
-         * <td>{@code SERIAL_STORAGE_DBL_ARRAY}</td>
+         * <th scope="row">{@code SERIAL_STORAGE_DBL_ARRAY}</th>
          * <td>0x31</td>
          * <td></td>
          * <td>A hint that the original {@code Path2D} object stored
          * the coordinates in a Java array of doubles.</td>
          * </tr>
          * <tr>
-         * <td>{@code SERIAL_SEG_FLT_MOVETO}</td>
+         * <th scope="row">{@code SERIAL_SEG_FLT_MOVETO}</th>
          * <td>0x40</td>
          * <td>2 floats</td>
          * <td>A {@link #moveTo moveTo} path segment follows.</td>
          * </tr>
          * <tr>
-         * <td>{@code SERIAL_SEG_FLT_LINETO}</td>
+         * <th scope="row">{@code SERIAL_SEG_FLT_LINETO}</th>
          * <td>0x41</td>
          * <td>2 floats</td>
          * <td>A {@link #lineTo lineTo} path segment follows.</td>
          * </tr>
          * <tr>
-         * <td>{@code SERIAL_SEG_FLT_QUADTO}</td>
+         * <th scope="row">{@code SERIAL_SEG_FLT_QUADTO}</th>
          * <td>0x42</td>
          * <td>4 floats</td>
          * <td>A {@link #quadTo quadTo} path segment follows.</td>
          * </tr>
          * <tr>
-         * <td>{@code SERIAL_SEG_FLT_CUBICTO}</td>
+         * <th scope="row">{@code SERIAL_SEG_FLT_CUBICTO}</th>
          * <td>0x43</td>
          * <td>6 floats</td>
          * <td>A {@link #curveTo curveTo} path segment follows.</td>
          * </tr>
          * <tr>
-         * <td>{@code SERIAL_SEG_DBL_MOVETO}</td>
+         * <th scope="row">{@code SERIAL_SEG_DBL_MOVETO}</th>
          * <td>0x50</td>
          * <td>2 doubles</td>
          * <td>A {@link #moveTo moveTo} path segment follows.</td>
          * </tr>
          * <tr>
-         * <td>{@code SERIAL_SEG_DBL_LINETO}</td>
+         * <th scope="row">{@code SERIAL_SEG_DBL_LINETO}</th>
          * <td>0x51</td>
          * <td>2 doubles</td>
          * <td>A {@link #lineTo lineTo} path segment follows.</td>
          * </tr>
          * <tr>
-         * <td>{@code SERIAL_SEG_DBL_QUADTO}</td>
+         * <th scope="row">{@code SERIAL_SEG_DBL_QUADTO}</th>
          * <td>0x52</td>
          * <td>4 doubles</td>
          * <td>A {@link #curveTo curveTo} path segment follows.</td>
          * </tr>
          * <tr>
-         * <td>{@code SERIAL_SEG_DBL_CUBICTO}</td>
+         * <th scope="row">{@code SERIAL_SEG_DBL_CUBICTO}</th>
          * <td>0x53</td>
          * <td>6 doubles</td>
          * <td>A {@link #curveTo curveTo} path segment follows.</td>
          * </tr>
          * <tr>
-         * <td>{@code SERIAL_SEG_CLOSE}</td>
+         * <th scope="row">{@code SERIAL_SEG_CLOSE}</th>
          * <td>0x60</td>
          * <td></td>
          * <td>A {@link #closePath closePath} path segment.</td>
          * </tr>
          * <tr>
-         * <td>{@code SERIAL_PATH_END}</td>
+         * <th scope="row">{@code SERIAL_PATH_END}</th>
          * <td>0x61</td>
          * <td></td>
          * <td>There are no more path segments following.</td>
--- a/src/java.desktop/share/classes/java/beans/PropertyChangeEvent.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/beans/PropertyChangeEvent.java	Wed Sep 25 22:40:41 2019 +0200
@@ -130,12 +130,14 @@
      * New value for property.  May be null if not known.
      * @serial
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private Object newValue;
 
     /**
      * Previous value for property.  May be null if not known.
      * @serial
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private Object oldValue;
 
     /**
@@ -143,6 +145,7 @@
      * @serial
      * @see #getPropagationId
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private Object propagationId;
 
     /**
--- a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextChildSupport.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextChildSupport.java	Wed Sep 25 22:40:41 2019 +0200
@@ -348,6 +348,7 @@
      * The {@code BeanContext} in which
      * this {@code BeanContextChild} is nested.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     public    BeanContextChild      beanContextChildPeer;
 
    /**
--- a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextEvent.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextEvent.java	Wed Sep 25 22:40:41 2019 +0200
@@ -100,5 +100,6 @@
     /**
      * The {@code BeanContext} from which this event was propagated
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     protected BeanContext propagatedFrom;
 }
--- a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextMembershipEvent.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextMembershipEvent.java	Wed Sep 25 22:40:41 2019 +0200
@@ -130,6 +130,7 @@
     * The list of children affected by this
     * event notification.
     */
-    @SuppressWarnings("rawtypes")
+    @SuppressWarnings({"rawtypes",
+                       "serial"}) // Not statically typed as Serializable
     protected Collection children;
 }
--- a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextServicesSupport.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextServicesSupport.java	Wed Sep 25 22:40:41 2019 +0200
@@ -616,7 +616,7 @@
             /**
              * The service provider.
              */
-
+            @SuppressWarnings("serial") // Not statically typed as Serializable
             protected BeanContextServiceProvider serviceProvider;
         }
 
--- a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextSupport.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextSupport.java	Wed Sep 25 22:40:41 2019 +0200
@@ -338,7 +338,9 @@
          */
 
 
+        @SuppressWarnings("serial") // Not statically typed as Serializable
         private           Object   child;
+        @SuppressWarnings("serial") // Not statically typed as Serializable
         private           Object   proxyPeer;
 
         private transient boolean  removePending;
--- a/src/java.desktop/share/classes/javax/imageio/metadata/IIOInvalidTreeException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/javax/imageio/metadata/IIOInvalidTreeException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -50,6 +50,7 @@
      * The {@code Node} that led to the parsing error, or
      * {@code null}.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     protected Node offendingNode = null;
 
     /**
--- a/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/gif_metadata.html	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/gif_metadata.html	Wed Sep 25 22:40:41 2019 +0200
@@ -5,7 +5,7 @@
   <title>GIF Metadata Format Specification</title>
 </head>
 <!--
-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
@@ -347,92 +347,120 @@
 <a id="mapping"></a>
 <table border=1>
 <caption><b>Mapping of Standard to GIF Native Stream Metadata</b></caption>
+<thead>
 <tr>
-<th>Standard Metadata Component</th>
-<th>GIF Native Stream Metadata Component</th>
+<th scope="col">Index</th>
+<th scope="col">Standard Metadata Component</th>
+<th scope="col">GIF Native Stream Metadata Component</th>
 </tr>
+</thead>
+<tbody>
 <tr>
+<th scope="row">1</th>
 <td>/Chroma/Palette/PaletteEntry@index</td>
 <td>/GlobalColorTable/ColorTableEntry@index</td>
 </tr>
 <tr>
+<th scope="row">2</th>
 <td>/Chroma/Palette/PaletteEntry@red</td>
 <td>/GlobalColorTable/ColorTableEntry@red</td>
 </tr>
 <tr>
+<th scope="row">3</th>
 <td>/Chroma/Palette/PaletteEntry@green</td>
 <td>/GlobalColorTable/ColorTableEntry@green</td>
 </tr>
 <tr>
+<th scope="row">4</th>
 <td>/Chroma/Palette/PaletteEntry@blue</td>
 <td>/GlobalColorTable/ColorTableEntry@blue</td>
 </tr>
 <tr>
+<th scope="row">5</th>
 <td>/Chroma/BackgroundIndex@value</td>
 <td>/GlobalColorTable@backgroundColorIndex</td>
 </tr>
 <tr>
+<th scope="row">6</th>
 <td>/Data/BitsPerSample@value</td>
 <td>/LogicalScreenDescriptor@colorResolution</td>
 </tr>
 <tr>
+<th scope="row">7</th>
 <td>/Dimension/PixelAspectRatio@value</td>
 <td>/LogicalScreenDescriptor@pixelAspectRatio</td>
 </tr>
 <tr>
+<th scope="row">8</th>
 <td>/Dimension/HorizontalScreenSize@value</td>
 <td>/LogicalScreenDescriptor@logicalScreenWidth</td>
 </tr>
 <tr>
+<th scope="row">9</th>
 <td>/Dimension/VerticalScreenSize@value</td>
 <td>/LogicalScreenDescriptor@logicalScreenHeight</td>
 </tr>
 <tr>
+<th scope="row">10</th>
 <td>/Document/FormatVersion@value</td>
 <td>/Version@value</td>
 </tr>
+</tbody>
 </table>
 
 <table border=1>
 <caption><b>Mapping of Standard to GIF Native Image Metadata</b></caption>
+<thead>
 <tr>
-<th>Standard Metadata Component</th>
-<th>GIF Native Image Metadata Component</th>
+<th scope="col">Index</th>
+<th scope="col">Standard Metadata Component</th>
+<th scope="col">GIF Native Image Metadata Component</th>
 </tr>
+</thead>
+<tbody>
 <tr>
+<th scope="row">1</th>
 <td>/Chroma/Palette/PaletteEntry@index</td>
 <td>/LocalColorTable/ColorTableEntry@index</td>
 </tr>
 <tr>
+<th scope="row">2</th>
 <td>/Chroma/Palette/PaletteEntry@red</td>
 <td>/LocalColorTable/ColorTableEntry@red</td>
 </tr>
 <tr>
+<th scope="row">3</th>
 <td>/Chroma/Palette/PaletteEntry@green</td>
 <td>/LocalColorTable/ColorTableEntry@green</td>
 </tr>
 <tr>
+<th scope="row">4</th>
 <td>/Chroma/Palette/PaletteEntry@blue</td>
 <td>/LocalColorTable/ColorTableEntry@blue</td>
 </tr>
 <tr>
+<th scope="row">5</th>
 <td>/Dimension/HorizontalPixelOffset@value</td>
 <td>/ImageDescriptor@imageLeftPosition</td>
 </tr>
 <tr>
+<th scope="row">6</th>
 <td>/Dimension/VerticalPixelOffset@value</td>
 <td>/ImageDescriptor@imageTopPosition</td>
 </tr>
 <tr>
+<th scope="row">7</th>
 <td>/Text/TextEntry@value</td>
 <td>/CommentExtensions/CommentExtension@value</td>
 </tr>
 <tr>
+<th scope="row">8</th>
 <td>/Transparency/TransparentIndex@value</td>
 <td>/GraphicControlExtension@transparentColorIndex
 (/GraphicControlExtension@transparentColorFlag is also set to
 "TRUE")</td>
 </tr>
+</tbody>
 </table>
 </main>
 </body>
--- a/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/tiff_metadata.html	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/tiff_metadata.html	Wed Sep 25 22:40:41 2019 +0200
@@ -5,7 +5,7 @@
     <title>TIFF Metadata Format Specification and Usage Notes</title>
 </head>
 <!--
-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
@@ -235,11 +235,16 @@
 in the following table.
 
 <table border="1">
+<thead>
 <tr>
-<th>Standard Metadata Element</th>
-<th>Derivation from TIFF Fields</th>
+<th scope="col">Index</th>
+<th scope="col">Standard Metadata Element</th>
+<th scope="col">Derivation from TIFF Fields</th>
 </tr>
+</thead>
+<tbody>
 <tr>
+<th scope="row">1</th>
 <td>/Chroma/ColorSpaceType@name</td>
 <td>PhotometricInterpretation: WhiteIsZero, BlackIsZero, TransparencyMask =
 "GRAY"; RGB, PaletteColor =&gt; "RGB"; CMYK =&gt; "CMYK";
@@ -247,18 +252,22 @@
 CIELab, ICCLab =&gt; "Lab".</td>
 </tr>
 <tr>
+<th scope="row">2</th>
 <td>/Chroma/NumChannels@value</td>
 <td>SamplesPerPixel</td>
 </tr>
 <tr>
+<th scope="row">3</th>
 <td>/Chroma/BlackIsZero@value</td>
 <td>"TRUE" &lt;=&gt; PhotometricInterpretation =&gt; WhiteIsZero</td>
 </tr>
 <tr>
+<th scope="row">4</th>
 <td>/Chroma/Palette</td>
 <td>ColorMap</td>
 </tr>
 <tr>
+<th scope="row">5</th>
 <td>/Compression/CompressionTypeName@value</td>
 <td>Compression: Uncompressed =&gt; "none"; CCITT 1D =&gt; "CCITT
 RLE";
@@ -269,14 +278,17 @@
 Deflate =&gt; "Deflate"; Exif JPEG =&gt; "JPEG".</td>
 </tr>
 <tr>
+<th scope="row">6</th>
 <td>/Compression/Lossless@value</td>
 <td>Compression: JPEG or New JPEG =&gt; "FALSE"; otherwise "TRUE".</td>
 </tr>
 <tr>
+<th scope="row">7</th>
 <td>/Data/PlanarConfiguration@value</td>
 <td>Chunky =&gt; "PixelInterleaved"; Planar =&gt; "PlaneInterleaved".</td>
 </tr>
 <tr>
+<th scope="row">8</th>
 <td>/Data/SampleFormat@value</td>
 <td>PhotometricInterpretation PaletteColor =&gt; "Index";
 SampleFormat unsigned integer data =&gt; "UnsignedIntegral";
@@ -286,53 +298,65 @@
 </td>
 </tr>
 <tr>
+<th scope="row">9</th>
 <td>/Data/BitsPerSample@value</td>
 <td>BitsPerSample as a space-separated list.</td>
 </tr>
 <tr>
+<th scope="row">10</th>
 <td>/Data/SampleMSB@value</td>
 <td>FillOrder: left-to-right =&gt; space-separated list of BitsPerSample-1;
 right-to-left =&gt; space-separated list of 0s.</td>
 </tr>
 <tr>
+<th scope="row">11</th>
 <td>/Dimension/PixelAspectRatio@value</td>
 <td>(1/XResolution)/(1/YResolution)</td>
 </tr>
 <tr>
+<th scope="row">12</th>
 <td>/Dimension/ImageOrientation@value</td>
 <td>Orientation</td>
 </tr>
 <tr>
+<th scope="row">13</th>
 <td>/Dimension/HorizontalPixelSize@value</td>
 <td>1/XResolution in millimeters if ResolutionUnit is not None.</td>
 </tr>
 <tr>
+<th scope="row">14</th>
 <td>/Dimension/VerticalPixelSize@value</td>
 <td>1/YResolution in millimeters if ResolutionUnit is not None.</td>
 </tr>
 <tr>
+<th scope="row">15</th>
 <td>/Dimension/HorizontalPosition@value</td>
 <td>XPosition in millimeters if ResolutionUnit is not None.</td>
 </tr>
 <tr>
+<th scope="row">16</th>
 <td>/Dimension/VerticalPosition@value</td>
 <td>YPosition in millimeters if ResolutionUnit is not None.</td>
 </tr>
 <tr>
+<th scope="row">17</th>
 <td>/Document/FormatVersion@value</td>
 <td>6.0</td>
 </tr>
 <tr>
+<th scope="row">18</th>
 <td>/Document/SubimageInterpretation@value</td>
 <td>NewSubFileType: transparency =&gt; "TransparencyMask";
 reduced-resolution =&gt; "ReducedResolution";
 single page =&gt; "SinglePage".</td>
 </tr>
 <tr>
+<th scope="row">19</th>
 <td>/Document/ImageCreationTime@value</td>
 <td>DateTime</td>
 </tr>
 <tr>
+<th scope="row">20</th>
 <td>/Text/TextEntry</td>
 <td>DocumentName, ImageDescription, Make, Model, PageName, Software,
 Artist, HostComputer, InkNames, Copyright:
@@ -343,10 +367,12 @@
 used to create the image.</td>
 </tr>
 <tr>
+<th scope="row">21</th>
 <td>/Transparency/Alpha@value</td>
 <td>ExtraSamples: associated alpha =&gt; "premultiplied";
 unassociated alpha =&gt; "nonpremultiplied".</td>
 </tr>
+</tbody>
 </table>
 
 <h3><a id="ExifRead">Reading Exif Images</a></h3>
@@ -490,40 +516,55 @@
 
 <table border=1>
 <caption><b>Supported Compression Types</b></caption>
-<tr><th>Compression Type</th> <th>Description</th> <th>Reference</th></tr>
+<thead>
 <tr>
+  <th scope="col">Index</th>
+  <th scope="col">Compression Type</th>
+  <th scope="col">Description</th>
+  <th scope="col">Reference</th></tr>
+<tr>
+</thead>
+<tbody>
+<th scope="row">1</th>
 <td>CCITT RLE</td>
 <td>Modified Huffman compression</td>
 <td>TIFF 6.0 Specification, Section 10</td>
 </tr>
 <tr>
+<th scope="row">2</th>
 <td>CCITT T.4</td>
 <td>CCITT T.4 bilevel encoding/Group 3 facsimile compression</td>
 <td>TIFF 6.0 Specification, Section 11</td>
 </tr>
 <tr>
+<th scope="row">3</th>
 <td>CCITT T.6</td>
 <td>CCITT T.6 bilevel encoding/Group 4 facsimile compression</td>
 <td>TIFF 6.0 Specification, Section 11</td></tr>
 <tr>
+<th scope="row">4</th>
 <td>LZW</td>
 <td>LZW compression</td>
 <td>TIFF 6.0 Specification, Section 13</td></tr>
 <tr>
+<th scope="row">5</th>
 <td>JPEG</td>
 <td>"New" JPEG-in-TIFF compression</td>
 <td>TIFF Technical Note #2</td></tr>
 <tr>
+<th scope="row">6</th>
 <td>ZLib</td>
 <td>"Deflate/Inflate" compression (see note following this table)</td>
 <td>Adobe Photoshop&#174; TIFF Technical Notes</td>
 </tr>
 <tr>
+<th scope="row">7</th>
 <td>PackBits</td>
 <td>Byte-oriented, run length compression</td>
 <td>TIFF 6.0 Specification, Section 9</td>
 </tr>
 <tr>
+<th scope="row">8</th>
 <td>Deflate</td>
 <td>"Zip-in-TIFF" compression (see note following this table)</td>
 <td><a href="https://tools.ietf.org/html/rfc1950">
@@ -532,10 +573,12 @@
 DEFLATE Compressed Data Format Specification</a></td>
 </tr>
 <tr>
+<th scope="row">9</th>
 <td>Exif JPEG</td>
 <td>Exif-specific JPEG compression (see note following this table)</td>
 <td><a href="http://www.exif.org/Exif2-2.PDF">Exif 2.2 Specification</a>
 (PDF), section 4.5.5, "Basic Structure of Thumbnail Data"</td>
+</tbody>
 </table>
 
 <p>
@@ -721,11 +764,16 @@
 given in the following table.
 
 <table border="1">
+<thead>
 <tr>
-<th>TIFF Field</th>
-<th>Derivation from Standard Metadata Elements</th>
+<th scope="col">Index</th>
+<th scope="col">TIFF Field</th>
+<th scope="col">Derivation from Standard Metadata Elements</th>
 </tr>
+</thead>
+<tbody>
 <tr>
+<th scope="row">1</th>
 <td>
 PhotometricInterpretation
 </td>
@@ -736,14 +784,17 @@
 "CMYK" =&gt; CMYK; "Lab" =&gt; CIELab.</td>
 </tr>
 <tr>
+<th scope="row">2</th>
 <td>SamplesPerPixel</td>
 <td>/Chroma/NumChannels@value</td>
 </tr>
 <tr>
+<th scope="row">3</th>
 <td>ColorMap</td>
 <td>/Chroma/Palette</td>
 </tr>
 <tr>
+<th scope="row">4</th>
 <td>Compression</td>
 <td>/Compression/CompressionTypeName@value: "none" =&gt; Uncompressed;
 "CCITT RLE" =&gt; CCITT 1D; "CCITT T.4" =&gt; Group 3 Fax; "CCITT T.6" =&gt; Group 4
@@ -751,11 +802,13 @@
 "PackBits" =&gt; PackBits; "Deflate" =&gt; Deflate.</td>
 </tr>
 <tr>
+<th scope="row">5</th>
 <td>PlanarConfiguration</td>
 <td>/Data/PlanarConfiguration@value: "PixelInterleaved" =&gt; Chunky;
 "PlaneInterleaved" =&gt; Planar.</td>
 </tr>
 <tr>
+<th scope="row">6</th>
 <td>SampleFormat</td>
 <td>/Data/SampleFormat@value: "SignedIntegral" =&gt; two's complement signed
 integer data; "UnsignedIntegral" =&gt; unsigned integer data; "Real" =&gt;
@@ -763,54 +816,65 @@
 </td>
 </tr>
 <tr>
+<th scope="row">7</th>
 <td>BitsPerSample</td>
 <td>/Data/BitsPerSample@value: space-separated list parsed to char array.</td>
 </tr>
 <tr>
+<th scope="row">8</th>
 <td>FillOrder</td>
 <td>/Data/SampleMSB@value: if all values in space-separated list are 0s =&gt;
 right-to-left; otherwise =&gt; left-to-right.
 </td>
 </tr>
 <tr>
+<th scope="row">9</th>
 <td>XResolution</td>
 <td>(10 / /Dimension/HorizontalPixelSize@value) or
 (10 / (/Dimension/VerticalPixelSize@value *
 /Dimension/PixelAspectRatio@value))</td>
 </tr>
 <tr>
+<th scope="row">10</th>
 <td>YResolution</td>
 <td>(10 / /Dimension/VerticalPixelSize@value) or
 (10 / (/Dimension/HorizontalPixelSize@value /
 /Dimension/PixelAspectRatio@value))</td>
 </tr>
 <tr>
+<th scope="row">11</th>
 <td>ResolutionUnit</td>
 <td>Centimeter if XResolution or YResolution set; otherwise None.</td>
 </tr>
 <tr>
+<th scope="row">12</th>
 <td>Orientation</td>
 <td>/Dimension/ImageOrientation@value</td>
 </tr>
 <tr>
+<th scope="row">13</th>
 <td>XPosition</td>
 <td>/Dimension/HorizontalPosition@value / 10</td>
 </tr>
 <tr>
+<th scope="row">14</th>
 <td>YPosition</td>
 <td>/Dimension/VerticalPosition@value / 10</td>
 </tr>
 <tr>
+<th scope="row">15</th>
 <td>NewSubFileType</td>
 <td>/Document/SubimageInterpretation@value: "TransparencyMask" =&gt;
 transparency mask; "ReducedResolution" =&gt; reduced-resolution;
 "SinglePage" =&gt; single page.</td>
 </tr>
 <tr>
+<th scope="row">16</th>
 <td>DateTime</td>
 <td>/Document/ImageCreationTime@value</td>
 </tr>
 <tr>
+<th scope="row">17</th>
 <td>DocumentName, ImageDescription, Make, Model, PageName, Software,
 Artist, HostComputer, InkNames, Copyright</td>
 <td>/Text/TextEntry: if /Text/TextEntry@keyword is the name of any of the
@@ -818,14 +882,12 @@
 /Text/TextEntry@value and count 1.</td>
 </tr>
 <tr>
+<th scope="row">18</th>
 <td>ExtraSamples</td>
 <td>/Transparency/Alpha@value: "premultiplied" =&gt; associated alpha, count 1;
 "nonpremultiplied" =&gt; unassociated alpha, count 1.</td>
 </tr>
-<tr>
-<td></td>
-<td></td>
-</tr>
+</tbody>
 </table>
 
 <h3><a id="ExifWrite">Writing Exif Images</a></h3>
--- a/src/java.desktop/share/classes/javax/imageio/spi/DigraphNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/javax/imageio/spi/DigraphNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -43,12 +43,14 @@
     private static final long serialVersionUID = 5308261378582246841L;
 
     /** The data associated with this node. */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     protected E data;
 
     /**
      * A {@code Set} of neighboring nodes pointed to by this
      * node.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     protected Set<DigraphNode<E>> outNodes = new HashSet<>();
 
     /** The in-degree of the node. */
@@ -58,6 +60,7 @@
      * A {@code Set} of neighboring nodes that point to this
      * node.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private Set<DigraphNode<E>> inNodes = new HashSet<>();
 
     public DigraphNode(E data) {
--- a/src/java.desktop/share/classes/javax/print/attribute/AttributeSetUtilities.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/javax/print/attribute/AttributeSetUtilities.java	Wed Sep 25 22:40:41 2019 +0200
@@ -86,6 +86,7 @@
         /**
          * The attribute set.
          */
+        @SuppressWarnings("serial") // Not statically typed as Serializable
         private AttributeSet attrset;
 
         /**
@@ -346,6 +347,7 @@
         /**
          * The attribute set.
          */
+        @SuppressWarnings("serial") // Not statically typed as Serializable
         private AttributeSet attrset;
 
         /**
--- a/src/java.desktop/share/classes/javax/print/attribute/standard/Finishings.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/javax/print/attribute/standard/Finishings.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -40,50 +40,31 @@
  * determines what constitutes a "copy" for purposes of finishing.
  * <p>
  * Standard Finishings values are:
- * <table class="borderless" style="width:100%;margin: 0px auto">
- * <caption>Standard Finishings values</caption>
- *   <tr>
- *     <td style="width:10%">&nbsp;
- *     <td style="width:27%">{@link #NONE NONE}
- *     <td style="width:27%">{@link #STAPLE STAPLE}
- *     <td style="width:36%">{@link #EDGE_STITCH EDGE_STITCH}
- *   <tr>
- *     <td>&nbsp;
- *     <td>{@link #BIND BIND}
- *     <td>{@link #SADDLE_STITCH SADDLE_STITCH}
- *     <td>{@link #COVER COVER}
- *     <td>&nbsp;
- * </table>
+ * <ul>
+ *   <li>{@link #NONE NONE}
+ *   <li>{@link #STAPLE STAPLE}
+ *   <li>{@link #EDGE_STITCH EDGE_STITCH}
+ *   <li>{@link #BIND BIND}
+ *   <li>{@link #SADDLE_STITCH SADDLE_STITCH}
+ *   <li>{@link #COVER COVER}
+ * </ul>
  * <p>
  * The following {@code Finishings} values are more specific; they indicate a
  * corner or an edge as if the document were a portrait document:
- * <table class="borderless" style="width:100%;margin: 0px auto">
- * <caption>Specific Finishings values</caption>
- *   <tr>
- *     <td style="width:10%">&nbsp;
- *     <td style="width:27%">{@link #STAPLE_TOP_LEFT STAPLE_TOP_LEFT}
- *     <td style="width:27%">{@link #EDGE_STITCH_LEFT EDGE_STITCH_LEFT}
- *     <td style="width:27%">{@link #STAPLE_DUAL_LEFT STAPLE_DUAL_LEFT}
- *     <td style="width:9%">&nbsp;
- *   <tr>
- *     <td style="width:10%">&nbsp;
- *     <td style="width:27%">{@link #STAPLE_BOTTOM_LEFT STAPLE_BOTTOM_LEFT}
- *     <td style="width:27%">{@link #EDGE_STITCH_TOP EDGE_STITCH_TOP}
- *     <td style="width:27%">{@link #STAPLE_DUAL_TOP STAPLE_DUAL_TOP}
- *     <td style="width:9%">&nbsp;
- *   <tr>
- *     <td style="width:10%">&nbsp;
- *     <td style="width:27%">{@link #STAPLE_TOP_RIGHT STAPLE_TOP_RIGHT}
- *     <td style="width:27%">{@link #EDGE_STITCH_RIGHT EDGE_STITCH_RIGHT}
- *     <td style="width:27%">{@link #STAPLE_DUAL_RIGHT STAPLE_DUAL_RIGHT}
- *     <td style="width:9%">&nbsp;
- *   <tr>
- *     <td style="width:10%">&nbsp;
- *     <td style="width:27%">{@link #STAPLE_BOTTOM_RIGHT STAPLE_BOTTOM_RIGHT}
- *     <td style="width:27%">{@link #EDGE_STITCH_BOTTOM EDGE_STITCH_BOTTOM}
- *     <td style="width:27%">{@link #STAPLE_DUAL_BOTTOM STAPLE_DUAL_BOTTOM}
- *     <td style="width:9%">&nbsp;
- * </table>
+ * <ul>
+ *   <li>{@link #STAPLE_TOP_LEFT STAPLE_TOP_LEFT}
+ *   <li>{@link #EDGE_STITCH_LEFT EDGE_STITCH_LEFT}
+ *   <li>{@link #STAPLE_DUAL_LEFT STAPLE_DUAL_LEFT}
+ *   <li>{@link #STAPLE_BOTTOM_LEFT STAPLE_BOTTOM_LEFT}
+ *   <li>{@link #EDGE_STITCH_TOP EDGE_STITCH_TOP}
+ *   <li>{@link #STAPLE_DUAL_TOP STAPLE_DUAL_TOP}
+ *   <li>{@link #STAPLE_TOP_RIGHT STAPLE_TOP_RIGHT}
+ *   <li>{@link #EDGE_STITCH_RIGHT EDGE_STITCH_RIGHT}
+ *   <li>{@link #STAPLE_DUAL_RIGHT STAPLE_DUAL_RIGHT}
+ *   <li>{@link #STAPLE_BOTTOM_RIGHT STAPLE_BOTTOM_RIGHT}
+ *   <li>{@link #EDGE_STITCH_BOTTOM EDGE_STITCH_BOTTOM}
+ *   <li>{@link #STAPLE_DUAL_BOTTOM STAPLE_DUAL_BOTTOM}
+ * </ul>
  * <p>
  * The STAPLE_<i>XXX</i> values are specified with respect to the document as if
  * the document were a portrait document. If the document is actually a
--- a/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeEvent.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeEvent.java	Wed Sep 25 22:40:41 2019 +0200
@@ -44,6 +44,7 @@
     /**
      * The printing service attributes that changed.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private PrintJobAttributeSet attributes;
 
     /**
--- a/src/java.desktop/share/classes/javax/print/event/PrintServiceAttributeEvent.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/javax/print/event/PrintServiceAttributeEvent.java	Wed Sep 25 22:40:41 2019 +0200
@@ -44,6 +44,7 @@
     /**
      * The printing service attributes that changed.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private PrintServiceAttributeSet attributes;
 
     /**
--- a/src/java.desktop/share/classes/javax/sound/sampled/LineEvent.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/javax/sound/sampled/LineEvent.java	Wed Sep 25 22:40:41 2019 +0200
@@ -60,6 +60,7 @@
      * @see #getType
      * @serial
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private final Type type;
 
     /**
--- a/src/java.desktop/share/classes/javax/swing/BoxLayout.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/javax/swing/BoxLayout.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, 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
@@ -36,16 +36,12 @@
  * vertically or horizontally. The components will not wrap so, for
  * example, a vertical arrangement of components will stay vertically
  * arranged when the frame is resized.
- * <table class="borderless" style="float:right">
- * <caption>Example:</caption>
- *    <TR>
- *      <TD style="text-align:center">
- *         <P STYLE="TEXT-ALIGN:CENTER"><IMG SRC="doc-files/BoxLayout-1.gif"
- *          alt="The following text describes this graphic."
- *          WIDTH="191" HEIGHT="201" STYLE="FLOAT:BOTTOM; BORDER:0">
- *      </TD>
- *    </TR>
- * </TABLE>
+ * <div style="float:right;text-align:center">
+ *   <p><b>Example:</b>
+ *   <p><img src="doc-files/BoxLayout-1.gif"
+ *      alt="The following text describes this graphic."
+ *      width="191" height="201">
+ * </div>
  * <p>
  * Nesting multiple panels with different combinations of horizontal and
  * vertical gives an effect similar to GridBagLayout, without the
--- a/src/java.desktop/share/classes/javax/swing/JLayeredPane.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/javax/swing/JLayeredPane.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, 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,16 +47,12 @@
  * <a href="https://docs.oracle.com/javase/tutorial/uiswing/components/layeredpane.html">How to Use a Layered Pane</a>,
  * a section in <em>The Java Tutorial</em>.
  *
- * <table class="borderless" style="float:right">
- * <caption>Example</caption>
- * <TR>
- *   <TD style="text-align:center">
- *     <P STYLE="TEXT-ALIGN:CENTER"><IMG SRC="doc-files/JLayeredPane-1.gif"
- *     alt="The following text describes this image."
- *     WIDTH="269" HEIGHT="264" STYLE="FLOAT:BOTTOM; BORDER=0">
- *   </TD>
- * </TR>
- * </TABLE>
+ * <div style="float:right;text-align:center">
+ *   <p><b>Example:</b>
+ *   <p><img src="doc-files/JLayeredPane-1.gif"
+ *       alt="The following text describes this image."
+ *       width="269" height="264">
+ * </div>
  * For convenience, <code>JLayeredPane</code> divides the depth-range
  * into several different layers. Putting a component into one of those
  * layers makes it easy to ensure that components overlap properly,
--- a/src/java.desktop/share/classes/javax/swing/JRootPane.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/javax/swing/JRootPane.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, 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
@@ -71,15 +71,11 @@
  * a given component.
  * </blockquote>
  *
- * <table class="borderless" style="float:right">
- * <caption>Example</caption>
- * <tr>
- * <td style="text-align:center">
- * <img src="doc-files/JRootPane-2.gif"
- * alt="The following text describes this graphic." HEIGHT=386 WIDTH=349>
- * </td>
- * </tr>
- * </table>
+ * <div style="float:right;text-align:center;font-weight:bold">
+ *   <p>Example:
+ *   <p><img src="doc-files/JRootPane-2.gif"
+ *      alt="the following text describes this graphic." height=386 width=349>
+ * </div>
  * The diagram at right shows the structure of a <code>JRootPane</code>.
  * A <code>JRootpane</code> is made up of a <code>glassPane</code>,
  * an optional <code>menuBar</code>, and a <code>contentPane</code>.
--- a/src/java.desktop/share/classes/javax/swing/JScrollPane.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/javax/swing/JScrollPane.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, 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
@@ -55,16 +55,12 @@
  * a section in <em>The Java Tutorial</em>.  Note that
  * <code>JScrollPane</code> does not support heavyweight components.
  *
- * <table class="borderless" style="float:right">
- * <caption>Example</caption>
- *    <TR>
- *    <TD style="text-align:center">
- *      <P STYLE="TEXT-ALIGN:CENTER"><IMG SRC="doc-files/JScrollPane-1.gif"
- *      alt="The following text describes this image."
- *      WIDTH="256" HEIGHT="248" STYLE="FLOAT:BOTTOM; BORDER:0px">
- *    </TD>
- *    </TR>
- * </TABLE>
+ * <div style="float:right;text-align:center">
+ *   <p><b>Example:</b>
+ *   <p><img src="doc-files/JScrollPane-1.gif"
+ *       alt="The following text describes this image."
+ *       width="256" height="248">
+ * </div>
  * The <code>JViewport</code> provides a window,
  * or &quot;viewport&quot; onto a data
  * source -- for example, a text file. That data source is the
--- a/src/java.desktop/share/classes/javax/swing/plaf/synth/doc-files/componentProperties.html	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/synth/doc-files/componentProperties.html	Wed Sep 25 22:40:41 2019 +0200
@@ -3,9 +3,10 @@
 <head>
   <meta charset="utf-8"/>
   <title>Component Specific Properties</title>
+  <style type="text/css">tbody th {font-weight:normal;text-align:left}</style>
 </head>
 <!--
-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,14 +57,14 @@
 <table border="1">
 <caption>ArrowButton Specific Properties</caption>
   <thead><tr>
-    <th>Property</th>
-    <th>Expected Type</th>
-    <th>Default Value</th>
-    <th>Description </th>
+    <th scope="col">Property</th>
+    <th scope="col">Expected Type</th>
+    <th scope="col">Default Value</th>
+    <th scope="col">Description </th>
   </tr>
   </thead> <tbody>
     <tr>
-      <td>ArrowButton.size</td>
+      <th scope="row">ArrowButton.size</th>
       <td>Integer</td>
       <td>16 	 </td>
       <td>Preferred size of the arrow button. </td>
@@ -78,14 +79,14 @@
 <table border="1">
 <caption>JButton Specific Properties</caption>
   <thead><tr>
-    <th>Property</th>
-    <th>Expected Type</th>
-    <th>Default Value</th>
-    <th>Description </th>
+    <th scope="col">Property</th>
+    <th scope="col">Expected Type</th>
+    <th scope="col">Default Value</th>
+    <th scope="col">Description </th>
   </tr>
   </thead> <tbody>
 	<tr>
-      <td>Button.defaultButtonFollowsFocus</td>
+      <th scope="row">Button.defaultButtonFollowsFocus</th>
       <td>Boolean</td>
       <td>true 	 </td>
       <td>Whether or not the 	    default JButton should change to the
@@ -101,14 +102,14 @@
 <table border="1">
 <caption>JCheckBox Specific Properties</caption>
   <thead><tr>
-    <th>Property</th>
-    <th>Expected Type</th>
-    <th>Default Value</th>
-    <th>Description </th>
+    <th scope="col">Property</th>
+    <th scope="col">Expected Type</th>
+    <th scope="col">Default Value</th>
+    <th scope="col">Description </th>
   </tr>
   </thead> <tbody>
 	<tr>
-      <td>CheckBox.icon</td>
+      <th scope="row">CheckBox.icon</th>
       <td>Icon</td>
       <td>null 	 </td>
       <td>Icon used to render the check. </td>
@@ -122,44 +123,44 @@
 <table border="1">
 <caption>JComboBox child components</caption>
   <thead><tr>
-    <th>Name</th>
-    <th>Type</th>
-    <th>Description </th>
+    <th scope="col">Name</th>
+    <th scope="col">Type</th>
+    <th scope="col">Description </th>
   </tr>
   </thead> <tbody>
 	<tr>
-      <td>ComboBox.arrowButton</td>
+      <th scope="row">ComboBox.arrowButton</th>
       <td>SynthArrowButton 	 </td>
       <td>Renders the drop down indicator. 	</td>
     </tr>
     <tr>
-      <td>ComboBox.list</td>
+      <th scope="row">ComboBox.list</th>
       <td>JList 	 </td>
       <td>JList used to render the values. 	</td>
     </tr>
     <tr>
-      <td>ComboBox.listRenderer</td>
+      <th scope="row">ComboBox.listRenderer</th>
       <td>Component 	 </td>
       <td>The renderer used for the JComboBox's JList. 	</td>
     </tr>
     <tr>
-      <td>ComboBox.popup</td>
+      <th scope="row">ComboBox.popup</th>
       <td>JPopupMenu 	 </td>
       <td>JPopupMenu used to show the ComboBox.list of the JComboBox. 	</td>
     </tr>
     <tr>
-      <td>ComboBox.renderer</td>
+      <th scope="row">ComboBox.renderer</th>
       <td>Component 	 </td>
       <td>The renderer used for the JComboBox. This is ONLY set if
 the renderer is a UIResource. 	</td>
     </tr>
     <tr>
-      <td>ComboBox.scrollPane</td>
+      <th scope="row">ComboBox.scrollPane</th>
       <td>JScrollPane 	 </td>
       <td>JScrollPane containing the JList. 	</td>
     </tr>
     <tr>
-      <td>ComboBox.textField</td>
+      <th scope="row">ComboBox.textField</th>
       <td>JTextField 	 </td>
       <td>The editor. </td>
     </tr>
@@ -170,14 +171,14 @@
 <table border="1">
 <caption>JComboBox Specific Properties</caption>
   <thead><tr>
-    <th>Property</th>
-    <th>Expected Type</th>
-    <th>Default Value</th>
-    <th>Description </th>
+    <th scope="col">Property</th>
+    <th scope="col">Expected Type</th>
+    <th scope="col">Default Value</th>
+    <th scope="col">Description </th>
   </tr>
   </thead> <tbody>
     <tr>
-      <td>ComboBox.showPopupOnNavigation</td>
+      <th scope="row">ComboBox.showPopupOnNavigation</th>
       <td>Boolean</td>
       <td>false 	 </td>
       <td>Whether or not the JPopupMenu should appear when 	 navigating
@@ -189,18 +190,19 @@
 <h2>JFileChooser</h2>
 <table cellpadding="2" cellspacing="2" border="1" style="width: 100%; text-align: left;">
 <caption>JFileChooser Specific Properties</caption>
-  <tbody>
+  <thead>
     <tr>
-      <th style="vertical-align: top; text-align: center;">Property</th>
-      <th style="vertical-align: top; text-align: center;">Expected Type<br>
+      <th scope="col" style="vertical-align: top; text-align: center;">Property</th>
+      <th scope="col" style="vertical-align: top; text-align: center;">Expected Type<br>
+      </th>
+      <th scope="col" style="vertical-align: top; text-align: center;">Default Value<br>
       </th>
-      <th style="vertical-align: top; text-align: center;">Default Value<br>
-      </th>
-      <th style="vertical-align: top; text-align: center;">Description</th>
+      <th scope="col" style="vertical-align: top; text-align: center;">Description</th>
     </tr>
+  </thead> <tbody>
     <tr>
-      <td style="vertical-align: top;">FileChooser.cancelIcon<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">FileChooser.cancelIcon<br>
+      </th>
       <td style="vertical-align: top;">Icon<br>
       </td>
       <td style="vertical-align: top;">null<br>
@@ -210,8 +212,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">FileChooser.okIcon<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">FileChooser.okIcon<br>
+      </th>
       <td style="vertical-align: top;">Icon<br>
       </td>
       <td style="vertical-align: top;">null<br>
@@ -221,8 +223,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">FileView.directoryIcon<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">FileView.directoryIcon<br>
+      </th>
       <td style="vertical-align: top;">Icon<br>
       </td>
       <td style="vertical-align: top;">null<br>
@@ -231,8 +233,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">FileView.fileIcon<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">FileView.fileIcon<br>
+      </th>
       <td style="vertical-align: top;">Icon<br>
       </td>
       <td style="vertical-align: top;">null<br>
@@ -241,8 +243,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">FileView.computerIcon<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">FileView.computerIcon<br>
+      </th>
       <td style="vertical-align: top;">Icon<br>
       </td>
       <td style="vertical-align: top;">null<br>
@@ -253,8 +255,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">FileView.hardDriveIcon<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">FileView.hardDriveIcon<br>
+      </th>
       <td style="vertical-align: top;">Icon<br>
       </td>
       <td style="vertical-align: top;">null<br>
@@ -265,8 +267,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">FileView.floppyDriveIcon<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">FileView.floppyDriveIcon<br>
+      </th>
       <td style="vertical-align: top;">Icon<br>
       </td>
       <td style="vertical-align: top;">null<br>
@@ -276,8 +278,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">FileChooser.newFolderIcon<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">FileChooser.newFolderIcon<br>
+      </th>
       <td style="vertical-align: top;">Icon<br>
       </td>
       <td style="vertical-align: top;">null<br>
@@ -287,8 +289,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">FileChooser.upFolderIcon<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">FileChooser.upFolderIcon<br>
+      </th>
       <td style="vertical-align: top;">Icon<br>
       </td>
       <td style="vertical-align: top;">null<br>
@@ -298,8 +300,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">FileChooser.homeFolderIcon<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">FileChooser.homeFolderIcon<br>
+      </th>
       <td style="vertical-align: top;">Icon<br>
       </td>
       <td style="vertical-align: top;">null<br>
@@ -309,8 +311,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">FileChooser.detailsViewIcon<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">FileChooser.detailsViewIcon<br>
+      </th>
       <td style="vertical-align: top;">Icon<br>
       </td>
       <td style="vertical-align: top;">null<br>
@@ -320,8 +322,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">FileChooser.listViewIcon<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">FileChooser.listViewIcon<br>
+      </th>
       <td style="vertical-align: top;">Icon<br>
       </td>
       <td style="vertical-align: top;">null<br>
@@ -332,8 +334,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">FileChooser.viewMenuIcon<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">FileChooser.viewMenuIcon<br>
+      </th>
       <td style="vertical-align: top;">Icon<br>
       </td>
       <td style="vertical-align: top;">null<br>
@@ -348,20 +350,20 @@
 <h2><a id="JInternalFrame"></a>JInternalFrame</h2>
 <table cellpadding="2" cellspacing="2" border="1" style="text-align: left; width: 100%;">
 <caption>JInternalFrame Specific Properties</caption>
-  <tbody>
-    <tr>
-      <th style="vertical-align: top; text-align: center;">Property<br>
+  <thead><tr>
+      <th scope="col" style="vertical-align: top; text-align: center;">Property<br>
       </th>
-      <th style="vertical-align: top; text-align: center;">Expected Type<br>
+      <th scope="col" style="vertical-align: top; text-align: center;">Expected Type<br>
       </th>
-      <th style="vertical-align: top; text-align: center;">DefaultValue<br>
+      <th scope="col" style="vertical-align: top; text-align: center;">DefaultValue<br>
       </th>
-      <th style="vertical-align: top; text-align: center;">Description<br>
+      <th scope="col" style="vertical-align: top; text-align: center;">Description<br>
       </th>
     </tr>
+  </thead> <tbody>
     <tr>
-      <td style="vertical-align: top;">InternalFrame.icon<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">InternalFrame.icon<br>
+      </th>
       <td style="vertical-align: top;">Icon</td>
       <td style="vertical-align: top;">null<br>
       </td>
@@ -380,20 +382,20 @@
 </p>
 <table cellpadding="2" cellspacing="2" border="1" style="text-align: left; width: 100%;">
 <caption>JInternalFrameTitlePane Specific Properties</caption>
-  <tbody>
-    <tr>
-      <th style="vertical-align: top; text-align: center;">Property<br>
+  <thead><tr>
+      <th scope="col" style="vertical-align: top; text-align: center;">Property<br>
       </th>
-      <th style="vertical-align: top; text-align: center;">Expected Type<br>
+      <th scope="col" style="vertical-align: top; text-align: center;">Expected Type<br>
       </th>
-      <th style="vertical-align: top; text-align: center;">Default Value<br>
+      <th scope="col" style="vertical-align: top; text-align: center;">Default Value<br>
       </th>
-      <th style="vertical-align: top; text-align: center;">Description<br>
+      <th scope="col" style="vertical-align: top; text-align: center;">Description<br>
       </th>
     </tr>
+  </thead> <tbody>
     <tr>
-      <td style="vertical-align: top;">InternalFrameTitlePane.maximizeIcon<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">InternalFrameTitlePane.maximizeIcon<br>
+      </th>
       <td style="vertical-align: top;">Icon</td>
       <td style="vertical-align: top;">null<br>
       </td>
@@ -402,8 +404,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">InternalFrameTitlePane.minimizeIcon<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">InternalFrameTitlePane.minimizeIcon<br>
+      </th>
       <td style="vertical-align: top;">Icon</td>
       <td style="vertical-align: top;">null<br>
       </td>
@@ -412,8 +414,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">InternalFrameTitlePane.iconifyIcon<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">InternalFrameTitlePane.iconifyIcon<br>
+      </th>
       <td style="vertical-align: top;">Icon</td>
       <td style="vertical-align: top;">null<br>
       </td>
@@ -422,8 +424,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">InternalFrameTitlePane.closeIcon<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">InternalFrameTitlePane.closeIcon<br>
+      </th>
       <td style="vertical-align: top;">Icon</td>
       <td style="vertical-align: top;">null<br>
       </td>
@@ -432,8 +434,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">InternalFrameTitlePane.titleSpacing<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">InternalFrameTitlePane.titleSpacing<br>
+      </th>
       <td style="vertical-align: top;">Integer</td>
       <td style="vertical-align: top;">2</td>
       <td style="vertical-align: top;">Space between the
@@ -441,8 +443,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">InternalFrameTitlePane.buttonSpacing<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">InternalFrameTitlePane.buttonSpacing<br>
+      </th>
       <td style="vertical-align: top;">Integer</td>
       <td style="vertical-align: top;">2</td>
       <td style="vertical-align: top;">Space between the buttons on
@@ -450,8 +452,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">InternalFrameTitlePane.maxFrameIconSize<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">InternalFrameTitlePane.maxFrameIconSize<br>
+      </th>
       <td style="vertical-align: top;">Dimension</td>
       <td style="vertical-align: top;">16x16</td>
       <td style="vertical-align: top;">Maximum size of the frame
@@ -460,8 +462,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">InternalFrameTitlePane.titleAlignment<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">InternalFrameTitlePane.titleAlignment<br>
+      </th>
       <td style="vertical-align: top;">leading|trailing|center</td>
       <td style="vertical-align: top;">leading</td>
       <td style="vertical-align: top;">Alignment for the title.
@@ -479,14 +481,14 @@
 <table border="1">
 <caption>JList Specific Properties</caption>
   <thead><tr>
-    <th>Property</th>
-    <th>Expected Type</th>
-    <th>Default Value</th>
-    <th>Description </th>
+    <th scope="col">Property</th>
+    <th scope="col">Expected Type</th>
+    <th scope="col">Default Value</th>
+    <th scope="col">Description </th>
   </tr>
   </thead> <tbody>
     <tr>
-      <td>List.rendererUseListColors</td>
+      <th scope="row">List.rendererUseListColors</th>
       <td>Boolean</td>
       <td>true 	 </td>
       <td>If true the renderers state is not updated, and the 	    text
@@ -495,7 +497,7 @@
 updated and the colors will instead come from the 	    Style. 	</td>
     </tr>
     <tr>
-      <td>List.rendererUseUIBorder</td>
+      <th scope="row">List.rendererUseUIBorder</th>
       <td>Boolean</td>
       <td>true 	 </td>
       <td>If true setBorder on the renderer will succeed 	 regardless
@@ -503,7 +505,7 @@
 only succeed if it is a Synth Border. 	</td>
     </tr>
     <tr>
-      <td>List.cellHeight</td>
+      <th scope="row">List.cellHeight</th>
       <td>Integer</td>
       <td>-1 	 </td>
       <td>Cell height of the JList. Is this is -1, 	 <code>setFixedCellHeight</code>
@@ -523,14 +525,14 @@
 <table border="1">
 <caption>Menu classes common properties</caption>
   <thead><tr>
-    <th>Property</th>
-    <th>Expected Type</th>
-    <th>Default Value</th>
-    <th>Description </th>
+    <th scope="col">Property</th>
+    <th scope="col">Expected Type</th>
+    <th scope="col">Default Value</th>
+    <th scope="col">Description </th>
   </tr>
   </thead> <tbody>
 	<tr>
-      <td>prefix.acceleratorDelimiter</td>
+      <th scope="row">prefix.acceleratorDelimiter</th>
       <td>String</td>
       <td>+ 	 </td>
       <td>String separator between the description of the 	 modifiers
@@ -538,7 +540,7 @@
 	</td>
     </tr>
     <tr>
-      <td>prefix.arrowIcon</td>
+      <th scope="row">prefix.arrowIcon</th>
       <td>Icon</td>
       <td>null 	 </td>
       <td>Icon drawn to the right of the text (or left when the
@@ -546,7 +548,7 @@
 typically only defined for JMenu. 	</td>
     </tr>
     <tr>
-      <td>prefix.checkIcon</td>
+      <th scope="row">prefix.checkIcon</th>
       <td>Icon</td>
       <td>null 	 </td>
       <td>Icon drawn to the left of the text (or right when the
@@ -555,7 +557,7 @@
 to provide the check or radio button. 	</td>
     </tr>
     <tr>
-      <td>prefix.margin</td>
+      <th scope="row">prefix.margin</th>
       <td>Insets</td>
       <td>Empty Insets (0, 0, 0, 0) 	 </td>
       <td>Margin for the JMenuItem. Refer to the javadoc of
@@ -563,7 +565,7 @@
 of how the margin is used. 	</td>
     </tr>
     <tr>
-      <td>prefix.textIconGap</td>
+      <th scope="row">prefix.textIconGap</th>
       <td>Integer</td>
       <td>4 	 </td>
       <td>Padding between the icon and text. Refer to the javadoc for
@@ -578,20 +580,20 @@
 <table border="1">
 <caption>JMenu specific properties</caption>
   <thead><tr>
-    <th>Property</th>
-    <th>Expected Type</th>
-    <th>Default Value</th>
-    <th>Description </th>
+    <th scope="col">Property</th>
+    <th scope="col">Expected Type</th>
+    <th scope="col">Default Value</th>
+    <th scope="col">Description </th>
   </tr>
   </thead> <tbody>
 	<tr>
-      <td>Menu.delay</td>
+      <th scope="row">Menu.delay</th>
       <td>Integer</td>
       <td>200 	 </td>
       <td>Sets the delay before the menu appears. 	</td>
     </tr>
     <tr>
-      <td>Menu.shortcutKeys</td>
+      <th scope="row">Menu.shortcutKeys</th>
       <td>int[]</td>
       <td>KeyEvent.ALT_MASK 	 </td>
       <td>Array of the KeyEvent modifiers to use for shortcut keys. </td>
@@ -607,26 +609,26 @@
 <table border="1">
 <caption>JOptionPane Specific Properties</caption>
   <thead><tr>
-    <th>Property</th>
-    <th>Expected Type</th>
-    <th>Default Value</th>
-    <th>Description </th>
+    <th scope="col">Property</th>
+    <th scope="col">Expected Type</th>
+    <th scope="col">Default Value</th>
+    <th scope="col">Description </th>
   </tr>
   </thead> <tbody>
 	<tr>
-      <td>OptionPane.buttonAreaBorder</td>
+      <th scope="row">OptionPane.buttonAreaBorder</th>
       <td>Border 	 </td>
       <td>null 	 </td>
       <td>Border around the button area. 	</td>
     </tr>
     <tr>
-      <td>OptionPane.buttonClickThreshhold</td>
+      <th scope="row">OptionPane.buttonClickThreshhold</th>
       <td>Integer 	 </td>
       <td>0 	 </td>
       <td>Passed to the created buttons setMultiClickThreshhold. 	</td>
     </tr>
     <tr>
-      <td>OptionPane.buttonOrientation</td>
+      <th scope="row">OptionPane.buttonOrientation</th>
       <td>Integer 	 </td>
       <td>SwingConstants.CENTER 	 </td>
       <td>How the buttons should be layed out, one of
@@ -634,80 +636,80 @@
 (this will be flipped when in a 	    right to left locale). 	</td>
     </tr>
     <tr>
-      <td>OptionPane.buttonPadding</td>
+      <th scope="row">OptionPane.buttonPadding</th>
       <td>Integer 	 </td>
       <td>6 	 </td>
       <td>Amount of space between buttons. 	</td>
     </tr>
     <tr>
-      <td>OptionPane.cancelIcon</td>
+      <th scope="row">OptionPane.cancelIcon</th>
       <td>Icon 	 </td>
       <td>null 	 </td>
       <td>Icon for the cancel button. 	</td>
     </tr>
     <tr>
-      <td>OptionPane.errorIcon</td>
+      <th scope="row">OptionPane.errorIcon</th>
       <td>Icon 	 </td>
       <td>null 	 </td>
       <td>Icon used for ERROR_MESSAGE. 	</td>
     </tr>
     <tr>
-      <td>OptionPane.informationIcon</td>
+      <th scope="row">OptionPane.informationIcon</th>
       <td>Icon 	 </td>
       <td>null 	 </td>
       <td>Icon used for INFORMATION_MESSAGE. 	</td>
     </tr>
     <tr>
-      <td>OptionPane.isYesLast</td>
+      <th scope="row">OptionPane.isYesLast</th>
       <td>Boolean 	 </td>
       <td>false 	 </td>
       <td>If true the 'yes' button leads other buttons, 	    otherwise
 it follows the other buttons. 	</td>
     </tr>
     <tr>
-      <td>OptionPane.questionIcon</td>
+      <th scope="row">OptionPane.questionIcon</th>
       <td>Icon 	 </td>
       <td>null 	 </td>
       <td>Icon used for error QUESTION_MESSAGE. 	</td>
     </tr>
     <tr>
-      <td>OptionPane.minimumSize</td>
+      <th scope="row">OptionPane.minimumSize</th>
       <td>Dimension 	 </td>
       <td>262x90</td>
       <td>Minimum size for the JOptionPane. 	</td>
     </tr>
     <tr>
-      <td>OptionPane.noIcon</td>
+      <th scope="row">OptionPane.noIcon</th>
       <td>Icon 	 </td>
       <td>null 	 </td>
       <td>Icon for the no button. 	</td>
     </tr>
     <tr>
-      <td>OptionPane.okIcon</td>
+      <th scope="row">OptionPane.okIcon</th>
       <td>Icon 	 </td>
       <td>null 	 </td>
       <td>Icon for the ok button. 	</td>
     </tr>
     <tr>
-      <td>OptionPane.sameSizeButtons</td>
+      <th scope="row">OptionPane.sameSizeButtons</th>
       <td>Boolean 	 </td>
       <td>true 	 </td>
       <td>Whether or not all the buttons should be the same size. 	</td>
     </tr>
     <tr>
-      <td>OptionPane.separatorPadding</td>
+      <th scope="row">OptionPane.separatorPadding</th>
       <td>Integer 	 </td>
       <td>6</td>
       <td>Amount of padding between the message area and 	 separator. 	</td>
     </tr>
     <tr>
-      <td>OptionPane.yesIcon</td>
+      <th scope="row">OptionPane.yesIcon</th>
       <td>Icon 	 </td>
       <td>null 	 </td>
       <td>Icon for the yes button. 	</td>
     </tr>
     <tr>
-      <td>OptionPane.warningIcon</td>
+      <th scope="row">OptionPane.warningIcon</th>
       <td>Icon 	 </td>
       <td>null 	 </td>
       <td>Icon used for error WARNING_MESSAGE 	</td>
@@ -719,18 +721,18 @@
 </h2>
 <table cellpadding="2" cellspacing="2" border="1" style="text-align: left; width: 100%;">
 <caption>JProgressBar Specific Properties</caption>
-  <tbody>
-    <tr>
-      <th style="vertical-align: top; text-align: center;">Property</th>
-      <th style="vertical-align: top; text-align: center;">Expected Type<br>
+  <thead><tr>
+      <th scope="col" style="vertical-align: top; text-align: center;">Property</th>
+      <th scope="col" style="vertical-align: top; text-align: center;">Expected Type<br>
+      </th>
+      <th scope="col" style="vertical-align: top; text-align: center;">Default Value<br>
       </th>
-      <th style="vertical-align: top; text-align: center;">Default Value<br>
-      </th>
-      <th style="vertical-align: top; text-align: center;">Description</th>
+      <th scope="col" style="vertical-align: top; text-align: center;">Description</th>
     </tr>
+  </thead> <tbody>
     <tr>
-      <td style="vertical-align: top;">ProgressBar.repaintInterval<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">ProgressBar.repaintInterval<br>
+      </th>
       <td style="vertical-align: top;">Integer<br>
       </td>
       <td style="vertical-align: top;">50<br>
@@ -740,8 +742,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">ProgressBar.cycleTime<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">ProgressBar.cycleTime<br>
+      </th>
       <td style="vertical-align: top;">Integer<br>
       </td>
       <td style="vertical-align: top;">3000<br>
@@ -760,14 +762,14 @@
 <table border="1">
 <caption>JRadioButton Specific Properties</caption>
   <thead><tr>
-    <th>Property</th>
-    <th>Expected Type</th>
-    <th>Default Value</th>
-    <th>Description </th>
+    <th scope="col">Property</th>
+    <th scope="col">Expected Type</th>
+    <th scope="col">Default Value</th>
+    <th scope="col">Description </th>
   </tr>
   </thead> <tbody>
 	<tr>
-      <td>RadioButton.icon</td>
+      <th scope="row">RadioButton.icon</th>
       <td>Icon</td>
       <td>null 	 </td>
       <td>Icon used to render the radio indicator. </td>
@@ -781,13 +783,13 @@
 <table border="1">
 <caption>JScrollBar child components</caption>
   <thead><tr>
-    <th>Name</th>
-    <th>Type</th>
-    <th>Description </th>
+    <th scope="col">Name</th>
+    <th scope="col">Type</th>
+    <th scope="col">Description </th>
   </tr>
   </thead> <tbody>
 	<tr>
-      <td>ScrollBar.button</td>
+      <th scope="row">ScrollBar.button</th>
       <td>SynthArrowButton 	 </td>
       <td>Identifies the increment/decrement buttons. </td>
     </tr>
@@ -798,27 +800,27 @@
 <table border="1">
 <caption>JScrollBar Specific Properties</caption>
   <thead><tr>
-    <th>Property</th>
-    <th>Expected Type</th>
-    <th>Default Value</th>
-    <th>Description </th>
+    <th scope="col">Property</th>
+    <th scope="col">Expected Type</th>
+    <th scope="col">Default Value</th>
+    <th scope="col">Description </th>
   </tr>
   </thead> <tbody>
 	<tr>
-      <td>ScrollBar.allowsAbsolutePositioning</td>
+      <th scope="row">ScrollBar.allowsAbsolutePositioning</th>
       <td>Boolean 	 </td>
       <td>false</td>
       <td>If true, middle mouse click in the track will 	    set the
 position of the track to where the mouse is. 	</td>
     </tr>
     <tr>
-      <td>ScrollBar.maximumThumbSize</td>
+      <th scope="row">ScrollBar.maximumThumbSize</th>
       <td>Dimension</td>
       <td>4096x4096 	 </td>
       <td>Maximum thumb size. 	</td>
     </tr>
     <tr>
-      <td>ScrollBar.minimumThumbSize</td>
+      <th scope="row">ScrollBar.minimumThumbSize</th>
       <td>Dimension</td>
       <td>Derived from ScrollBar.thumbHeight</td>
       <td>The minimum thumb size.  If this is not specified the
@@ -830,14 +832,14 @@
 	    size width is ScrollBar.thumbHeight with a height of 7.</td>
     </tr>
     <tr>
-      <td>ScrollBar.squareButtons</td>
+      <th scope="row">ScrollBar.squareButtons</th>
       <td>Boolean 	 </td>
       <td>false</td>
       <td>If true, the width and height of the scrollbar 	    buttons
 will be made equal. 	</td>
     </tr>
     <tr>
-      <td>ScrollBar.thumbHeight</td>
+      <th scope="row">ScrollBar.thumbHeight</th>
       <td>Integer</td>
       <td>14 	 </td>
       <td>The preferred height, when the orientation of the
@@ -853,14 +855,14 @@
 <table border="1">
 <caption>Separator classes common properties</caption>
   <thead><tr>
-    <th>Property</th>
-    <th>Expected Type</th>
-    <th>Default Value</th>
-    <th>Description </th>
+    <th scope="col">Property</th>
+    <th scope="col">Expected Type</th>
+    <th scope="col">Default Value</th>
+    <th scope="col">Description </th>
   </tr>
   </thead> <tbody>
 	<tr>
-      <td>Separator.thickness</td>
+      <th scope="row">Separator.thickness</th>
       <td>Integer</td>
       <td>2 	 </td>
       <td>Preferred width, for vertically aligned separators, or
@@ -873,14 +875,14 @@
 <table border="1">
 <caption>JToolBar.Separator specific properties</caption>
   <thead><tr>
-    <th>Property</th>
-    <th>Expected Type</th>
-    <th>Default Value</th>
-    <th>Description </th>
+    <th scope="col">Property</th>
+    <th scope="col">Expected Type</th>
+    <th scope="col">Default Value</th>
+    <th scope="col">Description </th>
   </tr>
   </thead> <tbody>
 	<tr>
-      <td>ToolBar.separatorSize</td>
+      <th scope="row">ToolBar.separatorSize</th>
       <td>Dimension</td>
       <td>null 	 </td>
     <td>The value of this is passed to the
@@ -907,14 +909,14 @@
 <table border="1">
 <caption>JScrollPane Specific Properties</caption>
   <thead><tr>
-    <th>Property</th>
-    <th>Expected Type</th>
-    <th>Default Value</th>
-    <th>Description </th>
+    <th scope="col">Property</th>
+    <th scope="col">Expected Type</th>
+    <th scope="col">Default Value</th>
+    <th scope="col">Description </th>
   </tr>
   </thead> <tbody>
     <tr>
-      <td>ScrollPane.viewportBorderInsets</td>
+      <th scope="row">ScrollPane.viewportBorderInsets</th>
       <td>Insets</td>
       <td>null 	 </td>
       <td>Insets for the viewport Border. 	</td>
@@ -931,39 +933,39 @@
 <table border="1">
 <caption>JSplitPane Specific Properties</caption>
   <thead><tr>
-    <th>Property</th>
-    <th>Expected Type</th>
-    <th>Default Value</th>
-    <th>Description </th>
+    <th scope="col">Property</th>
+    <th scope="col">Expected Type</th>
+    <th scope="col">Default Value</th>
+    <th scope="col">Description </th>
   </tr>
   </thead> <tbody>
     <tr>
-      <td>SplitPane.centerOneTouchButtons</td>
+      <th scope="row">SplitPane.centerOneTouchButtons</th>
       <td>Boolean</td>
       <td>true 	 </td>
       <td>If true, the one touch buttons are centered on the divider. 	</td>
     </tr>
     <tr>
-      <td>SplitPane.oneTouchButtonOffset</td>
+      <th scope="row">SplitPane.oneTouchButtonOffset</th>
       <td>Integer</td>
       <td>2 	 </td>
       <td>Distance between the one touch buttons. 	</td>
     </tr>
     <tr>
-      <td>SplitPane.oneTouchButtonSize</td>
+      <th scope="row">SplitPane.oneTouchButtonSize</th>
       <td>Integer</td>
       <td>6 	 </td>
       <td>Size to make the one touch buttons. 	</td>
     </tr>
     <tr>
-      <td>SplitPane.oneTouchExpandable</td>
+      <th scope="row">SplitPane.oneTouchExpandable</th>
       <td>Boolean</td>
       <td>null 	 </td>
       <td>If non null, the value of this is passed to
 setOneTouchExpandable. 	</td>
     </tr>
     <tr>
-      <td>SplitPane.size</td>
+      <th scope="row">SplitPane.size</th>
       <td>Integer</td>
       <td>6 	 </td>
       <td>Size of the divider </td>
@@ -974,20 +976,20 @@
 <h2><a id="JSlider"></a>JSlider</h2>
 <table cellpadding="2" cellspacing="2" border="1" style="text-align: left; width: 100%;">
 <caption>JSlider Specific Properties</caption>
-  <tbody>
-    <tr>
-      <th style="vertical-align: top; text-align: center;">Property<br>
+  <thead><tr>
+      <th scope="col" style="vertical-align: top; text-align: center;">Property<br>
       </th>
-      <th style="vertical-align: top; text-align: center;">Expected Type<br>
+      <th scope="col" style="vertical-align: top; text-align: center;">Expected Type<br>
       </th>
-      <th style="vertical-align: top; text-align: center;">Default Value<br>
+      <th scope="col" style="vertical-align: top; text-align: center;">Default Value<br>
       </th>
-      <th style="vertical-align: top; text-align: center;">Description<br>
+      <th scope="col" style="vertical-align: top; text-align: center;">Description<br>
       </th>
     </tr>
+  </thead> <tbody>
     <tr>
-      <td style="vertical-align: top;">Slider.thumbWidth<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">Slider.thumbWidth<br>
+      </th>
       <td style="vertical-align: top;">Integer<br>
       </td>
       <td style="vertical-align: top;">30<br>
@@ -996,8 +998,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">Slider.thumbHeight<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">Slider.thumbHeight<br>
+      </th>
       <td style="vertical-align: top;">Integer<br>
       </td>
       <td style="vertical-align: top;">14<br>
@@ -1006,8 +1008,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">Slider.trackBorder<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">Slider.trackBorder<br>
+      </th>
       <td style="vertical-align: top;">Integer<br>
       </td>
       <td style="vertical-align: top;">1<br>
@@ -1016,8 +1018,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">Slider.paintValue<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">Slider.paintValue<br>
+      </th>
       <td style="vertical-align: top;">Boolean<br>
       </td>
       <td style="vertical-align: top;">true<br>
@@ -1033,18 +1035,18 @@
 <h2><a id="JTabbedPane"></a>JTabbedPane</h2>
 <table cellpadding="2" cellspacing="2" border="1" style="text-align: left; width: 100%;">
 <caption>JTabbedPane Specific Properties</caption>
-  <tbody>
-    <tr>
-      <th style="vertical-align: top; text-align: center;">Property</th>
-      <th style="vertical-align: top; text-align: center;">Expected Type<br>
+  <thead><tr>
+      <th scope="col" style="vertical-align: top; text-align: center;">Property</th>
+      <th scope="col" style="vertical-align: top; text-align: center;">Expected Type<br>
+      </th>
+      <th scope="col" style="vertical-align: top; text-align: center;">Default Value<br>
       </th>
-      <th style="vertical-align: top; text-align: center;">Default Value<br>
-      </th>
-      <th style="vertical-align: top; text-align: center;">Description</th>
+      <th scope="col" style="vertical-align: top; text-align: center;">Description</th>
     </tr>
+  </thead> <tbody>
     <tr>
-      <td style="vertical-align: top;">TabbedPane.tabRunOverlay<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">TabbedPane.tabRunOverlay<br>
+      </th>
       <td style="vertical-align: top;">Integer<br>
       </td>
       <td style="vertical-align: top;">0<br>
@@ -1054,8 +1056,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">TabbedPane.textIconGap<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">TabbedPane.textIconGap<br>
+      </th>
       <td style="vertical-align: top;">Integer<br>
       </td>
       <td style="vertical-align: top;">0<br>
@@ -1066,8 +1068,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">TabbedPane.selectedTabPadInsets<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">TabbedPane.selectedTabPadInsets<br>
+      </th>
       <td style="vertical-align: top;">Insets<br>
       </td>
       <td style="vertical-align: top;">Empty Insets (0, 0, 0, 0)<br>
@@ -1077,8 +1079,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">TabbedPane.selectionFollowsFocus<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">TabbedPane.selectionFollowsFocus<br>
+      </th>
       <td style="vertical-align: top;">Boolean<br>
       </td>
       <td style="vertical-align: top;">true<br>
@@ -1097,21 +1099,21 @@
 <table border="1">
 <caption>JTable Specific Properties</caption>
   <thead><tr>
-    <th>Property</th>
-    <th>Expected Type</th>
-    <th>Default Value</th>
-    <th>Description </th>
+    <th scope="col">Property</th>
+    <th scope="col">Expected Type</th>
+    <th scope="col">Default Value</th>
+    <th scope="col">Description </th>
   </tr>
   </thead> <tbody>
     <tr>
-      <td>Table.gridColor</td>
+      <th scope="row">Table.gridColor</th>
       <td>Color</td>
       <td>null 	 </td>
       <td>Color used for the grid. If null the foreground from 	    the
 style is used. 	</td>
     </tr>
     <tr>
-      <td>Table.rendererUseTableColors</td>
+      <th scope="row">Table.rendererUseTableColors</th>
       <td>Boolean</td>
       <td>true 	 </td>
       <td>If true the renderers state is not updated, and the 	    text
@@ -1120,7 +1122,7 @@
 updated and the colors will instead come from the 	    Style. 	</td>
     </tr>
     <tr>
-      <td>Table.rendererUseUIBorder</td>
+      <th scope="row">Table.rendererUseUIBorder</th>
       <td>Boolean</td>
       <td>true 	 </td>
       <td>If true setBorder on the renderer will succeed
@@ -1128,7 +1130,7 @@
 renderer will only succeed if it is a Synth Border. 	</td>
     </tr>
     <tr>
-      <td>Table.rowHeight</td>
+      <th scope="row">Table.rowHeight</th>
       <td>Integer</td>
       <td>-1 	 </td>
       <td>If not -1 setRowHeight is invoked on the JTable. </td>
@@ -1142,59 +1144,59 @@
 <table border="1">
 <caption>JTree Specific Properties</caption>
   <thead><tr>
-    <th>Property</th>
-    <th>Expected Type</th>
-    <th>Default Value</th>
-    <th>Description </th>
+    <th scope="col">Property</th>
+    <th scope="col">Expected Type</th>
+    <th scope="col">Default Value</th>
+    <th scope="col">Description </th>
   </tr>
   </thead> <tbody>
     <tr>
-      <td>Tree.collapsedIcon</td>
+      <th scope="row">Tree.collapsedIcon</th>
       <td>Icon</td>
       <td>null 	 </td>
       <td>Icon to use when a node is collapsed. 	</td>
     </tr>
     <tr>
-      <td>Tree.drawHorizontalLines</td>
+      <th scope="row">Tree.drawHorizontalLines</th>
       <td>Boolean</td>
       <td>true 	 </td>
       <td>If true nodes have a horizontal connecting them to the
 leading edge of their parent. 	</td>
     </tr>
     <tr>
-      <td>Tree.drawVerticalLines</td>
+      <th scope="row">Tree.drawVerticalLines</th>
       <td>Boolean</td>
       <td>true 	 </td>
       <td>If true a vertical line is drawn down from expanded nodes. 	</td>
     </tr>
     <tr>
-      <td>Tree.expandedIcon</td>
+      <th scope="row">Tree.expandedIcon</th>
       <td>Icon</td>
       <td>null 	 </td>
       <td>Icon to use when a node has been expanded. 	</td>
     </tr>
     <tr>
-      <td>Tree.leftChildIndent</td>
+      <th scope="row">Tree.leftChildIndent</th>
       <td>Integer</td>
       <td>0 	 </td>
       <td>This plus Tree.rightChildIndent account for the 	    total
 space, along the y axis, to offset nodes from their 	    parent. 	</td>
     </tr>
     <tr>
-      <td>Tree.rightChildIndent</td>
+      <th scope="row">Tree.rightChildIndent</th>
       <td>Integer</td>
       <td>0 	 </td>
       <td>This plus Tree.leftChildIndent account for the 	    total
 space, along the y axis, to offset nodes from their 	    parent. 	</td>
     </tr>
     <tr>
-      <td>Tree.rowHeight</td>
+      <th scope="row">Tree.rowHeight</th>
       <td>Integer</td>
       <td>-1 	 </td>
       <td>Row height for the Tree.</td>
     </tr>
     <tr>
-      <td>Tree.scrollsHorizontallyAndVertically</td>
+      <th scope="row">Tree.scrollsHorizontallyAndVertically</th>
       <td>Boolean</td>
       <td>false 	 </td>
       <td>If false and scrolling needs to happen to accommodate 	 cells
@@ -1202,14 +1204,14 @@
 may happen along both the horizontal and 	    vertical axis. 	</td>
     </tr>
     <tr>
-      <td>Tree.scrollsOnExpand</td>
+      <th scope="row">Tree.scrollsOnExpand</th>
       <td>Boolean</td>
       <td>true 	 </td>
       <td>Whether or not the JTree should scroll when a node is
 expanded. </td>
     </tr>
     <tr>
-      <td>Tree.linesStyle</td>
+      <th scope="row">Tree.linesStyle</th>
       <td>String</td>
       <td>      </td>
       <td>The styles of the lines in the tree. Synth supports solid lines
@@ -1226,14 +1228,14 @@
 <table border="1">
 <caption>JToggleButton Specific Properties</caption>
   <thead><tr>
-    <th>Property</th>
-    <th>Expected Type</th>
-    <th>Default Value</th>
-    <th>Description </th>
+    <th scope="col">Property</th>
+    <th scope="col">Expected Type</th>
+    <th scope="col">Default Value</th>
+    <th scope="col">Description </th>
   </tr>
   </thead> <tbody>
 	<tr>
-      <td>ToggleButton.icon</td>
+      <th scope="row">ToggleButton.icon</th>
       <td>Icon</td>
       <td>null 	 </td>
       <td>Icon used to render the radio indicator. </td>
@@ -1248,14 +1250,14 @@
 <table border="1">
 <caption>Button classes common properties</caption>
   <thead><tr>
-    <th>Property</th>
-    <th>Expected Type</th>
-    <th>Default Value</th>
-    <th>Description </th>
+    <th scope="col">Property</th>
+    <th scope="col">Expected Type</th>
+    <th scope="col">Default Value</th>
+    <th scope="col">Description </th>
   </tr>
   </thead> <tbody>
 	<tr>
-      <td>prefix.contentAreaFilled</td>
+      <th scope="row">prefix.contentAreaFilled</th>
       <td>Integer</td>
       <td>true 	 </td>
     <td>Refer to the javadoc of
@@ -1265,7 +1267,7 @@
     </td>
   </tr>
     <tr>
-      <td>prefix.iconTextGap</td>
+      <th scope="row">prefix.iconTextGap</th>
       <td>Integer</td>
       <td>If unspecified, JButton.setIconTextGap is not invoked.</td>
       <td>Padding between the icon and text. Refer to the javadoc of
@@ -1274,7 +1276,7 @@
       </td>
     </tr>
     <tr>
-      <td>prefix.margin</td>
+      <th scope="row">prefix.margin</th>
       <td>Insets</td>
       <td>Empty Insets (0, 0, 0, 0) 	 </td>
       <td>Margin for the JButton. Refer to the javadoc of
@@ -1283,7 +1285,7 @@
       </td>
     </tr>
     <tr>
-      <td>prefix.textShiftOffset</td>
+      <th scope="row">prefix.textShiftOffset</th>
       <td>Integer</td>
       <td>0 	 </td>
       <td>Amount to shift the text and icon, along the x and y 	 axis,
@@ -1298,19 +1300,19 @@
 <h2><a id="textProperties"></a>Text Properties<br>
 </h2>
 <table cellpadding="2" cellspacing="2" border="1" style="text-align: left; width: 100%;">
-  <tbody>
-    <tr>
-      <th style="vertical-align: top; text-align: center;">Property</th>
-      <th style="vertical-align: top; text-align: center;">Expected Type<br>
+  <thead><tr>
+      <th scope="col" style="vertical-align: top; text-align: center;">Property</th>
+      <th scope="col" style="vertical-align: top; text-align: center;">Expected Type<br>
       </th>
-      <th style="vertical-align: top; text-align: center;">Default Value<br>
+      <th scope="col" style="vertical-align: top; text-align: center;">Default Value<br>
       </th>
-      <th style="vertical-align: top; text-align: center;">Description<br>
+      <th scope="col" style="vertical-align: top; text-align: center;">Description<br>
       </th>
     </tr>
+  </thead> <tbody>
     <tr>
-      <td style="vertical-align: top;">prefix.caretForeground<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">prefix.caretForeground<br>
+      </th>
       <td style="vertical-align: top;">Color<br>
       </td>
       <td style="vertical-align: top;">#000000</td>
@@ -1318,8 +1320,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">prefix.margin<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">prefix.margin<br>
+      </th>
       <td style="vertical-align: top;">Insets</td>
       <td style="vertical-align: top;">Empty Insets (0, 0, 0, 0),<br>
 EditorPane and TextPane (3, 3, 3, 3)<br>
@@ -1328,8 +1330,8 @@
       </td>
     </tr>
     <tr>
-      <td style="vertical-align: top;">prefix.caretBlinkRate<br>
-      </td>
+      <th scope="row" style="vertical-align: top;">prefix.caretBlinkRate<br>
+      </th>
       <td style="vertical-align: top;">Integer<br>
       </td>
       <td style="vertical-align: top;">500<br>
--- a/src/java.desktop/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html	Wed Sep 25 22:40:41 2019 +0200
@@ -4,7 +4,7 @@
   <meta charset="utf-8"/>
   <title>Synth File Format</title>
 <!--
- 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
@@ -777,12 +777,32 @@
       SynthPainter method:
     </p>
     <table border=1>
-     <caption> Painters for SynthPainter methods </caption>
-      <tr><th>State<th>Method<th>Painter
-	<tr><td>SELECTED<td>paintButtonBackground<td>stateButtonBackgroundPainter
-	<tr><td>SELECTED<td>Anything but paintButtonBackground<td>stateFallbackPainter
-	<tr><td>Anything but SELECTED<td>paintButtonBackground<td>styleButtonBackgroundPainter
-	<tr><td>Anything but SELECTED<td>Anything but paintButtonBackground<td>fallbackPainter
+     <caption>Painters for SynthPainter methods</caption>
+      <thead>
+      <tr>
+        <th scope="col">Index
+        <th scope="col">State
+        <th scope="col">Method
+        <th scope="col">Painter
+      </thead>
+      <tbody>
+	    <tr>
+        <th scope="row">1
+        <td>SELECTED
+        <td>paintButtonBackground<td>stateButtonBackgroundPainter
+	    <tr>
+        <th scope="row">2
+        <td>SELECTED
+        <td>Anything but paintButtonBackground<td>stateFallbackPainter
+	    <tr>
+        <th scope="row">3
+        <td>Anything but SELECTED
+        <td>paintButtonBackground<td>styleButtonBackgroundPainter
+	    <tr>
+        <th scope="row">4
+        <td>Anything but SELECTED
+        <td>Anything but paintButtonBackground<td>fallbackPainter
+      </tbody>
     </table>
 
     <p>
--- a/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -3577,7 +3577,7 @@
          *     <td>{@link DefaultComboBoxModel} or an {@link DefaultListModel},
          *     with an item type of Option
          *   <tr>
-         *     <td>textarea
+         *     <th scope="row">textarea
          *     <td>{@link PlainDocument}
          * </tbody>
          * </table>
--- a/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java	Wed Sep 25 22:40:41 2019 +0200
@@ -56,6 +56,7 @@
 
     private boolean isCursorAllowed = true;
     private boolean supportsXEmbed = false;
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private KeyboardFocusManager appletKFM;
     // JDK 1.1 compatibility
     private static final long serialVersionUID = 2967042741780317130L;
--- a/src/java.desktop/share/classes/sun/java2d/marlin/DMarlinRenderingEngine.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/DMarlinRenderingEngine.java	Wed Sep 25 22:40:41 2019 +0200
@@ -246,7 +246,8 @@
             widthScale = 1.0d;
         } else if ((at.getType() & (AffineTransform.TYPE_GENERAL_TRANSFORM  |
                                     AffineTransform.TYPE_GENERAL_SCALE)) != 0) {
-            widthScale = Math.sqrt(at.getDeterminant());
+            // Determinant may be negative (flip), use its absolute value:
+            widthScale = Math.sqrt(Math.abs(at.getDeterminant()));
         } else {
             // First calculate the "maximum scale" of this transform.
             double A = at.getScaleX();       // m00
--- a/src/java.desktop/share/classes/sun/java2d/marlin/MarlinRenderingEngine.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/MarlinRenderingEngine.java	Wed Sep 25 22:40:41 2019 +0200
@@ -245,7 +245,8 @@
             widthScale = 1.0f;
         } else if ((at.getType() & (AffineTransform.TYPE_GENERAL_TRANSFORM  |
                                     AffineTransform.TYPE_GENERAL_SCALE)) != 0) {
-            widthScale = (float)Math.sqrt(at.getDeterminant());
+            // Determinant may be negative (flip), use its absolute value:
+            widthScale = (float)Math.sqrt(Math.abs(at.getDeterminant()));
         } else {
             // First calculate the "maximum scale" of this transform.
             double A = at.getScaleX();       // m00
--- a/src/java.desktop/share/classes/sun/java2d/marlin/Version.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/Version.java	Wed Sep 25 22:40:41 2019 +0200
@@ -27,7 +27,7 @@
 
 public final class Version {
 
-    private static final String VERSION = "marlin-0.9.1.2-Unsafe-OpenJDK";
+    private static final String VERSION = "marlin-0.9.1.3-Unsafe-OpenJDK";
 
     public static String getVersion() {
         return VERSION;
--- a/src/java.desktop/share/classes/sun/java2d/opengl/OGLContext.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/sun/java2d/opengl/OGLContext.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2015, 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
@@ -25,26 +25,24 @@
 
 package sun.java2d.opengl;
 
+import java.lang.annotation.Native;
+
 import sun.java2d.pipe.BufferedContext;
 import sun.java2d.pipe.RenderBuffer;
 import sun.java2d.pipe.RenderQueue;
 import sun.java2d.pipe.hw.ContextCapabilities;
-import static sun.java2d.pipe.BufferedOpCodes.*;
-import static sun.java2d.pipe.hw.ContextCapabilities.*;
 
-import java.lang.annotation.Native;
+import static sun.java2d.pipe.BufferedOpCodes.INVALIDATE_CONTEXT;
+import static sun.java2d.pipe.BufferedOpCodes.SET_SCRATCH_SURFACE;
 
 /**
  * Note that the RenderQueue lock must be acquired before calling any of
  * the methods in this class.
  */
-public class OGLContext extends BufferedContext {
-
-    private final OGLGraphicsConfig config;
+final class OGLContext extends BufferedContext {
 
-    OGLContext(RenderQueue rq, OGLGraphicsConfig config) {
+    OGLContext(RenderQueue rq) {
         super(rq);
-        this.config = config;
     }
 
     /**
@@ -111,10 +109,6 @@
         rq.flushNow();
     }
 
-    public RenderQueue getRenderQueue() {
-        return OGLRenderQueue.getInstance();
-    }
-
     /**
      * Returns a string representing adapter id (vendor, renderer, version).
      * Must be called on the rendering thread.
@@ -123,38 +117,6 @@
      */
     static final native String getOGLIdString();
 
-    @Override
-    public void saveState() {
-        // assert rq.lock.isHeldByCurrentThread();
-
-        // reset all attributes of this and current contexts
-        invalidateContext();
-        invalidateCurrentContext();
-
-        setScratchSurface(config);
-
-        // save the state on the native level
-        rq.ensureCapacity(4);
-        buf.putInt(SAVE_STATE);
-        rq.flushNow();
-    }
-
-    @Override
-    public void restoreState() {
-        // assert rq.lock.isHeldByCurrentThread();
-
-        // reset all attributes of this and current contexts
-        invalidateContext();
-        invalidateCurrentContext();
-
-        setScratchSurface(config);
-
-        // restore the state on the native level
-        rq.ensureCapacity(4);
-        buf.putInt(RESTORE_STATE);
-        rq.flushNow();
-    }
-
     static class OGLContextCaps extends ContextCapabilities {
         /**
          * Indicates the presence of the GL_EXT_framebuffer_object extension.
--- a/src/java.desktop/share/classes/sun/java2d/opengl/OGLSurfaceData.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/sun/java2d/opengl/OGLSurfaceData.java	Wed Sep 25 22:40:41 2019 +0200
@@ -27,6 +27,7 @@
 
 import java.awt.AlphaComposite;
 import java.awt.Composite;
+import java.awt.GraphicsConfiguration;
 import java.awt.GraphicsEnvironment;
 import java.awt.Rectangle;
 import java.awt.Transparency;
@@ -578,16 +579,16 @@
      * (referenced by the pData parameter).  This method is invoked from
      * the native Dispose() method from the Disposer thread when the
      * Java-level OGLSurfaceData object is about to go away.  Note that we
-     * also pass a reference to the native GLX/WGLGraphicsConfigInfo
-     * (pConfigInfo) for the purposes of making a context current.
+     * also pass a reference to the OGLGraphicsConfig
+     * for the purposes of making a context current.
      */
-    static void dispose(long pData, long pConfigInfo) {
+    static void dispose(long pData, OGLGraphicsConfig gc) {
         OGLRenderQueue rq = OGLRenderQueue.getInstance();
         rq.lock();
         try {
             // make sure we have a current context before
             // disposing the native resources (e.g. texture object)
-            OGLContext.setScratchSurface(pConfigInfo);
+            OGLContext.setScratchSurface(gc);
 
             RenderBuffer buf = rq.getBuffer();
             rq.ensureCapacityAndAlignment(12, 4);
--- a/src/java.desktop/share/classes/sun/java2d/pipe/BufferedContext.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/sun/java2d/pipe/BufferedContext.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -30,16 +30,27 @@
 import java.awt.Composite;
 import java.awt.Paint;
 import java.awt.geom.AffineTransform;
-import sun.java2d.pipe.hw.AccelSurface;
+import java.lang.annotation.Native;
+import java.lang.ref.Reference;
+import java.lang.ref.WeakReference;
+
 import sun.java2d.InvalidPipeException;
 import sun.java2d.SunGraphics2D;
 import sun.java2d.loops.XORComposite;
-import static sun.java2d.pipe.BufferedOpCodes.*;
-import static sun.java2d.pipe.BufferedRenderPipe.BYTES_PER_SPAN;
+import sun.java2d.pipe.hw.AccelSurface;
 
-import java.lang.annotation.Native;
-import java.lang.ref.Reference;
-import java.lang.ref.WeakReference;
+import static sun.java2d.pipe.BufferedOpCodes.BEGIN_SHAPE_CLIP;
+import static sun.java2d.pipe.BufferedOpCodes.END_SHAPE_CLIP;
+import static sun.java2d.pipe.BufferedOpCodes.RESET_CLIP;
+import static sun.java2d.pipe.BufferedOpCodes.RESET_COMPOSITE;
+import static sun.java2d.pipe.BufferedOpCodes.RESET_TRANSFORM;
+import static sun.java2d.pipe.BufferedOpCodes.SET_ALPHA_COMPOSITE;
+import static sun.java2d.pipe.BufferedOpCodes.SET_RECT_CLIP;
+import static sun.java2d.pipe.BufferedOpCodes.SET_SHAPE_CLIP_SPANS;
+import static sun.java2d.pipe.BufferedOpCodes.SET_SURFACES;
+import static sun.java2d.pipe.BufferedOpCodes.SET_TRANSFORM;
+import static sun.java2d.pipe.BufferedOpCodes.SET_XOR_COMPOSITE;
+import static sun.java2d.pipe.BufferedRenderPipe.BYTES_PER_SPAN;
 
 /**
  * Base context class for managing state in a single-threaded rendering
@@ -77,8 +88,8 @@
      */
     @Native public static final int USE_MASK         = (1 << 1);
 
-    protected RenderQueue rq;
-    protected RenderBuffer buf;
+    private final RenderQueue rq;
+    private final RenderBuffer buf;
 
     /**
      * This is a reference to the most recently validated BufferedContext.  If
@@ -172,7 +183,7 @@
      * @throws InvalidPipeException if either src or dest surface is not valid
      * or lost
      */
-    public void validate(AccelSurface srcData, AccelSurface dstData,
+    private void validate(AccelSurface srcData, AccelSurface dstData,
                          Region clip, Composite comp,
                          AffineTransform xform,
                          Paint paint, SunGraphics2D sg2d, int flags)
@@ -310,21 +321,6 @@
         dstData.markDirty();
     }
 
-    /**
-     * Invalidates the surfaces associated with this context.  This is
-     * useful when the context is no longer needed, and we want to break
-     * the chain caused by these surface references.
-     *
-     * Note: must be called while the RenderQueue lock is held.
-     *
-     * @see RenderQueue#lock
-     * @see RenderQueue#unlock
-     */
-    private void invalidateSurfaces() {
-        validSrcDataRef.clear();
-        validDstDataRef.clear();
-    }
-
     private void setSurfaces(AccelSurface srcData,
                              AccelSurface dstData)
     {
@@ -433,12 +429,13 @@
      * @see RenderQueue#lock
      * @see RenderQueue#unlock
      */
-    public void invalidateContext() {
+    public final void invalidateContext() {
         resetTransform();
         resetComposite();
         resetClip();
         BufferedPaints.resetPaint(rq);
-        invalidateSurfaces();
+        validSrcDataRef.clear();
+        validDstDataRef.clear();
         validCompRef.clear();
         validClipRef.clear();
         validPaintRef.clear();
@@ -453,27 +450,7 @@
      * @return a render queue
      * @see RenderQueue
      */
-    public abstract RenderQueue getRenderQueue();
-
-    /**
-     * Saves the state of this context.
-     * It may reset the current context.
-     *
-     * Note: must be called while the RenderQueue lock is held.
-     *
-     * @see RenderQueue#lock
-     * @see RenderQueue#unlock
-     */
-    public abstract void saveState();
-
-    /**
-     * Restores the native state of this context.
-     * It may reset the current context.
-     *
-     * Note: must be called while the RenderQueue lock is held.
-     *
-     * @see RenderQueue#lock
-     * @see RenderQueue#unlock
-     */
-    public abstract void restoreState();
+    public final RenderQueue getRenderQueue() {
+        return rq;
+    }
 }
--- a/src/java.desktop/share/classes/sun/java2d/pipe/BufferedOpCodes.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/classes/sun/java2d/pipe/BufferedOpCodes.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, 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
@@ -27,7 +27,7 @@
 
 import java.lang.annotation.Native;
 
-public class BufferedOpCodes {
+public final class BufferedOpCodes {
     // draw ops
     @Native public static final int DRAW_LINE            = 10;
     @Native public static final int DRAW_RECT            = 11;
@@ -74,8 +74,6 @@
     @Native public static final int INVALIDATE_CONTEXT   = 75;
     @Native public static final int SYNC                 = 76;
     @Native public static final int RESTORE_DEVICES      = 77;
-    @Native public static final int SAVE_STATE           = 78;
-    @Native public static final int RESTORE_STATE        = 79;
 
     // multibuffering ops
     @Native public static final int SWAP_BUFFERS         = 80;
--- a/src/java.desktop/share/native/common/java2d/opengl/OGLRenderQueue.c	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/native/common/java2d/opengl/OGLRenderQueue.c	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2012, 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
@@ -502,31 +502,6 @@
                 dstOps = NULL;
             }
             break;
-        case sun_java2d_pipe_BufferedOpCodes_SAVE_STATE:
-            {
-                j2d_glPushAttrib(GL_ALL_ATTRIB_BITS);
-                j2d_glPushClientAttrib(GL_CLIENT_ALL_ATTRIB_BITS);
-                j2d_glMatrixMode(GL_MODELVIEW);
-                j2d_glPushMatrix();
-                j2d_glMatrixMode(GL_PROJECTION);
-                j2d_glPushMatrix();
-                j2d_glMatrixMode(GL_TEXTURE);
-                j2d_glPushMatrix();
-            }
-            break;
-
-        case sun_java2d_pipe_BufferedOpCodes_RESTORE_STATE:
-            {
-                j2d_glPopAttrib();
-                j2d_glPopClientAttrib();
-                j2d_glMatrixMode(GL_MODELVIEW);
-                j2d_glPopMatrix();
-                j2d_glMatrixMode(GL_PROJECTION);
-                j2d_glPopMatrix();
-                j2d_glMatrixMode(GL_TEXTURE);
-                j2d_glPopMatrix();
-            }
-            break;
         case sun_java2d_pipe_BufferedOpCodes_SYNC:
             {
                 sync = JNI_TRUE;
--- a/src/java.desktop/share/native/common/java2d/opengl/OGLSurfaceData.c	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/native/common/java2d/opengl/OGLSurfaceData.c	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, 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
@@ -37,7 +37,6 @@
  * The following methods are implemented in the windowing system (i.e. GLX
  * and WGL) source files.
  */
-extern jlong OGLSD_GetNativeConfigInfo(OGLSDOps *oglsdo);
 extern jboolean OGLSD_InitOGLWindow(JNIEnv *env, OGLSDOps *oglsdo);
 extern void OGLSD_DestroyOGLSurface(JNIEnv *env, OGLSDOps *oglsdo);
 
@@ -593,11 +592,14 @@
 OGLSD_Dispose(JNIEnv *env, SurfaceDataOps *ops)
 {
     OGLSDOps *oglsdo = (OGLSDOps *)ops;
-    jlong pConfigInfo = OGLSD_GetNativeConfigInfo(oglsdo);
+    jobject graphicsConfig = oglsdo->graphicsConfig;
 
     JNU_CallStaticMethodByName(env, NULL, "sun/java2d/opengl/OGLSurfaceData",
-                               "dispose", "(JJ)V",
-                               ptr_to_jlong(ops), pConfigInfo);
+                               "dispose",
+                               "(JLsun/java2d/opengl/OGLGraphicsConfig;)V",
+                               ptr_to_jlong(ops), graphicsConfig);
+    (*env)->DeleteGlobalRef(env, graphicsConfig);
+    oglsdo->graphicsConfig = NULL;
 }
 
 /**
--- a/src/java.desktop/share/native/common/java2d/opengl/OGLSurfaceData.h	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/share/native/common/java2d/opengl/OGLSurfaceData.h	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, 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
@@ -85,6 +85,9 @@
  * Pointer to native-specific (GLX, WGL, etc.) SurfaceData info, such as the
  * native Drawable handle and GraphicsConfig data.
  *
+ *     jobject graphicsConfig;;
+ * Strong reference to the OGLGraphicsConfig used by this OGLSurfaceData.
+ *
  *     jint drawableType;
  * The surface type; can be any one of the surface type constants defined
  * below (OGLSD_WINDOW, OGLSD_TEXTURE, etc).
@@ -162,6 +165,7 @@
 struct _OGLSDOps {
     SurfaceDataOps               sdOps;
     void                         *privOps;
+    jobject                      graphicsConfig;
     jint                         drawableType;
     GLenum                       activeBuffer;
     jboolean                     isOpaque;
--- a/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java	Wed Sep 25 22:40:41 2019 +0200
@@ -2558,14 +2558,16 @@
                  //System.out.println("XkbNewKeyboard:"+(xke.get_new_kbd()));
                  break;
             case XConstants.XkbMapNotify :
-                 //TODO: provide a simple unit test.
-                 XlibWrapper.XkbGetUpdatedMap(getDisplay(),
-                                              XConstants.XkbKeyTypesMask    |
-                                              XConstants.XkbKeySymsMask     |
-                                              XConstants.XkbModifierMapMask |
-                                              XConstants.XkbVirtualModsMask,
-                                              awt_XKBDescPtr);
-                 //System.out.println("XkbMap:"+(xke.get_map()));
+                 if (awt_XKBDescPtr != 0) {
+                    //TODO: provide a simple unit test.
+                    XlibWrapper.XkbGetUpdatedMap(getDisplay(),
+                                                 XConstants.XkbKeyTypesMask    |
+                                                 XConstants.XkbKeySymsMask     |
+                                                 XConstants.XkbModifierMapMask |
+                                                 XConstants.XkbVirtualModsMask,
+                                                 awt_XKBDescPtr);
+                 }
+                //System.out.println("XkbMap:"+(xke.get_map()));
                  break;
             case XConstants.XkbStateNotify :
                  // May use it later e.g. to obtain an effective group etc.
--- a/src/java.desktop/unix/classes/sun/java2d/opengl/GLXGraphicsConfig.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/unix/classes/sun/java2d/opengl/GLXGraphicsConfig.java	Wed Sep 25 22:40:41 2019 +0200
@@ -71,7 +71,7 @@
     private BufferCapabilities bufferCaps;
     private long pConfigInfo;
     private ContextCapabilities oglCaps;
-    private OGLContext context;
+    private final OGLContext context;
 
     private static native long getGLXConfigInfo(int screennum, int visualnum);
     private static native int getOGLCapabilities(long configInfo);
@@ -85,7 +85,7 @@
         pConfigInfo = configInfo;
         initConfig(getAData(), configInfo);
         this.oglCaps = oglCaps;
-        context = new OGLContext(OGLRenderQueue.getInstance(), this);
+        context = new OGLContext(OGLRenderQueue.getInstance());
     }
 
     @Override
--- a/src/java.desktop/unix/classes/sun/java2d/opengl/GLXSurfaceData.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/unix/classes/sun/java2d/opengl/GLXSurfaceData.java	Wed Sep 25 22:40:41 2019 +0200
@@ -40,7 +40,8 @@
     protected X11ComponentPeer peer;
     private GLXGraphicsConfig graphicsConfig;
 
-    private native void initOps(X11ComponentPeer peer, long aData);
+    private native void initOps(OGLGraphicsConfig gc, X11ComponentPeer peer,
+                                long aData);
 
     protected GLXSurfaceData(X11ComponentPeer peer, GLXGraphicsConfig gc,
                              ColorModel cm, int type)
@@ -48,7 +49,7 @@
         super(gc, cm, type);
         this.peer = peer;
         this.graphicsConfig = gc;
-        initOps(peer, graphicsConfig.getAData());
+        initOps(gc, peer, graphicsConfig.getAData());
     }
 
     public GraphicsConfiguration getDeviceConfiguration() {
--- a/src/java.desktop/unix/native/common/awt/X11Color.c	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/unix/native/common/awt/X11Color.c	Wed Sep 25 22:40:41 2019 +0200
@@ -402,6 +402,9 @@
     pVI = &awt_data->awt_visInfo;
     awt_data->awt_num_colors = awt_data->awt_visInfo.colormap_size;
     awt_data->awtImage = (awtImageData *) calloc (1, sizeof (awtImageData));
+    if (awt_data->awtImage == NULL) {
+        return 0;
+    }
 
     pPFV = XListPixmapFormats(dpy, &numpfv);
     if (pPFV) {
@@ -572,12 +575,17 @@
     }
 
     if (awt_data->awt_num_colors > paletteSize) {
-        free (awt_data->awtImage);
+        free(awt_data->awtImage);
         return 0;
     }
 
     /* Allocate ColorData structure */
     awt_data->color_data = ZALLOC (_ColorData);
+    if (awt_data->color_data == NULL) {
+        free(awt_data->awtImage);
+        return 0;
+    }
+
     awt_data->color_data->screendata = 1; /* This ColorData struct corresponds
                                              to some AWT screen/visual, so when
                                              any IndexColorModel using this
@@ -594,6 +602,11 @@
 
     awt_data->color_data->awt_Colors =
         (ColorEntry *)calloc(paletteSize, sizeof (ColorEntry));
+    if (awt_data->color_data->awt_Colors == NULL) {
+        free(awt_data->awtImage);
+        free(awt_data->color_data);
+        return 0;
+    }
 
     XQueryColors(dpy, cm, cols, awt_data->awt_num_colors);
     for (i = 0; i < awt_data->awt_num_colors; i++) {
@@ -667,6 +680,11 @@
 
         awt_data->color_data->img_grays =
             (unsigned char *)calloc(256, sizeof(unsigned char));
+        if ( awt_data->color_data->img_grays == NULL) {
+            free(awt_data->awtImage);
+            free(awt_data->color_data);
+            return 0;
+        }
         for (g = 0; g < 256; g++) {
             int mindist, besti;
             int d;
@@ -810,6 +828,11 @@
     awt_data->color_data->img_clr_tbl =
         (unsigned char *)calloc(LOOKUPSIZE * LOOKUPSIZE * LOOKUPSIZE,
                                 sizeof(unsigned char));
+    if (awt_data->color_data->img_clr_tbl == NULL) {
+        free(awt_data->awtImage);
+        free(awt_data->color_data);
+        return 0;
+    }
     img_makePalette(cmapsize, k, LOOKUPSIZE, 50, 250,
                     allocatedColorsNum, TRUE, reds, greens, blues,
                     awt_data->color_data->img_clr_tbl);
@@ -858,6 +881,12 @@
     awt_data->color_data->awt_icmLUT2Colors =
         (unsigned char *)calloc(paletteSize, sizeof (unsigned char));
     awt_data->color_data->awt_icmLUT = (int *)calloc(paletteSize, sizeof(int));
+    if (awt_data->color_data->awt_icmLUT2Colors == NULL || awt_data->color_data->awt_icmLUT == NULL) {
+        free(awt_data->awtImage);
+        free(awt_data->color_data);
+        return 0;
+    }
+
     for (i=0; i < paletteSize; i++) {
         /* Keep the mapping between this lut and the actual cmap */
         awt_data->color_data->awt_icmLUT2Colors
--- a/src/java.desktop/unix/native/common/awt/fontpath.c	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/unix/native/common/awt/fontpath.c	Wed Sep 25 22:40:41 2019 +0200
@@ -341,6 +341,9 @@
      * cost us a little wasted effort upstream.
      */
     fontdirs = (char**)calloc(nPaths+1, sizeof(char*));
+    if (fontdirs == NULL) {
+        return NULL;
+    }
     pos = 0;
     for (i=0; i < nPaths; i++) {
         if (x11Path[i][0] != '/') {
@@ -420,6 +423,9 @@
     }
     totalLen = len1+len2+len3;
     fontdirs = (char**)calloc(totalLen, sizeof(char*));
+    if (fontdirs == NULL) {
+        return NULL;
+    }
 
     for (i=0; i < len1; i++) {
         if (noType1 && strstr(p1[i], "Type1") != NULL) {
@@ -816,6 +822,10 @@
         fontdirs = NULL;
     } else {
         fontdirs = (char**)calloc(fontSet->nfont+1, sizeof(char*));
+        if (fontdirs == NULL) {
+            (*FcFontSetDestroy)(fontSet);
+            goto cleanup;
+        }
         for (f=0; f < fontSet->nfont; f++) {
             FcChar8 *file;
             FcChar8 *dir;
@@ -840,6 +850,7 @@
         (*FcFontSetDestroy)(fontSet);
     }
 
+cleanup:
     /* Free memory and close the ".so" */
     (*FcPatternDestroy)(pattern);
     closeFontConfig(libfontconfig, JNI_TRUE);
--- a/src/java.desktop/unix/native/common/java2d/opengl/GLXSurfaceData.c	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/unix/native/common/java2d/opengl/GLXSurfaceData.c	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, 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
@@ -54,23 +54,32 @@
 
 JNIEXPORT void JNICALL
 Java_sun_java2d_opengl_GLXSurfaceData_initOps(JNIEnv *env, jobject glxsd,
+                                              jobject gc,
                                               jobject peer, jlong aData)
 {
 #ifndef HEADLESS
-    GLXSDOps *glxsdo = (GLXSDOps *)malloc(sizeof(GLXSDOps));
-
-    if (glxsdo == NULL) {
-        JNU_ThrowOutOfMemoryError(env, "creating native GLX ops");
+    gc = (*env)->NewGlobalRef(env, gc);
+    if (gc == NULL) {
+        JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
         return;
     }
 
     OGLSDOps *oglsdo = (OGLSDOps *)SurfaceData_InitOps(env, glxsd,
                                                        sizeof(OGLSDOps));
     if (oglsdo == NULL) {
-        free(glxsdo);
+        (*env)->DeleteGlobalRef(env, gc);
         JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
         return;
     }
+    // later the graphicsConfig will be used for deallocation of oglsdo
+    oglsdo->graphicsConfig = gc;
+
+    GLXSDOps *glxsdo = (GLXSDOps *)malloc(sizeof(GLXSDOps));
+
+    if (glxsdo == NULL) {
+        JNU_ThrowOutOfMemoryError(env, "creating native GLX ops");
+        return;
+    }
 
     J2dTraceLn(J2D_TRACE_INFO, "GLXSurfaceData_initOps");
 
@@ -153,39 +162,6 @@
 }
 
 /**
- * Returns a pointer (as a jlong) to the native GLXGraphicsConfigInfo
- * associated with the given OGLSDOps.  This method can be called from
- * shared code to retrieve the native GraphicsConfig data in a platform-
- * independent manner.
- */
-jlong
-OGLSD_GetNativeConfigInfo(OGLSDOps *oglsdo)
-{
-    GLXSDOps *glxsdo;
-
-    if (oglsdo == NULL) {
-        J2dRlsTraceLn(J2D_TRACE_ERROR,
-                      "OGLSD_GetNativeConfigInfo: ops are null");
-        return 0L;
-    }
-
-    glxsdo = (GLXSDOps *)oglsdo->privOps;
-    if (glxsdo == NULL) {
-        J2dRlsTraceLn(J2D_TRACE_ERROR,
-                      "OGLSD_GetNativeConfigInfo: glx ops are null");
-        return 0L;
-    }
-
-    if (glxsdo->configData == NULL) {
-        J2dRlsTraceLn(J2D_TRACE_ERROR,
-                      "OGLSD_GetNativeConfigInfo: config data is null");
-        return 0L;
-    }
-
-    return ptr_to_jlong(glxsdo->configData->glxInfo);
-}
-
-/**
  * Makes the given GraphicsConfig's context current to its associated
  * "scratch" surface.  If there is a problem making the context current,
  * this method will return NULL; otherwise, returns a pointer to the
--- a/src/java.desktop/unix/native/libawt_xawt/awt/gtk_interface.c	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/unix/native/libawt_xawt/awt/gtk_interface.c	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, 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
@@ -66,6 +66,9 @@
     if (!n_libs) {
         n_libs = sizeof(gtk_libs) / sizeof(GtkLib);
         load_order = calloc(n_libs + 1, sizeof(GtkLib *));
+        if (load_order == NULL) {
+          return NULL;
+        }
     }
     int i, first = 0;
     for (i = 0; i < n_libs; i++) {
@@ -85,6 +88,7 @@
 
 static GtkLib* get_loaded() {
     GtkLib** libs = get_libs_order(GTK_ANY);
+    if (libs == NULL) return NULL;
     while(!gtk && *libs) {
         GtkLib* lib = *libs++;
         if (lib->check(lib->vname, /* load = */FALSE)) {
@@ -111,7 +115,7 @@
             }
         } else {
             GtkLib** libs = get_libs_order(version);
-            while (!gtk && *libs) {
+            while (!gtk && libs && *libs) {
                 lib = *libs++;
                 if (version == GTK_ANY || lib->version == version) {
                     if (verbose) {
@@ -141,6 +145,7 @@
 
 static gboolean check_version(GtkVersion version) {
     GtkLib** libs = get_libs_order(version);
+    if (libs == NULL) return FALSE;
     while (*libs) {
         GtkLib* lib = *libs++;
         if (lib->check(lib->vname, /* load = */TRUE)) {
--- a/src/java.desktop/unix/native/libawt_xawt/awt/multiVis.c	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/unix/native/libawt_xawt/awt/multiVis.c	Wed Sep 25 22:40:41 2019 +0200
@@ -218,7 +218,11 @@
      XColor *colors ;
 
      ncolors = (unsigned) src_vis->map_entries ;
-     *src_colors = colors = (XColor *)malloc(ncolors * sizeof(XColor) ) ;
+/* JDK modification.
+ * use calloc instead of malloc to initialize allocated memory
+ *   *src_colors = colors = (XColor *)malloc(ncolors * sizeof(XColor) ) ;
+ */
+     *src_colors = colors = (XColor *)calloc(ncolors, sizeof(XColor));
 
      if(src_vis->class != TrueColor && src_vis->class != DirectColor)
      {
--- a/src/java.desktop/windows/classes/sun/java2d/d3d/D3DContext.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/windows/classes/sun/java2d/d3d/D3DContext.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -26,19 +26,20 @@
 package sun.java2d.d3d;
 
 import java.lang.annotation.Native;
+
 import sun.java2d.pipe.BufferedContext;
 import sun.java2d.pipe.RenderBuffer;
 import sun.java2d.pipe.RenderQueue;
 import sun.java2d.pipe.hw.ContextCapabilities;
-import static sun.java2d.pipe.BufferedOpCodes.*;
-import static sun.java2d.pipe.hw.ContextCapabilities.*;
-import static sun.java2d.d3d.D3DContext.D3DContextCaps.*;
+
+import static sun.java2d.pipe.BufferedOpCodes.INVALIDATE_CONTEXT;
+import static sun.java2d.pipe.BufferedOpCodes.SET_SCRATCH_SURFACE;
 
 /**
  * Note that the RenderQueue lock must be acquired before calling any of
  * the methods in this class.
  */
-class D3DContext extends BufferedContext {
+final class D3DContext extends BufferedContext {
 
     private final D3DGraphicsDevice device;
 
@@ -101,42 +102,6 @@
         buf.putInt(d3dc.getDevice().getScreen());
     }
 
-    public RenderQueue getRenderQueue() {
-        return D3DRenderQueue.getInstance();
-    }
-
-    @Override
-    public void saveState() {
-        // assert rq.lock.isHeldByCurrentThread();
-
-        // reset all attributes of this and current contexts
-        invalidateContext();
-        invalidateCurrentContext();
-
-        setScratchSurface(this);
-
-        // save the state on the native level
-        rq.ensureCapacity(4);
-        buf.putInt(SAVE_STATE);
-        rq.flushNow();
-    }
-
-    @Override
-    public void restoreState() {
-        // assert rq.lock.isHeldByCurrentThread();
-
-        // reset all attributes of this and current contexts
-        invalidateContext();
-        invalidateCurrentContext();
-
-        setScratchSurface(this);
-
-        // restore the state on the native level
-        rq.ensureCapacity(4);
-        buf.putInt(RESTORE_STATE);
-        rq.flushNow();
-    }
-
     D3DGraphicsDevice getDevice() {
         return device;
     }
--- a/src/java.desktop/windows/classes/sun/java2d/opengl/WGLGraphicsConfig.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/windows/classes/sun/java2d/opengl/WGLGraphicsConfig.java	Wed Sep 25 22:40:41 2019 +0200
@@ -71,7 +71,7 @@
     private BufferCapabilities bufferCaps;
     private long pConfigInfo;
     private ContextCapabilities oglCaps;
-    private OGLContext context;
+    private final OGLContext context;
     private Object disposerReferent = new Object();
 
     public static native int getDefaultPixFmt(int screennum);
@@ -90,7 +90,7 @@
         super(device, visualnum);
         this.pConfigInfo = configInfo;
         this.oglCaps = oglCaps;
-        context = new OGLContext(OGLRenderQueue.getInstance(), this);
+        context = new OGLContext(OGLRenderQueue.getInstance());
 
         // add a record to the Disposer so that we destroy the native
         // WGLGraphicsConfigInfo data when this object goes away
--- a/src/java.desktop/windows/classes/sun/java2d/opengl/WGLSurfaceData.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/windows/classes/sun/java2d/opengl/WGLSurfaceData.java	Wed Sep 25 22:40:41 2019 +0200
@@ -46,8 +46,8 @@
     protected double scaleX = 1;
     protected double scaleY = 1;
 
-    private native void initOps(long pConfigInfo, WComponentPeer peer,
-                                long hwnd);
+    private native void initOps(OGLGraphicsConfig gc, long pConfigInfo,
+                                WComponentPeer peer, long hwnd);
 
     protected WGLSurfaceData(WComponentPeer peer, WGLGraphicsConfig gc,
                              ColorModel cm, int type)
@@ -62,7 +62,7 @@
         long pConfigInfo = gc.getNativeConfigInfo();
         long hwnd = peer != null ? peer.getHWnd() : 0L;
 
-        initOps(pConfigInfo, peer, hwnd);
+        initOps(gc, pConfigInfo, peer, hwnd);
     }
 
     @Override
--- a/src/java.desktop/windows/native/common/awt/systemscale/systemScale.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/windows/native/common/awt/systemscale/systemScale.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -24,7 +24,6 @@
  */
 #include "systemScale.h"
 #include <d2d1.h>
-#pragma comment(lib, "d2d1")
 #include <jdk_util.h>
 #ifndef MDT_EFFECTIVE_DPI
 #define MDT_EFFECTIVE_DPI 0
@@ -53,6 +52,9 @@
         return;
     }
 
+    typedef HRESULT(WINAPI D2D1CreateFactoryFunc)
+                   (D2D1_FACTORY_TYPE, REFIID,
+                    CONST D2D1_FACTORY_OPTIONS*, ID2D1Factory**);
     typedef HRESULT(WINAPI GetDpiForMonitorFunc)(HMONITOR, int, UINT*, UINT*);
     static HMODULE hLibSHCoreDll = NULL;
     static GetDpiForMonitorFunc *lpGetDpiForMonitor = NULL;
@@ -73,12 +75,27 @@
             *dpiY = static_cast<float>(y);
         }
     } else {
-        ID2D1Factory* m_pDirect2dFactory;
-        HRESULT res = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED,
-                                        &m_pDirect2dFactory);
-        if (res == S_OK) {
+        static HMODULE d2dDll = NULL;
+        static BOOL loadAttempted = FALSE;
+        static D2D1CreateFactoryFunc *lpD2D1CreateFactory = NULL;
+        if (!loadAttempted && d2dDll == NULL) {
+            loadAttempted = TRUE;
+            d2dDll = JDK_LoadSystemLibrary("d2d1.dll");
+        }
+        if (d2dDll != NULL && lpD2D1CreateFactory == NULL) {
+            lpD2D1CreateFactory = (D2D1CreateFactoryFunc*)GetProcAddress(
+                    d2dDll, "D2D1CreateFactory");
+        }
+        if (lpD2D1CreateFactory != NULL) {
+            ID2D1Factory* m_pDirect2dFactory;
+            HRESULT res = lpD2D1CreateFactory
+                          (D2D1_FACTORY_TYPE_SINGLE_THREADED,
+                           __uuidof(ID2D1Factory), NULL,
+                           &m_pDirect2dFactory);
+            if (res == S_OK) {
            // m_pDirect2dFactory->GetDesktopDpi(dpiX, dpiY);
-            m_pDirect2dFactory->Release();
+                m_pDirect2dFactory->Release();
+            }
         }
     }
     return;
--- a/src/java.desktop/windows/native/libawt/java2d/d3d/D3DContext.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/windows/native/libawt/java2d/d3d/D3DContext.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2016, 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
@@ -685,64 +685,6 @@
     return res;
 }
 
-HRESULT
-D3DContext::SaveState()
-{
-    HRESULT res;
-
-    RETURN_STATUS_IF_NULL(pd3dDevice, S_OK);
-
-    J2dTraceLn(J2D_TRACE_INFO, "D3DContext::SaveState");
-
-    FlushVertexQueue();
-    UpdateState(STATE_CHANGE);
-
-    if (pStateBlock != NULL) {
-        J2dTraceLn(J2D_TRACE_WARNING,
-                   "D3DContext::SaveState: existing state block!");
-        SAFE_RELEASE(pStateBlock);
-    }
-
-    if (SUCCEEDED(res =
-            pd3dDevice->CreateStateBlock(D3DSBT_ALL, &pStateBlock)))
-    {
-        J2dTraceLn(J2D_TRACE_VERBOSE, "  created state block");
-    } else {
-        J2dTraceLn(J2D_TRACE_WARNING,
-                   "D3DContext::SaveState: failed to create state block");
-    }
-    ZeroMemory(lastTexture, sizeof(lastTexture));
-
-    return res;
-}
-
-HRESULT
-D3DContext::RestoreState()
-{
-    HRESULT res = S_OK;
-
-    J2dTraceLn(J2D_TRACE_INFO, "D3DContext::RestoreState");
-
-    FlushVertexQueue();
-    UpdateState(STATE_CHANGE);
-
-    if (pStateBlock != NULL) {
-        if (SUCCEEDED(res = pStateBlock->Apply())) {
-            J2dTraceLn(J2D_TRACE_VERBOSE, "  restored device state");
-        } else {
-            J2dTraceLn(J2D_TRACE_WARNING,
-                       "D3DContext::RestoreState: failed to restore state");
-        }
-        SAFE_RELEASE(pStateBlock);
-    } else {
-        J2dTraceLn(J2D_TRACE_WARNING,
-                   "D3DContext::RestoreState: empty state block!");
-    }
-    ZeroMemory(lastTexture, sizeof(lastTexture));
-
-    return res;
-}
-
 #define POINT_FILTER_CAP (D3DPTFILTERCAPS_MAGFPOINT|D3DPTFILTERCAPS_MINFPOINT)
 #define LINEAR_FILTER_CAP (D3DPTFILTERCAPS_MAGFLINEAR|D3DPTFILTERCAPS_MINFLINEAR)
 
--- a/src/java.desktop/windows/native/libawt/java2d/d3d/D3DContext.h	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/windows/native/libawt/java2d/d3d/D3DContext.h	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2016, 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
@@ -133,13 +133,6 @@
     HRESULT ResetContext();
     HRESULT CheckAndResetDevice();
 
-    // saves the state of the D3D device in a state block, resets
-    // context's state to STATE_CHANGE
-    HRESULT SaveState();
-    // restores the state of the D3D device from existing state block,
-    // resets context's state to STATE_CHANGE
-    HRESULT RestoreState();
-
     void    ReleaseContextResources();
     void    ReleaseDefPoolResources();
     virtual ~D3DContext();
--- a/src/java.desktop/windows/native/libawt/java2d/d3d/D3DRenderQueue.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/windows/native/libawt/java2d/d3d/D3DRenderQueue.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2008, 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
@@ -677,23 +677,6 @@
                 }
             }
             break;
-
-        case sun_java2d_pipe_BufferedOpCodes_SAVE_STATE:
-            {
-                CONTINUE_IF_NULL(d3dc);
-
-                res = d3dc->SaveState();
-            }
-            break;
-
-        case sun_java2d_pipe_BufferedOpCodes_RESTORE_STATE:
-            {
-                CONTINUE_IF_NULL(d3dc);
-
-                res = d3dc->RestoreState();
-            }
-            break;
-
         // multibuffering ops
         case sun_java2d_pipe_BufferedOpCodes_SWAP_BUFFERS:
             {
--- a/src/java.desktop/windows/native/libawt/java2d/opengl/WGLSurfaceData.c	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/windows/native/libawt/java2d/opengl/WGLSurfaceData.c	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2015, 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
@@ -58,11 +58,25 @@
 
 JNIEXPORT void JNICALL
 Java_sun_java2d_opengl_WGLSurfaceData_initOps(JNIEnv *env, jobject wglsd,
-                                              jlong pConfigInfo,
+                                              jobject gc, jlong pConfigInfo,
                                               jobject peer, jlong hwnd)
 {
+    gc = (*env)->NewGlobalRef(env, gc);
+    if (gc == NULL) {
+        JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
+        return;
+    }
+
     OGLSDOps *oglsdo = (OGLSDOps *)SurfaceData_InitOps(env, wglsd,
                                                        sizeof(OGLSDOps));
+    if (oglsdo == NULL) {
+        (*env)->DeleteGlobalRef(env, gc);
+        JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
+        return;
+    }
+    // later the graphicsConfig will be used for deallocation of oglsdo
+    oglsdo->graphicsConfig = gc;
+
     WGLSDOps *wglsdo = (WGLSDOps *)malloc(sizeof(WGLSDOps));
 
     J2dTraceLn(J2D_TRACE_INFO, "WGLSurfaceData_initOps");
@@ -145,33 +159,6 @@
 }
 
 /**
- * Returns a pointer (as a jlong) to the native WGLGraphicsConfigInfo
- * associated with the given OGLSDOps.  This method can be called from
- * shared code to retrieve the native GraphicsConfig data in a platform-
- * independent manner.
- */
-jlong
-OGLSD_GetNativeConfigInfo(OGLSDOps *oglsdo)
-{
-    WGLSDOps *wglsdo;
-
-    if (oglsdo == NULL) {
-        J2dRlsTraceLn(J2D_TRACE_ERROR,
-                      "OGLSD_GetNativeConfigInfo: ops are null");
-        return 0L;
-    }
-
-    wglsdo = (WGLSDOps *)oglsdo->privOps;
-    if (wglsdo == NULL) {
-        J2dRlsTraceLn(J2D_TRACE_ERROR,
-                      "OGLSD_GetNativeConfigInfo: wgl ops are null");
-        return 0L;
-    }
-
-    return ptr_to_jlong(wglsdo->configInfo);
-}
-
-/**
  * Makes the given GraphicsConfig's context current to its associated
  * "scratch" surface.  If there is a problem making the context current,
  * this method will return NULL; otherwise, returns a pointer to the
--- a/src/java.desktop/windows/native/libawt/windows/awt_Win32GraphicsDevice.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.desktop/windows/native/libawt/windows/awt_Win32GraphicsDevice.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -49,8 +49,6 @@
 #include "dither.h"
 #include "img_util_md.h"
 #include "Devices.h"
-#include <d2d1.h>
-#pragma comment(lib, "d2d1")
 #include "systemScale.h"
 
 uns_ordered_dither_array img_oda_alpha;
--- a/src/java.security.jgss/macosx/native/libosxkrb5/nativeccache.c	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.security.jgss/macosx/native/libosxkrb5/nativeccache.c	Wed Sep 25 22:40:41 2019 +0200
@@ -43,7 +43,6 @@
  * Statics for this module
  */
 
-static jclass derValueClass = NULL;
 static jclass ticketClass = NULL;
 static jclass principalNameClass = NULL;
 static jclass encryptionKeyClass = NULL;
@@ -54,7 +53,6 @@
 static jclass hostAddressClass = NULL;
 static jclass hostAddressesClass = NULL;
 
-static jmethodID derValueConstructor = 0;
 static jmethodID ticketConstructor = 0;
 static jmethodID principalNameConstructor = 0;
 static jmethodID encryptionKeyConstructor = 0;
@@ -108,9 +106,6 @@
     principalNameClass = FindClass(env, "sun/security/krb5/PrincipalName");
     if (principalNameClass == NULL) return JNI_ERR;
 
-    derValueClass = FindClass(env, "sun/security/util/DerValue");
-    if (derValueClass == NULL) return JNI_ERR;
-
     encryptionKeyClass = FindClass(env, "sun/security/krb5/EncryptionKey");
     if (encryptionKeyClass == NULL) return JNI_ERR;
 
@@ -132,13 +127,7 @@
     hostAddressesClass = FindClass(env,"sun/security/krb5/internal/HostAddresses");
     if (hostAddressesClass == NULL) return JNI_ERR;
 
-    derValueConstructor = (*env)->GetMethodID(env, derValueClass, "<init>", "([B)V");
-    if (derValueConstructor == 0) {
-        printf("Couldn't find DerValue constructor\n");
-        return JNI_ERR;
-    }
-
-    ticketConstructor = (*env)->GetMethodID(env, ticketClass, "<init>", "(Lsun/security/util/DerValue;)V");
+    ticketConstructor = (*env)->GetMethodID(env, ticketClass, "<init>", "([B)V");
     if (ticketConstructor == 0) {
         printf("Couldn't find Ticket constructor\n");
         return JNI_ERR;
@@ -204,9 +193,6 @@
     if (ticketClass != NULL) {
         (*env)->DeleteWeakGlobalRef(env,ticketClass);
     }
-    if (derValueClass != NULL) {
-        (*env)->DeleteWeakGlobalRef(env,derValueClass);
-    }
     if (principalNameClass != NULL) {
         (*env)->DeleteWeakGlobalRef(env,principalNameClass);
     }
@@ -421,11 +407,9 @@
 
 jobject BuildTicket(JNIEnv *env, krb5_data *encodedTicket)
 {
-    /* To build a Ticket, we first need to build a DerValue out of the EncodedTicket.
-    * But before we can do that, we need to make a byte array out of the ET.
-    */
+    // To build a Ticket, we need to make a byte array out of the EncodedTicket.
 
-    jobject derValue, ticket;
+    jobject ticket;
     jbyteArray ary;
 
     ary = (*env)->NewByteArray(env, encodedTicket->length);
@@ -439,19 +423,12 @@
         return (jobject) NULL;
     }
 
-    derValue = (*env)->NewObject(env, derValueClass, derValueConstructor, ary);
+    ticket = (*env)->NewObject(env, ticketClass, ticketConstructor, ary);
     if ((*env)->ExceptionCheck(env)) {
         (*env)->DeleteLocalRef(env, ary);
         return (jobject) NULL;
     }
-
     (*env)->DeleteLocalRef(env, ary);
-    ticket = (*env)->NewObject(env, ticketClass, ticketConstructor, derValue);
-    if ((*env)->ExceptionCheck(env)) {
-        (*env)->DeleteLocalRef(env, derValue);
-        return (jobject) NULL;
-    }
-    (*env)->DeleteLocalRef(env, derValue);
     return ticket;
 }
 
--- a/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSCredElement.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSCredElement.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, 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
@@ -61,6 +61,7 @@
     }
 
     // Construct delegation cred using the actual context mech and srcName
+    // Warning: called by NativeUtil.c
     GSSCredElement(long pCredentials, GSSNameElement srcName, Oid mech)
         throws GSSException {
         pCred = pCredentials;
--- a/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSLibStub.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSLibStub.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, 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
@@ -43,7 +43,7 @@
 class GSSLibStub {
 
     private Oid mech;
-    private long pMech;
+    private long pMech; // Warning: used by NativeUtil.c
 
     /**
      * Initialization routine to dynamically load function pointers.
--- a/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSNameElement.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSNameElement.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, 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
@@ -97,6 +97,7 @@
         printableName = "<DEFAULT ACCEPTOR>";
     }
 
+    // Warning: called by NativeUtil.c
     GSSNameElement(long pNativeName, GSSLibStub stub) throws GSSException {
         assert(stub != null);
         if (pNativeName == 0) {
--- a/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/NativeGSSContext.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/NativeGSSContext.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -59,20 +59,22 @@
 
     private static final int NUM_OF_INQUIRE_VALUES = 6;
 
+    // Warning: The following 9 fields are used by NativeUtil.c
     private long pContext = 0; // Pointer to the gss_ctx_id_t structure
     private GSSNameElement srcName;
     private GSSNameElement targetName;
-    private GSSCredElement cred;
-    private GSSCredElement disposeCred;
     private boolean isInitiator;
     private boolean isEstablished;
+    private GSSCredElement delegatedCred;
+    private int flags;
+    private int lifetime = GSSCredential.DEFAULT_LIFETIME;
     private Oid actualMech; // Assigned during context establishment
 
+    private GSSCredElement cred;
+    private GSSCredElement disposeCred;
+
     private ChannelBinding cb;
-    private GSSCredElement delegatedCred;
     private GSSCredElement disposeDelegatedCred;
-    private int flags;
-    private int lifetime = GSSCredential.DEFAULT_LIFETIME;
     private final GSSLibStub cStub;
 
     private boolean skipDelegPermCheck;
@@ -231,6 +233,7 @@
     }
 
     // Constructor for imported context
+    // Warning: called by NativeUtil.c
     NativeGSSContext(long pCtxt, GSSLibStub stub) throws GSSException {
         assert(pContext != 0);
         pContext = pCtxt;
--- a/src/java.security.jgss/share/classes/sun/security/krb5/Credentials.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/Credentials.java	Wed Sep 25 22:40:41 2019 +0200
@@ -88,6 +88,7 @@
         this.authzData = authzData;
     }
 
+    // Warning: called by NativeCreds.c and nativeccache.c
     public Credentials(Ticket new_ticket,
                        PrincipalName new_client,
                        PrincipalName new_client_alias,
--- a/src/java.security.jgss/share/classes/sun/security/krb5/EncryptionKey.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/EncryptionKey.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -218,8 +218,8 @@
      * credential cache file.
      *
      */
-     // Used in JSSE (KerberosWrapper), Credentials,
-     // javax.security.auth.kerberos.KeyImpl
+    // Used in Credentials, and javax.security.auth.kerberos.KeyImpl
+    // Warning: called by NativeCreds.c and nativeccache.c
     public EncryptionKey(int keyType,
                          byte[] keyValue) {
         this(keyValue, keyType, null);
--- a/src/java.security.jgss/share/classes/sun/security/krb5/PrincipalName.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/PrincipalName.java	Wed Sep 25 22:40:41 2019 +0200
@@ -158,7 +158,7 @@
         this.realmDeduced = false;
     }
 
-    // This method is called by Windows NativeCred.c
+    // Warning: called by NativeCreds.c
     public PrincipalName(String[] nameParts, String realm) throws RealmException {
         this(KRB_NT_UNKNOWN, nameParts, new Realm(realm));
     }
@@ -484,6 +484,7 @@
         }
     }
 
+    // Warning: called by nativeccache.c
     public PrincipalName(String name, int type) throws RealmException {
         this(name, type, (String)null);
     }
--- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/HostAddress.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/HostAddress.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, 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
@@ -165,6 +165,8 @@
     /**
      * Creates a HostAddress from the specified address and address type.
      *
+     * Warning: called by nativeccache.c.
+     *
      * @param new_addrType the value of the address type which matches the defined
      *                       address family constants in the Berkeley Standard
      *                       Distributions of Unix.
--- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/HostAddresses.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/HostAddresses.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, 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
@@ -68,6 +68,7 @@
     private HostAddress[] addresses = null;
     private volatile int hashCode = 0;
 
+    // Warning: called by nativeccache.c
     public HostAddresses(HostAddress[] new_addresses) throws IOException {
         if (new_addresses != null) {
            addresses = new HostAddress[new_addresses.length];
--- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/KerberosTime.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/KerberosTime.java	Wed Sep 25 22:40:41 2019 +0200
@@ -88,8 +88,7 @@
         this(time, 0);
     }
 
-    // This constructor is used in the native code
-    // src/windows/native/sun/security/krb5/NativeCreds.c
+    // Warning: called by NativeCreds.c and nativeccache.c
     public KerberosTime(String time) throws Asn1Exception {
         this(toKerberosTime(time), 0);
     }
--- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/Krb5.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/Krb5.java	Wed Sep 25 22:40:41 2019 +0200
@@ -309,7 +309,7 @@
         return errMsgList.get(i);
     }
 
-
+    // Warning: used by NativeCreds.c
     public static final boolean DEBUG = GetBooleanAction
             .privilegedGetProperty("sun.security.krb5.debug");
 
--- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/Ticket.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/Ticket.java	Wed Sep 25 22:40:41 2019 +0200
@@ -83,6 +83,7 @@
         encPart = new_encPart;
     }
 
+    // Warning: called by NativeCreds.c and nativeccache.c
     public Ticket(byte[] data) throws Asn1Exception,
     RealmException, KrbApErrException, IOException {
         init(new DerValue(data));
--- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/TicketFlags.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/TicketFlags.java	Wed Sep 25 22:40:41 2019 +0200
@@ -67,6 +67,7 @@
         }
     }
 
+    // Warning: called by NativeCreds.c and nativeccache.c
     public TicketFlags(int size, byte[] data) throws Asn1Exception {
         super(size, data);
         if ((size > data.length * BITS_PER_UNIT) || (size > Krb5.TKT_OPTS_MAX + 1))
--- a/src/java.security.jgss/windows/native/libw2k_lsa_auth/NativeCreds.c	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.security.jgss/windows/native/libw2k_lsa_auth/NativeCreds.c	Wed Sep 25 22:40:41 2019 +0200
@@ -54,7 +54,6 @@
  * Library-wide static references
  */
 
-jclass derValueClass = NULL;
 jclass ticketClass = NULL;
 jclass principalNameClass = NULL;
 jclass encryptionKeyClass = NULL;
@@ -62,7 +61,6 @@
 jclass kerberosTimeClass = NULL;
 jclass javaLangStringClass = NULL;
 
-jmethodID derValueConstructor = 0;
 jmethodID ticketConstructor = 0;
 jmethodID principalNameConstructor = 0;
 jmethodID encryptionKeyConstructor = 0;
@@ -172,24 +170,6 @@
         printf("LSA: Made NewWeakGlobalRef\n");
     }
 
-    cls = (*env)->FindClass(env,"sun/security/util/DerValue");
-
-    if (cls == NULL) {
-        printf("LSA: Couldn't find DerValue\n");
-        return JNI_ERR;
-    }
-    if (native_debug) {
-        printf("LSA: Found DerValue\n");
-    }
-
-    derValueClass = (*env)->NewWeakGlobalRef(env,cls);
-    if (derValueClass == NULL) {
-        return JNI_ERR;
-    }
-    if (native_debug) {
-        printf("LSA: Made NewWeakGlobalRef\n");
-    }
-
     cls = (*env)->FindClass(env,"sun/security/krb5/EncryptionKey");
 
     if (cls == NULL) {
@@ -262,18 +242,8 @@
         printf("LSA: Made NewWeakGlobalRef\n");
     }
 
-    derValueConstructor = (*env)->GetMethodID(env, derValueClass,
-                                            "<init>", "([B)V");
-    if (derValueConstructor == 0) {
-        printf("LSA: Couldn't find DerValue constructor\n");
-        return JNI_ERR;
-    }
-    if (native_debug) {
-        printf("LSA: Found DerValue constructor\n");
-    }
-
     ticketConstructor = (*env)->GetMethodID(env, ticketClass,
-                            "<init>", "(Lsun/security/util/DerValue;)V");
+                            "<init>", "([B)V");
     if (ticketConstructor == 0) {
         printf("LSA: Couldn't find Ticket constructor\n");
         return JNI_ERR;
@@ -347,9 +317,6 @@
     if (ticketClass != NULL) {
         (*env)->DeleteWeakGlobalRef(env,ticketClass);
     }
-    if (derValueClass != NULL) {
-        (*env)->DeleteWeakGlobalRef(env,derValueClass);
-    }
     if (principalNameClass != NULL) {
         (*env)->DeleteWeakGlobalRef(env,principalNameClass);
     }
@@ -897,11 +864,9 @@
 
 jobject BuildTicket(JNIEnv *env, PUCHAR encodedTicket, ULONG encodedTicketSize) {
 
-    /* To build a Ticket, we first need to build a DerValue out of the EncodedTicket.
-     * But before we can do that, we need to make a byte array out of the ET.
-     */
+    // To build a Ticket, we need to make a byte array out of the EncodedTicket.
 
-    jobject derValue, ticket;
+    jobject ticket;
     jbyteArray ary;
 
     ary = (*env)->NewByteArray(env,encodedTicketSize);
@@ -916,19 +881,12 @@
         return (jobject) NULL;
     }
 
-    derValue = (*env)->NewObject(env, derValueClass, derValueConstructor, ary);
+    ticket = (*env)->NewObject(env, ticketClass, ticketConstructor, ary);
     if ((*env)->ExceptionOccurred(env)) {
         (*env)->DeleteLocalRef(env, ary);
         return (jobject) NULL;
     }
-
     (*env)->DeleteLocalRef(env, ary);
-    ticket = (*env)->NewObject(env, ticketClass, ticketConstructor, derValue);
-    if ((*env)->ExceptionOccurred(env)) {
-        (*env)->DeleteLocalRef(env, derValue);
-        return (jobject) NULL;
-    }
-    (*env)->DeleteLocalRef(env, derValue);
     return ticket;
 }
 
--- a/src/java.sql.rowset/share/classes/javax/sql/rowset/BaseRowSet.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/BaseRowSet.java	Wed Sep 25 22:40:41 2019 +0200
@@ -330,6 +330,7 @@
      * specified in the <code>ResultSet</code> interface.
      * @serial
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     protected java.io.InputStream binaryStream;
 
     /**
@@ -338,6 +339,7 @@
      * which is specified in the <code>ResultSet</code> interface.
      * @serial
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     protected java.io.InputStream unicodeStream;
 
     /**
@@ -346,6 +348,7 @@
      * which is specified in the <code>ResultSet</code> interface.
      * @serial
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     protected java.io.InputStream asciiStream;
 
     /**
@@ -354,6 +357,7 @@
      * which is specified in the <code>ResultSet</code> interface.
      * @serial
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     protected java.io.Reader charStream;
 
     /**
@@ -506,6 +510,7 @@
      * custom mapping of user-defined types.
      * @serial
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private Map<String, Class<?>> map;
 
     /**
--- a/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SerialArray.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SerialArray.java	Wed Sep 25 22:40:41 2019 +0200
@@ -66,6 +66,7 @@
      * in the SQL <code>ARRAY</code> value.
      * @serial
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private Object[] elements;
 
     /**
--- a/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SerialBlob.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SerialBlob.java	Wed Sep 25 22:40:41 2019 +0200
@@ -73,6 +73,7 @@
      * The internal representation of the <code>Blob</code> object on which this
      * <code>SerialBlob</code> object is based.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable; checked in writeObject
     private Blob blob;
 
     /**
--- a/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SerialClob.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SerialClob.java	Wed Sep 25 22:40:41 2019 +0200
@@ -68,6 +68,7 @@
      * Internal Clob representation if SerialClob is initialized with a
      * Clob. Null if SerialClob is initialized with a char[].
      */
+    @SuppressWarnings("serial")  // Not statically typed as Serializable; checked in writeObject
     private Clob clob;
 
     /**
--- a/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SerialJavaObject.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SerialJavaObject.java	Wed Sep 25 22:40:41 2019 +0200
@@ -61,6 +61,7 @@
     /**
      * Placeholder for object to be serialized.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private Object obj;
 
 
--- a/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SerialRef.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SerialRef.java	Wed Sep 25 22:40:41 2019 +0200
@@ -56,11 +56,13 @@
     /**
      * This will store the type <code>Ref</code> as an <code>Object</code>.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private Object object;
 
     /**
      * Private copy of the Ref reference.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable; checked in writeObject
     private Ref reference;
 
     /**
--- a/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SerialStruct.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SerialStruct.java	Wed Sep 25 22:40:41 2019 +0200
@@ -80,6 +80,7 @@
      *
      * @serial
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private Object attribs[];
 
     /**
--- a/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/SyncProviderException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/SyncProviderException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, 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
@@ -70,6 +70,7 @@
      * this <code>SyncProviderException</code> object will return when its
      * <code>getSyncResolver</code> method is called.
      */
+     @SuppressWarnings("serial") // Not statically typed as Serializable
      private SyncResolver syncResolver = null;
 
     /**
--- a/src/java.sql/share/classes/java/sql/SQLClientInfoException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.sql/share/classes/java/sql/SQLClientInfoException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
 
 
 
-
+        @SuppressWarnings("serial") // Not statically typed as Serializable
         private Map<String, ClientInfoStatus>   failedProperties;
 
         /**
--- a/src/java.sql/share/classes/javax/sql/StatementEvent.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/java.sql/share/classes/javax/sql/StatementEvent.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, 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
@@ -44,6 +44,7 @@
 
         static final long serialVersionUID = -8089573731826608315L;
         private SQLException            exception;
+        @SuppressWarnings("serial") // Not statically typed as Serializable
         private PreparedStatement       statement;
 
         /**
--- a/src/jdk.accessibility/windows/native/libwindowsaccessbridge/WinAccessBridge.cpp	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.accessibility/windows/native/libwindowsaccessbridge/WinAccessBridge.cpp	Wed Sep 25 22:40:41 2019 +0200
@@ -296,7 +296,7 @@
 
     PrintDebugString("[INFO]:   finished deleting eventHandler, messageQueue, and javaVMs");
     PrintDebugString("[INFO]: GOODBYE CRUEL WORLD...");
-
+    finalizeFileLogger();
     DestroyWindow(theDialogWindow);
 }
 
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/BinaryContainer.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/BinaryContainer.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/NativeOrderOutputStreamTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/NativeOrderOutputStreamTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -32,43 +32,40 @@
 
 package jdk.tools.jaotc.test;
 
-import jdk.tools.jaotc.utils.NativeOrderOutputStream;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
 import org.junit.Assert;
-import org.junit.Before;
 import org.junit.Test;
 
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
+import jdk.tools.jaotc.utils.NativeOrderOutputStream;
 
 public class NativeOrderOutputStreamTest {
 
-    private NativeOrderOutputStream target;
-
-    @Before
-    public void setup() {
-        target = new NativeOrderOutputStream();
-    }
-
     @Test
     public void shouldAdd4BytesForInt() {
+        NativeOrderOutputStream target = new NativeOrderOutputStream();
         target.putInt(5);
         Assert.assertEquals(4, target.position());
     }
 
     @Test
     public void shouldAdd8BytesForLong() {
+        NativeOrderOutputStream target = new NativeOrderOutputStream();
         target.putLong(8);
         Assert.assertEquals(8, target.position());
     }
 
     @Test
     public void shouldHaveCorrectSizeBeforePatch() {
+        NativeOrderOutputStream target = new NativeOrderOutputStream();
         target.patchableInt();
         Assert.assertEquals(4, target.position());
     }
 
     @Test
     public void shouldHaveCorrectSizeAfterPatch() {
+        NativeOrderOutputStream target = new NativeOrderOutputStream();
         NativeOrderOutputStream.PatchableInt patchableInt = target.patchableInt();
         patchableInt.set(12);
         Assert.assertEquals(4, target.position());
@@ -76,12 +73,13 @@
 
     @Test
     public void shouldSetCorrectValueInPatch() {
+        NativeOrderOutputStream target = new NativeOrderOutputStream();
         NativeOrderOutputStream.PatchableInt patchableInt = target.patchableInt();
         patchableInt.set(42);
-        Assert.assertEquals(42, getInt(0));
+        Assert.assertEquals(42, getInt(target, 0));
     }
 
-    private int getInt(int pos) {
+    private static int getInt(NativeOrderOutputStream target, int pos) {
         ByteBuffer buffer = ByteBuffer.wrap(target.array());
         buffer.order(ByteOrder.nativeOrder());
         return buffer.getInt(pos);
@@ -89,6 +87,7 @@
 
     @Test
     public void shouldPutArrayCorrectly() {
+        NativeOrderOutputStream target = new NativeOrderOutputStream();
         target.put(new byte[]{42, 5, 43, 44});
         Assert.assertEquals(4, target.position());
         Assert.assertEquals(42, target.array()[0]);
@@ -97,25 +96,28 @@
 
     @Test
     public void shouldOnlyPatchSlot() {
+        NativeOrderOutputStream target = new NativeOrderOutputStream();
         NativeOrderOutputStream.PatchableInt patchableInt = target.patchableInt();
         target.putInt(7);
         patchableInt.set(39);
-        Assert.assertEquals(39, getInt(0));
-        Assert.assertEquals(7, getInt(4));
+        Assert.assertEquals(39, getInt(target, 0));
+        Assert.assertEquals(7, getInt(target, 4));
     }
 
     @Test
     public void shouldBeAbleToPatchAnywhere() {
+        NativeOrderOutputStream target = new NativeOrderOutputStream();
         target.putInt(19);
         NativeOrderOutputStream.PatchableInt patchableInt = target.patchableInt();
         patchableInt.set(242);
 
-        Assert.assertEquals(19, getInt(0));
-        Assert.assertEquals(242, getInt(4));
+        Assert.assertEquals(19, getInt(target, 0));
+        Assert.assertEquals(242, getInt(target, 4));
     }
 
     @Test
     public void shouldHavePatchableAtRightOffset() {
+        NativeOrderOutputStream target = new NativeOrderOutputStream();
         target.putInt(27);
         Assert.assertEquals(4, target.position());
         NativeOrderOutputStream.PatchableInt patchableInt = target.patchableInt();
@@ -124,6 +126,7 @@
 
     @Test
     public void shouldAlign() {
+        NativeOrderOutputStream target = new NativeOrderOutputStream();
         target.putInt(9);
         target.align(16);
         target.put(new byte[]{3});
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Collector.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Collector.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -40,6 +40,7 @@
 import jdk.tools.jaotc.collect.directory.DirectorySourceProvider;
 import jdk.tools.jaotc.collect.jar.JarSourceProvider;
 import jdk.tools.jaotc.collect.module.ModuleSourceProvider;
+import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
 import jdk.vm.ci.meta.MetaAccessProvider;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 import jdk.vm.ci.meta.ResolvedJavaType;
@@ -92,6 +93,7 @@
         if (!main.filters.shouldCompileMethod(method)) {
             return;
         }
+        assert ((HotSpotResolvedObjectType) method.getDeclaringClass()).getFingerprint() != 0 : "no fingerprint for " + method.getDeclaringClass().getName();
 
         aotClass.addMethod(method);
         main.printer.printlnVerbose("  added " + method.getName() + method.getSignature().toMethodDescriptor());
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/MarkId.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/MarkId.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/MetadataBuilder.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/MetadataBuilder.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_convert.c	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_convert.c	Wed Sep 25 22:40:41 2019 +0200
@@ -1179,7 +1179,7 @@
         throwOutOfMemoryError(env, 0);
         return NULL;
     }
-    TRACE1("DEBUG jMechanismToCKMechanismPtr: allocated mech 0x%lX\n", ckpMech);
+    TRACE1("DEBUG jMechanismToCKMechanismPtr: allocated mech %p \n", ckpMech);
 
     ckpMech->mechanism = jLongToCKULong(jMechType);
 
--- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_general.c	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_general.c	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  */
 
 /* Copyright  (c) 2002 Graz University of Technology. All rights reserved.
@@ -98,7 +98,7 @@
 (JNIEnv *env, jclass thisClass, jlong ckpMechanism) {
     if (ckpMechanism != 0L) {
         freeCKMechanismPtr(jlong_to_ptr(ckpMechanism));
-        TRACE1("DEBUG PKCS11_freeMechanism: free pMech = %x\n", ckpMechanism);
+        TRACE1("DEBUG PKCS11_freeMechanism: free pMech = %lld\n", (long long int) ckpMechanism);
     }
     return 0L;
 }
@@ -232,7 +232,10 @@
 
     free(ckpInitArgs);
 
-    if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { return; }
+    if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) {
+      TRACE1("DEBUG: C_Initialize had a bad return value %lu \n", (unsigned long) rv);
+      return;
+    }
 
     TRACE0("FINISHED\n");
 }
--- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_objmgmt.c	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_objmgmt.c	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  */
 
 /* Copyright  (c) 2002 Graz University of Technology. All rights reserved.
@@ -223,18 +223,18 @@
     if (ckpFunctions == NULL) { return; }
 
     TRACE0("DEBUG: C_GetAttributeValue");
-    TRACE1(", hSession=%u", jSessionHandle);
-    TRACE1(", hObject=%u", jObjectHandle);
+    TRACE1(", hSession=%lld", (long long) jSessionHandle);
+    TRACE1(", hObject=%lld", (long long) jObjectHandle);
     TRACE1(", pTemplate=%p", jTemplate);
     TRACE0(" ... ");
 
     ckSessionHandle = jLongToCKULong(jSessionHandle);
     ckObjectHandle = jLongToCKULong(jObjectHandle);
-    TRACE1("jAttributeArrayToCKAttributeArray now with jTemplate = %d", jTemplate);
+    TRACE1("jAttributeArrayToCKAttributeArray now with jTemplate = %p", jTemplate);
     jAttributeArrayToCKAttributeArray(env, jTemplate, &ckpAttributes, &ckAttributesLength);
     if ((*env)->ExceptionCheck(env)) { return; }
 
-    TRACE2("DEBUG: jAttributeArrayToCKAttributeArray finished with ckpAttribute = %d, Length = %d\n", ckpAttributes, ckAttributesLength);
+    TRACE2("DEBUG: jAttributeArrayToCKAttributeArray finished with ckpAttribute = %p, Length = %lu\n", ckpAttributes, (unsigned long) ckAttributesLength);
 
     /* first set all pValue to NULL, to get the needed buffer length */
     for(i = 0; i < ckAttributesLength; i++) {
@@ -345,7 +345,7 @@
     if (ckpFunctions == NULL) { return; }
 
     TRACE0("DEBUG: C_FindObjectsInit");
-    TRACE1(", hSession=%u", jSessionHandle);
+    TRACE1(", hSession=%lld", (long long int) jSessionHandle);
     TRACE1(", pTemplate=%p", jTemplate);
     TRACE0(" ... ");
 
--- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_sessmgmt.c	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_sessmgmt.c	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
  */
 
 /* Copyright  (c) 2002 Graz University of Technology. All rights reserved.
@@ -117,8 +117,8 @@
 #endif /* NO_CALLBACKS */
 
     TRACE0("DEBUG: C_OpenSession");
-    TRACE1(", slotID=%u", ckSlotID);
-    TRACE1(", flags=%x", ckFlags);
+    TRACE1(", slotID=%lu", ckSlotID);
+    TRACE1(", flags=%lu", (unsigned long) ckFlags);
     TRACE0(" ... ");
 
     rv = (*ckpFunctions->C_OpenSession)(ckSlotID, ckFlags, ckpApplication, ckNotify, &ckSessionHandle);
@@ -136,7 +136,7 @@
     }
 
     TRACE0("got session");
-    TRACE1(", SessionHandle=%u", ckSessionHandle);
+    TRACE1(", SessionHandle=%lu", (unsigned long) ckSessionHandle);
     TRACE0(" ... ");
 
     jSessionHandle = ckULongToJLong(ckSessionHandle);
--- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_util.c	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_util.c	Wed Sep 25 22:40:41 2019 +0200
@@ -719,16 +719,15 @@
         throwOutOfMemoryError(env, 0);
         return;
     }
-    TRACE1(", converting %d attributes", jLength);
+    TRACE1(", converting %lld attributes", (long long int) jLength);
     for (i=0; i<(*ckpLength); i++) {
-        TRACE1(", getting %d. attribute", i);
+        TRACE1(", getting %lu. attribute", i);
         jAttribute = (*env)->GetObjectArrayElement(env, jArray, i);
         if ((*env)->ExceptionCheck(env)) {
             freeCKAttributeArray(*ckpArray, i);
             return;
         }
-        TRACE1(", jAttribute = %d", jAttribute);
-        TRACE1(", converting %d. attribute", i);
+        TRACE1(", jAttribute , converting %lu. attribute", i);
         (*ckpArray)[i] = jAttributeToCKAttribute(env, jAttribute);
         if ((*env)->ExceptionCheck(env)) {
             freeCKAttributeArray(*ckpArray, i);
@@ -1116,7 +1115,7 @@
     if ((*env)->IsInstanceOf(env, jObject, jLongClass)) {
         ckpObject = jLongObjectToCKULongPtr(env, jObject);
         *ckpLength = sizeof(CK_ULONG);
-        TRACE1("<converted long value %X>", *((CK_ULONG *) ckpObject));
+        TRACE1("<converted long value %lu>", *((CK_ULONG *) ckpObject));
         return ckpObject;
     }
 
@@ -1126,7 +1125,7 @@
         ckpObject = jBooleanObjectToCKBBoolPtr(env, jObject);
         *ckpLength = sizeof(CK_BBOOL);
         TRACE0(" <converted boolean value ");
-        TRACE0((*((CK_BBOOL *) ckpObjectPtr) == TRUE) ? "TRUE>" : "FALSE>");
+        TRACE0((*((CK_BBOOL *) ckpObject) == TRUE) ? "TRUE>" : "FALSE>");
         return ckpObject;
     }
 
@@ -1177,7 +1176,7 @@
     if ((*env)->IsInstanceOf(env, jObject, jIntegerClass)) {
         ckpObject = jIntegerObjectToCKULongPtr(env, jObject);
         *ckpLength = sizeof(CK_ULONG);
-        TRACE1("<converted integer value %X>", *((CK_ULONG *) ckpObject));
+        TRACE1("<converted integer value %lu>", *((CK_ULONG *) ckpObject));
         return ckpObject;
     }
 
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java	Wed Sep 25 22:40:41 2019 +0200
@@ -557,10 +557,10 @@
     native int getCountersSize();
 
     /**
-     * Attempt to change the size of the counters allocated for JVMCI. This requires a safepoint to
+     * Change the size of the counters allocated for JVMCI. This requires a safepoint to
      * safely reallocate the storage but it's advisable to increase the size in reasonable chunks.
      */
-    native boolean setCountersSize(int newSize);
+    native void setCountersSize(int newSize);
 
     /**
      * Determines if {@code metaspaceMethodData} is mature.
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java	Wed Sep 25 22:40:41 2019 +0200
@@ -812,14 +812,13 @@
     }
 
     /**
-     * Attempt to enlarge the number of per thread counters available. Requires a safepoint so
+     * Enlarge the number of per thread counters available. Requires a safepoint so
      * resizing should be rare to avoid performance effects.
      *
      * @param newSize
-     * @return false if the resizing failed
      */
-    public boolean setCountersSize(int newSize) {
-        return compilerToVm.setCountersSize(newSize);
+    public void setCountersSize(int newSize) {
+        compilerToVm.setCountersSize(newSize);
     }
 
     /**
--- a/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/HotSpotGraalManagement.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/HotSpotGraalManagement.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/HotSpotGraalRuntimeMBean.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/HotSpotGraalRuntimeMBean.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/package-info.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/package-info.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.libgraal/src/jdk/internal/vm/compiler/libgraal/LibGraal.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.libgraal/src/jdk/internal/vm/compiler/libgraal/LibGraal.java	Wed Sep 25 22:40:41 2019 +0200
@@ -25,6 +25,7 @@
 package jdk.internal.vm.compiler.libgraal;
 
 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
+import jdk.vm.ci.hotspot.HotSpotSpeculationLog;
 import jdk.vm.ci.services.Services;
 
 /**
@@ -36,6 +37,10 @@
         return inLibGraal() || isolate != 0L;
     }
 
+    public static boolean isSupported() {
+        return true;
+    }
+
     public static boolean inLibGraal() {
         return Services.IS_IN_NATIVE_IMAGE;
     }
@@ -91,13 +96,17 @@
         return runtime.isCurrentThreadAttached();
     }
 
-    static boolean attachCurrentThread(HotSpotJVMCIRuntime runtime) {
-        return runtime.attachCurrentThread(false);
+    public static boolean attachCurrentThread(HotSpotJVMCIRuntime runtime, boolean isDaemon) {
+        return runtime.attachCurrentThread(isDaemon);
     }
 
-    static void detachCurrentThread(HotSpotJVMCIRuntime runtime) {
+    public static void detachCurrentThread(HotSpotJVMCIRuntime runtime) {
         runtime.detachCurrentThread();
     }
 
     static native long getCurrentIsolateThread(long iso);
+
+    public static long getFailedSpeculationsAddress(HotSpotSpeculationLog log) {
+        return log.getFailedSpeculationsAddress();
+    }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.libgraal/src/jdk/internal/vm/compiler/libgraal/LibGraalScope.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.libgraal/src/jdk/internal/vm/compiler/libgraal/LibGraalScope.java	Wed Sep 25 22:40:41 2019 +0200
@@ -77,7 +77,7 @@
         parent = currentScope.get();
         boolean top = false;
         if (parent == null) {
-            top = LibGraal.attachCurrentThread(runtime);
+            top = LibGraal.attachCurrentThread(runtime, false);
             isolateThread = LibGraal.getCurrentIsolateThread(LibGraal.isolate);
         } else {
             isolateThread = parent.isolateThread;
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/BlackholeDirectiveTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/BlackholeDirectiveTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ControlFlowAnchorDirectiveTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ControlFlowAnchorDirectiveTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/IterationDirectiveTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/IterationDirectiveTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/OpaqueDirectiveTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/OpaqueDirectiveTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Assembler.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Assembler.java	Wed Sep 25 22:40:41 2019 +0200
@@ -54,6 +54,7 @@
 import static org.graalvm.compiler.asm.aarch64.AArch64Assembler.Instruction.CSEL;
 import static org.graalvm.compiler.asm.aarch64.AArch64Assembler.Instruction.CSINC;
 import static org.graalvm.compiler.asm.aarch64.AArch64Assembler.Instruction.CSNEG;
+import static org.graalvm.compiler.asm.aarch64.AArch64Assembler.Instruction.DC;
 import static org.graalvm.compiler.asm.aarch64.AArch64Assembler.Instruction.DMB;
 import static org.graalvm.compiler.asm.aarch64.AArch64Assembler.Instruction.EON;
 import static org.graalvm.compiler.asm.aarch64.AArch64Assembler.Instruction.EOR;
@@ -673,6 +674,7 @@
 
         MRS(0xD5300000),
         MSR(0xD5100000),
+        DC(0xD5087000),
 
         BLR_NATIVE(0xc0000000),
 
@@ -709,6 +711,24 @@
         private final int op2;
     }
 
+    public enum DataCacheOperationType {
+        ZVA(0b011, 0b0100, 0b001);
+
+        DataCacheOperationType(int op1, int crm, int op2) {
+            this.op1 = op1;
+            this.crm = crm;
+            this.op2 = op2;
+        }
+
+        public int encoding() {
+            return op1 << 16 | crm << 8 | op2 << 5;
+        }
+
+        private final int op1;
+        private final int crm;
+        private final int op2;
+    }
+
     public enum ShiftType {
         LSL(0),
         LSR(1),
@@ -1015,7 +1035,7 @@
     }
 
     private static int getConditionalBranchImm(int imm21) {
-        assert NumUtil.isSignedNbit(21, imm21) && (imm21 & 0x3) == 0 : "Immediate has to be 21bit signed number and word aligned";
+        assert NumUtil.isSignedNbit(21, imm21) && (imm21 & 0x3) == 0 : String.format("Immediate has to be 21bit signed number and word aligned got value 0x%x", imm21);
         int imm = (imm21 & NumUtil.getNbitNumberInt(21)) >> 2;
         return imm << ConditionalBranchImmOffset;
     }
@@ -1231,7 +1251,7 @@
      * @param address all addressing modes allowed. May not be null.
      */
     public void str(int destSize, Register rt, AArch64Address address) {
-        assert rt.getRegisterCategory().equals(CPU);
+        assert rt.getRegisterCategory().equals(CPU) : rt;
         assert destSize == 8 || destSize == 16 || destSize == 32 || destSize == 64;
         int transferSize = NumUtil.log2Ceil(destSize / 8);
         loadStoreInstruction(STR, rt, address, General64, transferSize);
@@ -2961,6 +2981,10 @@
         emitInt(MRS.encoding | systemRegister.encoding() | rt(src));
     }
 
+    public void dc(DataCacheOperationType type, Register src) {
+        emitInt(DC.encoding | type.encoding() | rt(src));
+    }
+
     public void annotatePatchingImmediate(int pos, Instruction instruction, int operandSizeBits, int offsetBits, int shift) {
         if (codePatchingAnnotationConsumer != null) {
             codePatchingAnnotationConsumer.accept(new SingleInstructionAnnotation(pos, instruction, operandSizeBits, offsetBits, shift));
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64MacroAssembler.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64MacroAssembler.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1706,6 +1706,9 @@
                 Register reg = AArch64.cpuRegisters.get(regEncoding);
                 // 1 => 64; 0 => 32
                 int size = sizeEncoding * 32 + 32;
+                if (!NumUtil.isSignedNbit(21, branchOffset)) {
+                    throw new BranchTargetOutOfBoundsException(true, "Branch target %d out of bounds", branchOffset);
+                }
                 switch (type) {
                     case BRANCH_NONZERO:
                         super.cbnz(size, reg, branchOffset, branch);
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64AsmOptions.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64AsmOptions.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Assembler.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Assembler.java	Wed Sep 25 22:40:41 2019 +0200
@@ -27,6 +27,11 @@
 import static jdk.vm.ci.amd64.AMD64.CPU;
 import static jdk.vm.ci.amd64.AMD64.MASK;
 import static jdk.vm.ci.amd64.AMD64.XMM;
+import static jdk.vm.ci.amd64.AMD64.CPUFeature.AVX512BW;
+import static jdk.vm.ci.amd64.AMD64.CPUFeature.AVX512CD;
+import static jdk.vm.ci.amd64.AMD64.CPUFeature.AVX512DQ;
+import static jdk.vm.ci.amd64.AMD64.CPUFeature.AVX512F;
+import static jdk.vm.ci.amd64.AMD64.CPUFeature.AVX512VL;
 import static jdk.vm.ci.code.MemoryBarriers.STORE_LOAD;
 import static org.graalvm.compiler.asm.amd64.AMD64AsmOptions.UseAddressNop;
 import static org.graalvm.compiler.asm.amd64.AMD64AsmOptions.UseIntelNops;
@@ -55,6 +60,7 @@
 import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.OperandSize.WORD;
 import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.VEXPrefixConfig.L128;
 import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.VEXPrefixConfig.L256;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.VEXPrefixConfig.L512;
 import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.VEXPrefixConfig.LZ;
 import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.VEXPrefixConfig.M_0F;
 import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.VEXPrefixConfig.M_0F38;
@@ -895,36 +901,90 @@
         }
     }
 
+    private enum EVEXFeatureAssertion {
+        AVX512F_ALL(EnumSet.of(AVX512F), EnumSet.of(AVX512F), EnumSet.of(AVX512F)),
+        AVX512F_128ONLY(EnumSet.of(AVX512F), null, null),
+        AVX512F_VL(EnumSet.of(AVX512F, AVX512VL), EnumSet.of(AVX512F, AVX512VL), EnumSet.of(AVX512F)),
+        AVX512CD_VL(EnumSet.of(AVX512F, AVX512CD, AVX512VL), EnumSet.of(AVX512F, AVX512CD, AVX512VL), EnumSet.of(AVX512F, AVX512CD)),
+        AVX512DQ_VL(EnumSet.of(AVX512F, AVX512DQ, AVX512VL), EnumSet.of(AVX512F, AVX512DQ, AVX512VL), EnumSet.of(AVX512F, AVX512DQ)),
+        AVX512BW_VL(EnumSet.of(AVX512F, AVX512BW, AVX512VL), EnumSet.of(AVX512F, AVX512BW, AVX512VL), EnumSet.of(AVX512F, AVX512BW));
+
+        private final EnumSet<CPUFeature> l128features;
+        private final EnumSet<CPUFeature> l256features;
+        private final EnumSet<CPUFeature> l512features;
+
+        EVEXFeatureAssertion(EnumSet<CPUFeature> l128features, EnumSet<CPUFeature> l256features, EnumSet<CPUFeature> l512features) {
+            this.l128features = l128features;
+            this.l256features = l256features;
+            this.l512features = l512features;
+        }
+
+        public boolean check(AMD64 arch, int l) {
+            switch (l) {
+                case L128:
+                    assert l128features != null && arch.getFeatures().containsAll(l128features) : "emitting illegal 128 bit instruction";
+                    break;
+                case L256:
+                    assert l256features != null && arch.getFeatures().containsAll(l256features) : "emitting illegal 256 bit instruction";
+                    break;
+                case L512:
+                    assert l512features != null && arch.getFeatures().containsAll(l512features) : "emitting illegal 512 bit instruction";
+                    break;
+            }
+            return true;
+        }
+
+        public boolean supports(EnumSet<CPUFeature> features, AVXSize avxSize) {
+            switch (avxSize) {
+                case XMM:
+                    return l128features != null && features.containsAll(l128features);
+                case YMM:
+                    return l256features != null && features.containsAll(l256features);
+                case ZMM:
+                    return l512features != null && features.containsAll(l512features);
+                default:
+                    throw GraalError.shouldNotReachHere();
+            }
+        }
+    }
+
     private enum VEXOpAssertion {
-        AVX1(CPUFeature.AVX, CPUFeature.AVX),
-        AVX1_2(CPUFeature.AVX, CPUFeature.AVX2),
-        AVX2(CPUFeature.AVX2, CPUFeature.AVX2),
-        AVX1_128ONLY(CPUFeature.AVX, null),
-        AVX1_256ONLY(null, CPUFeature.AVX),
-        AVX2_256ONLY(null, CPUFeature.AVX2),
-        XMM_CPU(CPUFeature.AVX, null, XMM, null, CPU, null),
-        XMM_XMM_CPU(CPUFeature.AVX, null, XMM, XMM, CPU, null),
-        CPU_XMM(CPUFeature.AVX, null, CPU, null, XMM, null),
-        AVX1_2_CPU_XMM(CPUFeature.AVX, CPUFeature.AVX2, CPU, null, XMM, null),
-        BMI1(CPUFeature.BMI1, null, CPU, CPU, CPU, null),
-        BMI2(CPUFeature.BMI2, null, CPU, CPU, CPU, null),
-        FMA(CPUFeature.FMA, null, XMM, XMM, XMM, null);
+        AVX1(CPUFeature.AVX, CPUFeature.AVX, null),
+        AVX1_2(CPUFeature.AVX, CPUFeature.AVX2, null),
+        AVX2(CPUFeature.AVX2, CPUFeature.AVX2, null),
+        AVX1_128ONLY(CPUFeature.AVX, null, null),
+        AVX1_256ONLY(null, CPUFeature.AVX, null),
+        AVX2_256ONLY(null, CPUFeature.AVX2, null),
+        XMM_CPU(CPUFeature.AVX, null, null, XMM, null, CPU, null),
+        XMM_XMM_CPU(CPUFeature.AVX, null, null, XMM, XMM, CPU, null),
+        CPU_XMM(CPUFeature.AVX, null, null, CPU, null, XMM, null),
+        AVX1_2_CPU_XMM(CPUFeature.AVX, CPUFeature.AVX2, null, CPU, null, XMM, null),
+        BMI1(CPUFeature.BMI1, null, null, CPU, CPU, CPU, null),
+        BMI2(CPUFeature.BMI2, null, null, CPU, CPU, CPU, null),
+        FMA(CPUFeature.FMA, null, null, XMM, XMM, XMM, null),
+
+        XMM_CPU_AVX512F_128ONLY(CPUFeature.AVX, null, EVEXFeatureAssertion.AVX512F_128ONLY, XMM, null, CPU, null),
+        AVX1_AVX512F_ALL(CPUFeature.AVX, CPUFeature.AVX, EVEXFeatureAssertion.AVX512F_ALL),
+        AVX1_AVX512F_VL(CPUFeature.AVX, CPUFeature.AVX, EVEXFeatureAssertion.AVX512F_VL);
 
         private final CPUFeature l128feature;
         private final CPUFeature l256feature;
+        private final EVEXFeatureAssertion l512features;
 
         private final RegisterCategory rCategory;
         private final RegisterCategory vCategory;
         private final RegisterCategory mCategory;
         private final RegisterCategory imm8Category;
 
-        VEXOpAssertion(CPUFeature l128feature, CPUFeature l256feature) {
-            this(l128feature, l256feature, XMM, XMM, XMM, XMM);
+        VEXOpAssertion(CPUFeature l128feature, CPUFeature l256feature, EVEXFeatureAssertion l512features) {
+            this(l128feature, l256feature, l512features, XMM, XMM, XMM, XMM);
         }
 
-        VEXOpAssertion(CPUFeature l128feature, CPUFeature l256feature, RegisterCategory rCategory, RegisterCategory vCategory, RegisterCategory mCategory, RegisterCategory imm8Category) {
+        VEXOpAssertion(CPUFeature l128feature, CPUFeature l256feature, EVEXFeatureAssertion l512features, RegisterCategory rCategory, RegisterCategory vCategory, RegisterCategory mCategory,
+                        RegisterCategory imm8Category) {
             this.l128feature = l128feature;
             this.l256feature = l256feature;
+            this.l512features = l512features;
             this.rCategory = rCategory;
             this.vCategory = vCategory;
             this.mCategory = mCategory;
@@ -940,13 +1000,12 @@
         }
 
         public boolean check(AMD64 arch, int l, Register r, Register v, Register m, Register imm8) {
-            switch (l) {
-                case L128:
-                    assert l128feature != null && arch.getFeatures().contains(l128feature) : "emitting illegal 128 bit instruction";
-                    break;
-                case L256:
-                    assert l256feature != null && arch.getFeatures().contains(l256feature) : "emitting illegal 256 bit instruction";
-                    break;
+            if (isAVX512Register(r) || isAVX512Register(v) || isAVX512Register(m) || l == L512) {
+                assert l512features != null && l512features.check(arch, l);
+            } else if (l == L128) {
+                assert l128feature != null && arch.getFeatures().contains(l128feature) : "emitting illegal 128 bit instruction";
+            } else if (l == L256) {
+                assert l256feature != null && arch.getFeatures().contains(l256feature) : "emitting illegal 256 bit instruction";
             }
             if (r != null) {
                 assert r.getRegisterCategory().equals(rCategory);
@@ -963,15 +1022,15 @@
             return true;
         }
 
-        public boolean supports(EnumSet<CPUFeature> features, AVXSize avxSize) {
-            switch (avxSize) {
-                case XMM:
-                    return l128feature != null && features.contains(l128feature);
-                case YMM:
-                    return l256feature != null && features.contains(l256feature);
-                default:
-                    throw GraalError.shouldNotReachHere();
+        public boolean supports(EnumSet<CPUFeature> features, AVXSize avxSize, boolean useZMMRegisters) {
+            if (useZMMRegisters || avxSize == AVXSize.ZMM) {
+                return l512features != null && l512features.supports(features, avxSize);
+            } else if (avxSize == AVXSize.XMM) {
+                return l128feature != null && features.contains(l128feature);
+            } else if (avxSize == AVXSize.YMM) {
+                return l256feature != null && features.contains(l256feature);
             }
+            throw GraalError.shouldNotReachHere();
         }
     }
 
@@ -987,23 +1046,41 @@
         private final String opcode;
         protected final VEXOpAssertion assertion;
 
-        protected VexOp(String opcode, int pp, int mmmmm, int w, int op, VEXOpAssertion assertion) {
+        protected final EVEXTuple evexTuple;
+        protected final int wEvex;
+
+        protected VexOp(String opcode, int pp, int mmmmm, int w, int op, VEXOpAssertion assertion, EVEXTuple evexTuple, int wEvex) {
             this.pp = pp;
             this.mmmmm = mmmmm;
             this.w = w;
             this.op = op;
             this.opcode = opcode;
             this.assertion = assertion;
+            this.evexTuple = evexTuple;
+            this.wEvex = wEvex;
+        }
+
+        protected VexOp(String opcode, int pp, int mmmmm, int w, int op, VEXOpAssertion assertion) {
+            this(opcode, pp, mmmmm, w, op, assertion, EVEXTuple.INVALID, WIG);
         }
 
         public final boolean isSupported(AMD64Assembler vasm, AVXSize size) {
-            return assertion.supports(((AMD64) vasm.target.arch).getFeatures(), size);
+            return isSupported(vasm, size, false);
+        }
+
+        public final boolean isSupported(AMD64Assembler vasm, AVXSize size, boolean useZMMRegisters) {
+            return assertion.supports(((AMD64) vasm.target.arch).getFeatures(), size, useZMMRegisters);
         }
 
         @Override
         public String toString() {
             return opcode;
         }
+
+        protected final int getDisp8Scale(boolean useEvex, AVXSize size) {
+            return useEvex ? evexTuple.getDisp8ScalingFactor(size) : DEFAULT_DISP8_SCALE;
+        }
+
     }
 
     /**
@@ -1011,21 +1088,17 @@
      */
     public static class VexRROp extends VexOp {
         // @formatter:off
-        public static final VexRROp VMASKMOVDQU = new VexRROp("VMASKMOVDQU", P_66, M_0F, WIG, 0xF7, VEXOpAssertion.AVX1_128ONLY);
+        public static final VexRROp VMASKMOVDQU = new VexRROp("VMASKMOVDQU", P_66, M_0F, WIG, 0xF7, VEXOpAssertion.AVX1_128ONLY, EVEXTuple.INVALID, WIG);
         // @formatter:on
 
-        protected VexRROp(String opcode, int pp, int mmmmm, int w, int op) {
-            this(opcode, pp, mmmmm, w, op, VEXOpAssertion.AVX1);
-        }
-
-        protected VexRROp(String opcode, int pp, int mmmmm, int w, int op, VEXOpAssertion assertion) {
-            super(opcode, pp, mmmmm, w, op, assertion);
+        protected VexRROp(String opcode, int pp, int mmmmm, int w, int op, VEXOpAssertion assertion, EVEXTuple evexTuple, int wEvex) {
+            super(opcode, pp, mmmmm, w, op, assertion, evexTuple, wEvex);
         }
 
         public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src) {
             assert assertion.check((AMD64) asm.target.arch, size, dst, null, src);
             assert op != 0x1A || op != 0x5A;
-            asm.vexPrefix(dst, Register.None, src, size, pp, mmmmm, w, false);
+            asm.vexPrefix(dst, Register.None, src, size, pp, mmmmm, w, wEvex, false);
             asm.emitByte(op);
             asm.emitModRM(dst, src);
         }
@@ -1077,18 +1150,22 @@
         // @formatter:on
 
         protected VexRMOp(String opcode, int pp, int mmmmm, int w, int op) {
-            this(opcode, pp, mmmmm, w, op, VEXOpAssertion.AVX1);
+            this(opcode, pp, mmmmm, w, op, VEXOpAssertion.AVX1, EVEXTuple.INVALID, WIG);
         }
 
         protected VexRMOp(String opcode, int pp, int mmmmm, int w, int op, VEXOpAssertion assertion) {
-            super(opcode, pp, mmmmm, w, op, assertion);
+            this(opcode, pp, mmmmm, w, op, assertion, EVEXTuple.INVALID, WIG);
+        }
+
+        protected VexRMOp(String opcode, int pp, int mmmmm, int w, int op, VEXOpAssertion assertion, EVEXTuple evexTuple, int wEvex) {
+            super(opcode, pp, mmmmm, w, op, assertion, evexTuple, wEvex);
         }
 
         public void emit(AMD64Assembler asm, AVXSize size, Register dst, AMD64Address src) {
             assert assertion.check((AMD64) asm.target.arch, size, dst, null, null);
-            asm.vexPrefix(dst, Register.None, src, size, pp, mmmmm, w, false);
+            boolean useEvex = asm.vexPrefix(dst, Register.None, src, size, pp, mmmmm, w, wEvex, false);
             asm.emitByte(op);
-            asm.emitOperandHelper(dst, src, 0);
+            asm.emitOperandHelper(dst, src, 0, getDisp8Scale(useEvex, size));
         }
     }
 
@@ -1100,39 +1177,45 @@
      */
     public static final class VexMoveOp extends VexRMOp {
         // @formatter:off
-        public static final VexMoveOp VMOVDQA = new VexMoveOp("VMOVDQA", P_66, M_0F, WIG, 0x6F, 0x7F);
-        public static final VexMoveOp VMOVDQU = new VexMoveOp("VMOVDQU", P_F3, M_0F, WIG, 0x6F, 0x7F);
-        public static final VexMoveOp VMOVAPS = new VexMoveOp("VMOVAPS", P_,   M_0F, WIG, 0x28, 0x29);
-        public static final VexMoveOp VMOVAPD = new VexMoveOp("VMOVAPD", P_66, M_0F, WIG, 0x28, 0x29);
-        public static final VexMoveOp VMOVUPS = new VexMoveOp("VMOVUPS", P_,   M_0F, WIG, 0x10, 0x11);
-        public static final VexMoveOp VMOVUPD = new VexMoveOp("VMOVUPD", P_66, M_0F, WIG, 0x10, 0x11);
-        public static final VexMoveOp VMOVSS  = new VexMoveOp("VMOVSS",  P_F3, M_0F, WIG, 0x10, 0x11);
-        public static final VexMoveOp VMOVSD  = new VexMoveOp("VMOVSD",  P_F2, M_0F, WIG, 0x10, 0x11);
-        public static final VexMoveOp VMOVD   = new VexMoveOp("VMOVD",   P_66, M_0F, W0,  0x6E, 0x7E, VEXOpAssertion.XMM_CPU);
-        public static final VexMoveOp VMOVQ   = new VexMoveOp("VMOVQ",   P_66, M_0F, W1,  0x6E, 0x7E, VEXOpAssertion.XMM_CPU);
+        public static final VexMoveOp VMOVDQA32 = new VexMoveOp("VMOVDQA32", P_66, M_0F, WIG, 0x6F, 0x7F, VEXOpAssertion.AVX1_AVX512F_VL,         EVEXTuple.FVM,       W0);
+        public static final VexMoveOp VMOVDQA64 = new VexMoveOp("VMOVDQA64", P_66, M_0F, WIG, 0x6F, 0x7F, VEXOpAssertion.AVX1_AVX512F_VL,         EVEXTuple.FVM,       W1);
+        public static final VexMoveOp VMOVDQU32 = new VexMoveOp("VMOVDQU32", P_F3, M_0F, WIG, 0x6F, 0x7F, VEXOpAssertion.AVX1_AVX512F_VL,         EVEXTuple.FVM,       W0);
+        public static final VexMoveOp VMOVDQU64 = new VexMoveOp("VMOVDQU64", P_F3, M_0F, WIG, 0x6F, 0x7F, VEXOpAssertion.AVX1_AVX512F_VL,         EVEXTuple.FVM,       W1);
+        public static final VexMoveOp VMOVAPS   = new VexMoveOp("VMOVAPS",   P_,   M_0F, WIG, 0x28, 0x29, VEXOpAssertion.AVX1_AVX512F_VL,         EVEXTuple.FVM,       W0);
+        public static final VexMoveOp VMOVAPD   = new VexMoveOp("VMOVAPD",   P_66, M_0F, WIG, 0x28, 0x29, VEXOpAssertion.AVX1_AVX512F_VL,         EVEXTuple.FVM,       W1);
+        public static final VexMoveOp VMOVUPS   = new VexMoveOp("VMOVUPS",   P_,   M_0F, WIG, 0x10, 0x11, VEXOpAssertion.AVX1_AVX512F_VL,         EVEXTuple.FVM,       W0);
+        public static final VexMoveOp VMOVUPD   = new VexMoveOp("VMOVUPD",   P_66, M_0F, WIG, 0x10, 0x11, VEXOpAssertion.AVX1_AVX512F_VL,         EVEXTuple.FVM,       W1);
+        public static final VexMoveOp VMOVSS    = new VexMoveOp("VMOVSS",    P_F3, M_0F, WIG, 0x10, 0x11, VEXOpAssertion.AVX1_AVX512F_ALL,        EVEXTuple.T1S_32BIT, W0);
+        public static final VexMoveOp VMOVSD    = new VexMoveOp("VMOVSD",    P_F2, M_0F, WIG, 0x10, 0x11, VEXOpAssertion.AVX1_AVX512F_ALL,        EVEXTuple.T1S_64BIT, W1);
+        public static final VexMoveOp VMOVD     = new VexMoveOp("VMOVD",     P_66, M_0F, W0,  0x6E, 0x7E, VEXOpAssertion.XMM_CPU_AVX512F_128ONLY, EVEXTuple.T1F_32BIT, W0);
+        public static final VexMoveOp VMOVQ     = new VexMoveOp("VMOVQ",     P_66, M_0F, W1,  0x6E, 0x7E, VEXOpAssertion.XMM_CPU_AVX512F_128ONLY, EVEXTuple.T1S_64BIT, W1);
         // @formatter:on
 
         private final int opReverse;
 
         private VexMoveOp(String opcode, int pp, int mmmmm, int w, int op, int opReverse) {
-            this(opcode, pp, mmmmm, w, op, opReverse, VEXOpAssertion.AVX1);
+            this(opcode, pp, mmmmm, w, op, opReverse, VEXOpAssertion.AVX1, EVEXTuple.INVALID, WIG);
         }
 
         private VexMoveOp(String opcode, int pp, int mmmmm, int w, int op, int opReverse, VEXOpAssertion assertion) {
-            super(opcode, pp, mmmmm, w, op, assertion);
+            this(opcode, pp, mmmmm, w, op, opReverse, assertion, EVEXTuple.INVALID, WIG);
+        }
+
+        private VexMoveOp(String opcode, int pp, int mmmmm, int w, int op, int opReverse, VEXOpAssertion assertion, EVEXTuple evexTuple, int wEvex) {
+            super(opcode, pp, mmmmm, w, op, assertion, evexTuple, wEvex);
             this.opReverse = opReverse;
         }
 
         public void emit(AMD64Assembler asm, AVXSize size, AMD64Address dst, Register src) {
             assert assertion.check((AMD64) asm.target.arch, size, src, null, null);
-            asm.vexPrefix(src, Register.None, dst, size, pp, mmmmm, w, false);
+            boolean useEvex = asm.vexPrefix(src, Register.None, dst, size, pp, mmmmm, w, wEvex, false);
             asm.emitByte(opReverse);
-            asm.emitOperandHelper(src, dst, 0);
+            asm.emitOperandHelper(src, dst, 0, getDisp8Scale(useEvex, size));
         }
 
         public void emitReverse(AMD64Assembler asm, AVXSize size, Register dst, Register src) {
             assert assertion.check((AMD64) asm.target.arch, size, src, null, dst);
-            asm.vexPrefix(src, Register.None, dst, size, pp, mmmmm, w, false);
+            asm.vexPrefix(src, Register.None, dst, size, pp, mmmmm, w, wEvex, false);
             asm.emitByte(opReverse);
             asm.emitModRM(src, dst);
         }
@@ -1160,7 +1243,7 @@
         @Override
         public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src, int imm8) {
             assert assertion.check((AMD64) asm.target.arch, size, dst, null, src);
-            asm.vexPrefix(dst, Register.None, src, size, pp, mmmmm, w, false);
+            asm.vexPrefix(dst, Register.None, src, size, pp, mmmmm, w, wEvex, false);
             asm.emitByte(op);
             asm.emitModRM(dst, src);
             asm.emitByte(imm8);
@@ -1168,9 +1251,9 @@
 
         public void emit(AMD64Assembler asm, AVXSize size, Register dst, AMD64Address src, int imm8) {
             assert assertion.check((AMD64) asm.target.arch, size, dst, null, null);
-            asm.vexPrefix(dst, Register.None, src, size, pp, mmmmm, w, false);
+            boolean useEvex = asm.vexPrefix(dst, Register.None, src, size, pp, mmmmm, w, wEvex, false);
             asm.emitByte(op);
-            asm.emitOperandHelper(dst, src, 1);
+            asm.emitOperandHelper(dst, src, 1, getDisp8Scale(useEvex, size));
             asm.emitByte(imm8);
         }
     }
@@ -1195,7 +1278,7 @@
         @Override
         public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src, int imm8) {
             assert assertion.check((AMD64) asm.target.arch, size, src, null, dst);
-            asm.vexPrefix(src, Register.None, dst, size, pp, mmmmm, w, false);
+            asm.vexPrefix(src, Register.None, dst, size, pp, mmmmm, w, wEvex, false);
             asm.emitByte(op);
             asm.emitModRM(src, dst);
             asm.emitByte(imm8);
@@ -1203,9 +1286,9 @@
 
         public void emit(AMD64Assembler asm, AVXSize size, AMD64Address dst, Register src, int imm8) {
             assert assertion.check((AMD64) asm.target.arch, size, src, null, null);
-            asm.vexPrefix(src, Register.None, dst, size, pp, mmmmm, w, false);
+            boolean useEvex = asm.vexPrefix(src, Register.None, dst, size, pp, mmmmm, w, wEvex, false);
             asm.emitByte(op);
-            asm.emitOperandHelper(src, dst, 1);
+            asm.emitOperandHelper(src, dst, 1, getDisp8Scale(useEvex, size));
             asm.emitByte(imm8);
         }
     }
@@ -1226,7 +1309,7 @@
 
         public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register mask, Register src1, Register src2) {
             assert assertion.check((AMD64) asm.target.arch, size, dst, mask, src1, src2);
-            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w, false);
+            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w, wEvex, false);
             asm.emitByte(op);
             asm.emitModRM(dst, src2);
             asm.emitByte(mask.encoding() << 4);
@@ -1234,9 +1317,9 @@
 
         public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register mask, Register src1, AMD64Address src2) {
             assert assertion.check((AMD64) asm.target.arch, size, dst, mask, src1, null);
-            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w, false);
+            boolean useEvex = asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w, wEvex, false);
             asm.emitByte(op);
-            asm.emitOperandHelper(dst, src2, 0);
+            asm.emitOperandHelper(dst, src2, 0, getDisp8Scale(useEvex, size));
             asm.emitByte(mask.encoding() << 4);
         }
     }
@@ -1324,16 +1407,16 @@
 
         public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src1, Register src2) {
             assert assertion.check((AMD64) asm.target.arch, size, dst, src1, src2);
-            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w, false);
+            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w, wEvex, false);
             asm.emitByte(op);
             asm.emitModRM(dst, src2);
         }
 
         public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src1, AMD64Address src2) {
             assert assertion.check((AMD64) asm.target.arch, size, dst, src1, null);
-            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w, false);
+            boolean useEvex = asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w, wEvex, false);
             asm.emitByte(op);
-            asm.emitOperandHelper(dst, src2, 0);
+            asm.emitOperandHelper(dst, src2, 0, getDisp8Scale(useEvex, size));
         }
     }
 
@@ -1353,7 +1436,7 @@
         public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src1, Register src2) {
             assert assertion.check((AMD64) asm.target.arch, LZ, dst, src1, src2, null);
             assert size == AVXSize.DWORD || size == AVXSize.QWORD;
-            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, size == AVXSize.DWORD ? W0 : W1, false);
+            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, size == AVXSize.DWORD ? W0 : W1, wEvex, false);
             asm.emitByte(op);
             asm.emitModRM(dst, src2);
         }
@@ -1362,7 +1445,7 @@
         public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src1, AMD64Address src2) {
             assert assertion.check((AMD64) asm.target.arch, LZ, dst, src1, null, null);
             assert size == AVXSize.DWORD || size == AVXSize.QWORD;
-            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, size == AVXSize.DWORD ? W0 : W1, false);
+            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, size == AVXSize.DWORD ? W0 : W1, wEvex, false);
             asm.emitByte(op);
             asm.emitOperandHelper(dst, src2, 0);
         }
@@ -1384,7 +1467,7 @@
         public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src1, Register src2) {
             assert assertion.check((AMD64) asm.target.arch, LZ, dst, src2, src1, null);
             assert size == AVXSize.DWORD || size == AVXSize.QWORD;
-            asm.vexPrefix(dst, src2, src1, size, pp, mmmmm, size == AVXSize.DWORD ? W0 : W1, false);
+            asm.vexPrefix(dst, src2, src1, size, pp, mmmmm, size == AVXSize.DWORD ? W0 : W1, wEvex, false);
             asm.emitByte(op);
             asm.emitModRM(dst, src1);
         }
@@ -1392,7 +1475,7 @@
         public void emit(AMD64Assembler asm, AVXSize size, Register dst, AMD64Address src1, Register src2) {
             assert assertion.check((AMD64) asm.target.arch, LZ, dst, src2, null, null);
             assert size == AVXSize.DWORD || size == AVXSize.QWORD;
-            asm.vexPrefix(dst, src2, src1, size, pp, mmmmm, size == AVXSize.DWORD ? W0 : W1, false);
+            asm.vexPrefix(dst, src2, src1, size, pp, mmmmm, size == AVXSize.DWORD ? W0 : W1, wEvex, false);
             asm.emitByte(op);
             asm.emitOperandHelper(dst, src1, 0);
         }
@@ -1414,7 +1497,7 @@
         @Override
         public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src) {
             assert assertion.check((AMD64) asm.target.arch, size, dst, null, null);
-            asm.vexPrefix(AMD64.cpuRegisters[ext], dst, src, size, pp, mmmmm, size == AVXSize.DWORD ? W0 : W1, false);
+            asm.vexPrefix(AMD64.cpuRegisters[ext], dst, src, size, pp, mmmmm, size == AVXSize.DWORD ? W0 : W1, wEvex, false);
             asm.emitByte(op);
             asm.emitModRM(ext, src);
         }
@@ -1422,7 +1505,7 @@
         @Override
         public void emit(AMD64Assembler asm, AVXSize size, Register dst, AMD64Address src) {
             assert assertion.check((AMD64) asm.target.arch, size, dst, null, null);
-            asm.vexPrefix(AMD64.cpuRegisters[ext], dst, src, size, pp, mmmmm, size == AVXSize.DWORD ? W0 : W1, false);
+            asm.vexPrefix(AMD64.cpuRegisters[ext], dst, src, size, pp, mmmmm, size == AVXSize.DWORD ? W0 : W1, wEvex, false);
             asm.emitByte(op);
             asm.emitOperandHelper(ext, src, 0);
         }
@@ -1455,7 +1538,7 @@
         @Override
         public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src, int imm8) {
             assert assertion.check((AMD64) asm.target.arch, size, null, dst, src);
-            asm.vexPrefix(null, dst, src, size, pp, mmmmm, w, false);
+            asm.vexPrefix(null, dst, src, size, pp, mmmmm, w, wEvex, false);
             asm.emitByte(immOp);
             asm.emitModRM(r, src);
             asm.emitByte(imm8);
@@ -1483,16 +1566,16 @@
 
         public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register mask, AMD64Address src) {
             assert assertion.check((AMD64) asm.target.arch, size, dst, mask, null);
-            asm.vexPrefix(dst, mask, src, size, pp, mmmmm, w, false);
+            asm.vexPrefix(dst, mask, src, size, pp, mmmmm, w, wEvex, false);
             asm.emitByte(op);
             asm.emitOperandHelper(dst, src, 0);
         }
 
         public void emit(AMD64Assembler asm, AVXSize size, AMD64Address dst, Register mask, Register src) {
             assert assertion.check((AMD64) asm.target.arch, size, src, mask, null);
-            asm.vexPrefix(src, mask, dst, size, pp, mmmmm, w, false);
+            boolean useEvex = asm.vexPrefix(src, mask, dst, size, pp, mmmmm, w, wEvex, false);
             asm.emitByte(opReverse);
-            asm.emitOperandHelper(src, dst, 0);
+            asm.emitOperandHelper(src, dst, 0, getDisp8Scale(useEvex, size));
         }
     }
 
@@ -1518,7 +1601,7 @@
         public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src1, Register src2, int imm8) {
             assert assertion.check((AMD64) asm.target.arch, size, dst, src1, src2);
             assert (imm8 & 0xFF) == imm8;
-            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w, false);
+            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w, wEvex, false);
             asm.emitByte(op);
             asm.emitModRM(dst, src2);
             asm.emitByte(imm8);
@@ -1527,9 +1610,9 @@
         public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src1, AMD64Address src2, int imm8) {
             assert assertion.check((AMD64) asm.target.arch, size, dst, src1, null);
             assert (imm8 & 0xFF) == imm8;
-            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w, false);
+            boolean useEvex = asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w, wEvex, false);
             asm.emitByte(op);
-            asm.emitOperandHelper(dst, src2, 1);
+            asm.emitOperandHelper(dst, src2, 1, getDisp8Scale(useEvex, size));
             asm.emitByte(imm8);
         }
     }
@@ -1631,7 +1714,7 @@
 
         public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src1, Register src2, Predicate p) {
             assert assertion.check((AMD64) asm.target.arch, size, dst, src1, src2);
-            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w, false);
+            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w, wEvex, false);
             asm.emitByte(op);
             asm.emitModRM(dst, src2);
             asm.emitByte(p.imm8);
@@ -1639,9 +1722,9 @@
 
         public void emit(AMD64Assembler asm, AVXSize size, Register dst, Register src1, AMD64Address src2, Predicate p) {
             assert assertion.check((AMD64) asm.target.arch, size, dst, src1, null);
-            asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w, false);
+            boolean useEvex = asm.vexPrefix(dst, src1, src2, size, pp, mmmmm, w, wEvex, false);
             asm.emitByte(op);
-            asm.emitOperandHelper(dst, src2, 1);
+            asm.emitOperandHelper(dst, src2, 1, getDisp8Scale(useEvex, size));
             asm.emitByte(p.imm8);
         }
     }
@@ -3748,12 +3831,12 @@
     }
 
     public final void vmovdqu(Register dst, AMD64Address src) {
-        VexMoveOp.VMOVDQU.emit(this, AVXSize.YMM, dst, src);
+        VexMoveOp.VMOVDQU32.emit(this, AVXSize.YMM, dst, src);
     }
 
     public final void vmovdqu(AMD64Address dst, Register src) {
         assert inRC(XMM, src);
-        VexMoveOp.VMOVDQU.emit(this, AVXSize.YMM, dst, src);
+        VexMoveOp.VMOVDQU32.emit(this, AVXSize.YMM, dst, src);
     }
 
     public final void vpmovzxbw(Register dst, AMD64Address src) {
@@ -3773,7 +3856,7 @@
         assert supports(CPUFeature.AVX512BW);
         assert inRC(MASK, src1) && inRC(MASK, src2);
         // Code: VEX.L0.66.0F.W1 98 /r
-        vexPrefix(src1, Register.None, src2, AVXSize.XMM, P_66, M_0F, W1, true);
+        vexPrefix(src1, Register.None, src2, AVXSize.XMM, P_66, M_0F, W1, W1, true);
         emitByte(0x98);
         emitModRM(src1, src2);
     }
@@ -3785,7 +3868,7 @@
         assert supports(CPUFeature.AVX512BW);
         assert inRC(MASK, src1) && inRC(MASK, src2);
         // Code: VEX.L0.0F.W1 98 /r
-        vexPrefix(src1, Register.None, src2, AVXSize.XMM, P_, M_0F, W1, true);
+        vexPrefix(src1, Register.None, src2, AVXSize.XMM, P_, M_0F, W1, W1, true);
         emitByte(0x98);
         emitModRM(src1, src2);
     }
@@ -3801,14 +3884,14 @@
                 // kmovd(KRegister dst, KRegister src):
                 // Insn: KMOVD k1, k2/m32
                 // Code: VEX.L0.66.0F.W1 90 /r
-                vexPrefix(dst, Register.None, src, AVXSize.XMM, P_66, M_0F, W1, true);
+                vexPrefix(dst, Register.None, src, AVXSize.XMM, P_66, M_0F, W1, W1, true);
                 emitByte(0x90);
                 emitModRM(dst, src);
             } else {
                 // kmovd(KRegister dst, Register src)
                 // Insn: KMOVD k1, r32
                 // Code: VEX.L0.F2.0F.W0 92 /r
-                vexPrefix(dst, Register.None, src, AVXSize.XMM, P_F2, M_0F, W0, true);
+                vexPrefix(dst, Register.None, src, AVXSize.XMM, P_F2, M_0F, W0, W0, true);
                 emitByte(0x92);
                 emitModRM(dst, src);
             }
@@ -3817,7 +3900,7 @@
                 // kmovd(Register dst, KRegister src)
                 // Insn: KMOVD r32, k1
                 // Code: VEX.L0.F2.0F.W0 93 /r
-                vexPrefix(dst, Register.None, src, AVXSize.XMM, P_F2, M_0F, W0, true);
+                vexPrefix(dst, Register.None, src, AVXSize.XMM, P_F2, M_0F, W0, W0, true);
                 emitByte(0x93);
                 emitModRM(dst, src);
             } else {
@@ -3837,14 +3920,14 @@
                 // kmovq(KRegister dst, KRegister src):
                 // Insn: KMOVQ k1, k2/m64
                 // Code: VEX.L0.0F.W1 90 /r
-                vexPrefix(dst, Register.None, src, AVXSize.XMM, P_, M_0F, W1, true);
+                vexPrefix(dst, Register.None, src, AVXSize.XMM, P_, M_0F, W1, W1, true);
                 emitByte(0x90);
                 emitModRM(dst, src);
             } else {
                 // kmovq(KRegister dst, Register src)
                 // Insn: KMOVQ k1, r64
                 // Code: VEX.L0.F2.0F.W1 92 /r
-                vexPrefix(dst, Register.None, src, AVXSize.XMM, P_F2, M_0F, W1, true);
+                vexPrefix(dst, Register.None, src, AVXSize.XMM, P_F2, M_0F, W1, W1, true);
                 emitByte(0x92);
                 emitModRM(dst, src);
             }
@@ -3853,7 +3936,7 @@
                 // kmovq(Register dst, KRegister src)
                 // Insn: KMOVQ r64, k1
                 // Code: VEX.L0.F2.0F.W1 93 /r
-                vexPrefix(dst, Register.None, src, AVXSize.XMM, P_F2, M_0F, W1, true);
+                vexPrefix(dst, Register.None, src, AVXSize.XMM, P_F2, M_0F, W1, W1, true);
                 emitByte(0x93);
                 emitModRM(dst, src);
             } else {
@@ -3868,7 +3951,7 @@
         assert supports(CPUFeature.AVX512BW);
         assert inRC(MASK, src1) && inRC(MASK, src2);
         // Code: VEX.L0.66.0F.W1 99 /r
-        vexPrefix(src1, Register.None, src2, AVXSize.XMM, P_66, M_0F, W1, true);
+        vexPrefix(src1, Register.None, src2, AVXSize.XMM, P_66, M_0F, W1, W1, true);
         emitByte(0x99);
         emitModRM(src1, src2);
     }
@@ -3878,7 +3961,7 @@
         assert inRC(XMM, dst);
         evexPrefix(dst, Register.None, Register.None, src, AVXSize.ZMM, P_F3, M_0F, W1, Z0, B0);
         emitByte(0x6F);
-        emitEVEXOperandHelper(dst, src, 0, EVEXTuple.FVM.getDisp8ScalingFactor(AVXSize.ZMM));
+        emitOperandHelper(dst, src, 0, EVEXTuple.FVM.getDisp8ScalingFactor(AVXSize.ZMM));
     }
 
     // Insn: VPMOVZXBW zmm1, m256
@@ -3889,7 +3972,7 @@
         // Code: EVEX.512.66.0F38.WIG 30 /r
         evexPrefix(dst, Register.None, Register.None, src, AVXSize.ZMM, P_66, M_0F38, WIG, Z0, B0);
         emitByte(0x30);
-        emitEVEXOperandHelper(dst, src, 0, EVEXTuple.HVM.getDisp8ScalingFactor(AVXSize.ZMM));
+        emitOperandHelper(dst, src, 0, EVEXTuple.HVM.getDisp8ScalingFactor(AVXSize.ZMM));
     }
 
     public final void evpcmpeqb(Register kdst, Register nds, AMD64Address src) {
@@ -3897,7 +3980,7 @@
         assert inRC(MASK, kdst) && inRC(XMM, nds);
         evexPrefix(kdst, Register.None, nds, src, AVXSize.ZMM, P_66, M_0F, WIG, Z0, B0);
         emitByte(0x74);
-        emitEVEXOperandHelper(kdst, src, 0, EVEXTuple.FVM.getDisp8ScalingFactor(AVXSize.ZMM));
+        emitOperandHelper(kdst, src, 0, EVEXTuple.FVM.getDisp8ScalingFactor(AVXSize.ZMM));
     }
 
     // Insn: VMOVDQU16 zmm1 {k1}{z}, zmm2/m512
@@ -3910,7 +3993,7 @@
         // Code: EVEX.512.F2.0F.W1 6F /r
         evexPrefix(dst, Register.None, Register.None, src, AVXSize.ZMM, P_F2, M_0F, W1, Z0, B0);
         emitByte(0x6F);
-        emitEVEXOperandHelper(dst, src, 0, EVEXTuple.FVM.getDisp8ScalingFactor(AVXSize.ZMM));
+        emitOperandHelper(dst, src, 0, EVEXTuple.FVM.getDisp8ScalingFactor(AVXSize.ZMM));
     }
 
     // Insn: VMOVDQU16 zmm1, k1:z, m512
@@ -3921,7 +4004,7 @@
         // Code: EVEX.512.F2.0F.W1 6F /r
         evexPrefix(dst, mask, Register.None, src, AVXSize.ZMM, P_F2, M_0F, W1, Z1, B0);
         emitByte(0x6F);
-        emitEVEXOperandHelper(dst, src, 0, EVEXTuple.FVM.getDisp8ScalingFactor(AVXSize.ZMM));
+        emitOperandHelper(dst, src, 0, EVEXTuple.FVM.getDisp8ScalingFactor(AVXSize.ZMM));
     }
 
     // Insn: VMOVDQU16 zmm2/m512 {k1}{z}, zmm1
@@ -3934,7 +4017,7 @@
         // Code: EVEX.512.F2.0F.W1 7F /r
         evexPrefix(src, Register.None, Register.None, dst, AVXSize.ZMM, P_F2, M_0F, W1, Z0, B0);
         emitByte(0x7F);
-        emitEVEXOperandHelper(src, dst, 0, EVEXTuple.FVM.getDisp8ScalingFactor(AVXSize.ZMM));
+        emitOperandHelper(src, dst, 0, EVEXTuple.FVM.getDisp8ScalingFactor(AVXSize.ZMM));
     }
 
     // Insn: VMOVDQU16 m512, k1, zmm1
@@ -3945,7 +4028,7 @@
         // Code: EVEX.512.F2.0F.W1 7F /r
         evexPrefix(src, mask, Register.None, dst, AVXSize.ZMM, P_F2, M_0F, W1, Z0, B0);
         emitByte(0x7F);
-        emitEVEXOperandHelper(src, dst, 0, EVEXTuple.FVM.getDisp8ScalingFactor(AVXSize.ZMM));
+        emitOperandHelper(src, dst, 0, EVEXTuple.FVM.getDisp8ScalingFactor(AVXSize.ZMM));
     }
 
     // Insn: VPBROADCASTW zmm1 {k1}{z}, reg
@@ -4000,7 +4083,7 @@
         // Code: EVEX.512.F3.0F38.W0 30 /r
         evexPrefix(src, Register.None, Register.None, dst, AVXSize.ZMM, P_F3, M_0F38, W0, Z0, B0);
         emitByte(0x30);
-        emitEVEXOperandHelper(src, dst, 0, EVEXTuple.HVM.getDisp8ScalingFactor(AVXSize.ZMM));
+        emitOperandHelper(src, dst, 0, EVEXTuple.HVM.getDisp8ScalingFactor(AVXSize.ZMM));
     }
 
     // Insn: VPMOVWB m256, k1, zmm2
@@ -4011,7 +4094,7 @@
         // Code: EVEX.512.F3.0F38.W0 30 /r
         evexPrefix(src, mask, Register.None, dst, AVXSize.ZMM, P_F3, M_0F38, W0, Z0, B0);
         emitByte(0x30);
-        emitEVEXOperandHelper(src, dst, 0, EVEXTuple.HVM.getDisp8ScalingFactor(AVXSize.ZMM));
+        emitOperandHelper(src, dst, 0, EVEXTuple.HVM.getDisp8ScalingFactor(AVXSize.ZMM));
     }
 
     // Insn: VPMOVZXBW zmm1 {k1}{z}, ymm2/m256
@@ -4024,7 +4107,7 @@
         // Code: EVEX.512.66.0F38.WIG 30 /r
         evexPrefix(dst, mask, Register.None, src, AVXSize.ZMM, P_66, M_0F38, WIG, Z0, B0);
         emitByte(0x30);
-        emitEVEXOperandHelper(dst, src, 0, EVEXTuple.HVM.getDisp8ScalingFactor(AVXSize.ZMM));
+        emitOperandHelper(dst, src, 0, EVEXTuple.HVM.getDisp8ScalingFactor(AVXSize.ZMM));
     }
 
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64BaseAssembler.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64BaseAssembler.java	Wed Sep 25 22:40:41 2019 +0200
@@ -32,11 +32,11 @@
 import static jdk.vm.ci.amd64.AMD64.rsp;
 import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.EVEXPrefixConfig.B0;
 import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.EVEXPrefixConfig.B1;
-import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.EVEXPrefixConfig.L512;
 import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.EVEXPrefixConfig.Z0;
 import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.EVEXPrefixConfig.Z1;
 import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.VEXPrefixConfig.L128;
 import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.VEXPrefixConfig.L256;
+import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.VEXPrefixConfig.L512;
 import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.VEXPrefixConfig.LZ;
 import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.VEXPrefixConfig.M_0F;
 import static org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.VEXPrefixConfig.M_0F38;
@@ -510,6 +510,8 @@
         emitModRM(reg.encoding & 0x07, rm);
     }
 
+    public static final int DEFAULT_DISP8_SCALE = 1;
+
     /**
      * Emits the ModR/M byte and optionally the SIB byte for one register and one memory operand.
      *
@@ -517,19 +519,19 @@
      */
     protected final void emitOperandHelper(Register reg, AMD64Address addr, boolean force4Byte, int additionalInstructionSize) {
         assert !reg.equals(Register.None);
-        emitOperandHelper(encode(reg), addr, force4Byte, additionalInstructionSize, 1);
+        emitOperandHelper(encode(reg), addr, force4Byte, additionalInstructionSize, DEFAULT_DISP8_SCALE);
     }
 
     protected final void emitOperandHelper(int reg, AMD64Address addr, int additionalInstructionSize) {
-        emitOperandHelper(reg, addr, false, additionalInstructionSize, 1);
+        emitOperandHelper(reg, addr, false, additionalInstructionSize, DEFAULT_DISP8_SCALE);
     }
 
     protected final void emitOperandHelper(Register reg, AMD64Address addr, int additionalInstructionSize) {
         assert !reg.equals(Register.None);
-        emitOperandHelper(encode(reg), addr, false, additionalInstructionSize, 1);
+        emitOperandHelper(encode(reg), addr, false, additionalInstructionSize, DEFAULT_DISP8_SCALE);
     }
 
-    protected final void emitEVEXOperandHelper(Register reg, AMD64Address addr, int additionalInstructionSize, int evexDisp8Scale) {
+    protected final void emitOperandHelper(Register reg, AMD64Address addr, int additionalInstructionSize, int evexDisp8Scale) {
         assert !reg.equals(Register.None);
         emitOperandHelper(encode(reg), addr, false, additionalInstructionSize, evexDisp8Scale);
     }
@@ -739,6 +741,7 @@
     public static final class VEXPrefixConfig {
         public static final int L128 = 0;
         public static final int L256 = 1;
+        public static final int L512 = 2;
         public static final int LZ = 0;
 
         public static final int W0 = 0;
@@ -936,18 +939,29 @@
         }
     }
 
-    public final void vexPrefix(Register dst, Register nds, Register src, AVXSize size, int pp, int mmmmm, int w, boolean checkAVX) {
-        emitVEX(getLFlag(size), pp, mmmmm, w, getRXB(dst, src), nds.isValid() ? nds.encoding() : 0, checkAVX);
+    public static boolean isAVX512Register(Register reg) {
+        return reg != null && reg.isValid() && AMD64.XMM.equals(reg.getRegisterCategory()) && reg.encoding > 15;
     }
 
-    public final void vexPrefix(Register dst, Register nds, AMD64Address src, AVXSize size, int pp, int mmmmm, int w, boolean checkAVX) {
+    public final boolean vexPrefix(Register dst, Register nds, Register src, AVXSize size, int pp, int mmmmm, int w, int wEvex, boolean checkAVX) {
+        if (isAVX512Register(dst) || isAVX512Register(nds) || isAVX512Register(src)) {
+            evexPrefix(dst, Register.None, nds, src, size, pp, mmmmm, wEvex, Z0, B0);
+            return true;
+        }
         emitVEX(getLFlag(size), pp, mmmmm, w, getRXB(dst, src), nds.isValid() ? nds.encoding() : 0, checkAVX);
+        return false;
+    }
+
+    public final boolean vexPrefix(Register dst, Register nds, AMD64Address src, AVXSize size, int pp, int mmmmm, int w, int wEvex, boolean checkAVX) {
+        if (isAVX512Register(dst) || isAVX512Register(nds)) {
+            evexPrefix(dst, Register.None, nds, src, size, pp, mmmmm, wEvex, Z0, B0);
+            return true;
+        }
+        emitVEX(getLFlag(size), pp, mmmmm, w, getRXB(dst, src), nds.isValid() ? nds.encoding() : 0, checkAVX);
+        return false;
     }
 
     protected static final class EVEXPrefixConfig {
-        public static final int L512 = 2;
-        public static final int LIG = 0;
-
         public static final int Z0 = 0x0;
         public static final int Z1 = 0x1;
 
@@ -967,6 +981,7 @@
      * Reference: Intel Software Developer's Manual Volume 2, Section 2.6.5
      */
     protected enum EVEXTuple {
+        INVALID(NOT_SUPPORTED_VECTOR_LENGTH, NOT_SUPPORTED_VECTOR_LENGTH, NOT_SUPPORTED_VECTOR_LENGTH),
         FV_NO_BROADCAST_32BIT(16, 32, 64),
         FV_BROADCAST_32BIT(4, 4, 4),
         FV_NO_BROADCAST_64BIT(16, 32, 64),
@@ -1154,7 +1169,7 @@
      * Helper method for emitting EVEX prefix in the form of RRRM. Because the memory addressing in
      * EVEX-encoded instructions employ a compressed displacement scheme when using disp8 form, the
      * user of this API should make sure to encode the operands using
-     * {@link #emitEVEXOperandHelper(Register, AMD64Address, int, int)}.
+     * {@link #emitOperandHelper(Register, AMD64Address, int, int)}.
      */
     protected final void evexPrefix(Register dst, Register mask, Register nds, AMD64Address src, AVXSize size, int pp, int mm, int w, int z, int b) {
         assert !mask.isValid() || inRC(MASK, mask);
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64MacroAssembler.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64MacroAssembler.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -24,12 +24,11 @@
 
 package org.graalvm.compiler.asm.amd64;
 
-import static jdk.vm.ci.amd64.AMD64.rbp;
-import static jdk.vm.ci.amd64.AMD64.rsp;
 import static org.graalvm.compiler.asm.amd64.AMD64AsmOptions.UseIncDec;
 import static org.graalvm.compiler.asm.amd64.AMD64AsmOptions.UseXmmLoadAndClearUpper;
 import static org.graalvm.compiler.asm.amd64.AMD64AsmOptions.UseXmmRegToRegMoveAll;
 
+import org.graalvm.compiler.asm.amd64.AVXKind.AVXSize;
 import org.graalvm.compiler.core.common.NumUtil;
 
 import jdk.vm.ci.amd64.AMD64;
@@ -84,20 +83,6 @@
         }
     }
 
-    public final void enter(int frameSize) {
-        if (NumUtil.isUShort(frameSize)) {
-            // Can use enter instruction only for frame size that fits in 16 bits.
-            emitByte(0xC8);
-            emitShort(frameSize);
-            emitByte(0x00);
-        } else {
-            // Fall back to manual sequence.
-            push(rbp);
-            movq(rbp, rsp);
-            decrementq(rsp, frameSize);
-        }
-    }
-
     public void incrementq(Register reg, int value) {
         if (value == Integer.MIN_VALUE) {
             addq(reg, value);
@@ -239,43 +224,76 @@
     public void movflt(Register dst, Register src) {
         assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
         if (UseXmmRegToRegMoveAll) {
-            movaps(dst, src);
+            if (isAVX512Register(dst) || isAVX512Register(src)) {
+                VexMoveOp.VMOVAPS.emit(this, AVXSize.XMM, dst, src);
+            } else {
+                movaps(dst, src);
+            }
         } else {
-            movss(dst, src);
+            if (isAVX512Register(dst) || isAVX512Register(src)) {
+                VexMoveOp.VMOVSS.emit(this, AVXSize.XMM, dst, src);
+            } else {
+                movss(dst, src);
+            }
         }
     }
 
     public void movflt(Register dst, AMD64Address src) {
         assert dst.getRegisterCategory().equals(AMD64.XMM);
-        movss(dst, src);
+        if (isAVX512Register(dst)) {
+            VexMoveOp.VMOVSS.emit(this, AVXSize.XMM, dst, src);
+        } else {
+            movss(dst, src);
+        }
     }
 
     public void movflt(AMD64Address dst, Register src) {
         assert src.getRegisterCategory().equals(AMD64.XMM);
-        movss(dst, src);
+        if (isAVX512Register(src)) {
+            VexMoveOp.VMOVSS.emit(this, AVXSize.XMM, dst, src);
+        } else {
+            movss(dst, src);
+        }
     }
 
     public void movdbl(Register dst, Register src) {
         assert dst.getRegisterCategory().equals(AMD64.XMM) && src.getRegisterCategory().equals(AMD64.XMM);
         if (UseXmmRegToRegMoveAll) {
-            movapd(dst, src);
+            if (isAVX512Register(dst) || isAVX512Register(src)) {
+                VexMoveOp.VMOVAPD.emit(this, AVXSize.XMM, dst, src);
+            } else {
+                movapd(dst, src);
+            }
         } else {
-            movsd(dst, src);
+            if (isAVX512Register(dst) || isAVX512Register(src)) {
+                VexMoveOp.VMOVSD.emit(this, AVXSize.XMM, dst, src);
+            } else {
+                movsd(dst, src);
+            }
         }
     }
 
     public void movdbl(Register dst, AMD64Address src) {
         assert dst.getRegisterCategory().equals(AMD64.XMM);
         if (UseXmmLoadAndClearUpper) {
-            movsd(dst, src);
+            if (isAVX512Register(dst)) {
+                VexMoveOp.VMOVSD.emit(this, AVXSize.XMM, dst, src);
+            } else {
+                movsd(dst, src);
+            }
         } else {
+            assert !isAVX512Register(dst);
             movlpd(dst, src);
         }
     }
 
     public void movdbl(AMD64Address dst, Register src) {
         assert src.getRegisterCategory().equals(AMD64.XMM);
-        movsd(dst, src);
+        if (isAVX512Register(src)) {
+            VexMoveOp.VMOVSD.emit(this, AVXSize.XMM, dst, src);
+        } else {
+            movsd(dst, src);
+        }
     }
 
     /**
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAssembler.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAssembler.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.test/src/org/graalvm/compiler/asm/test/AssemblerTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.test/src/org/graalvm/compiler/asm/test/AssemblerTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -32,6 +32,7 @@
 import org.graalvm.compiler.code.CompilationResult;
 import org.graalvm.compiler.code.DisassemblerProvider;
 import org.graalvm.compiler.core.common.CompilationIdentifier;
+import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig;
 import org.graalvm.compiler.core.gen.LIRGenerationProvider;
 import org.graalvm.compiler.core.target.Backend;
 import org.graalvm.compiler.debug.DebugContext;
@@ -91,7 +92,8 @@
             RegisterConfig registerConfig = codeCache.getRegisterConfig();
             CompilationIdentifier compilationId = backend.getCompilationIdentifier(method);
             StructuredGraph graph = new StructuredGraph.Builder(options, debug).method(method).compilationId(compilationId).build();
-            CallingConvention cc = ((LIRGenerationProvider) backend).newLIRGenerationResult(compilationId, null, null, graph, null).getCallingConvention();
+            RegisterAllocationConfig registerAllocationConfig = backend.newRegisterAllocationConfig(null, null);
+            CallingConvention cc = ((LIRGenerationProvider) backend).newLIRGenerationResult(compilationId, null, registerAllocationConfig, graph, null).getCallingConvention();
 
             CompilationResult compResult = new CompilationResult(graph.compilationId());
             byte[] targetCode = test.generateCode(compResult, codeCache.getTarget(), registerConfig, cc);
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Assembler.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Assembler.java	Wed Sep 25 22:40:41 2019 +0200
@@ -162,6 +162,10 @@
         return codeBuffer.close(trimmedCopy);
     }
 
+    public byte[] copy(int start, int end) {
+        return codeBuffer.copyData(start, end);
+    }
+
     private void checkAndClearLabelsWithPatches() throws InternalError {
         Label label = labelsWithPatches;
         while (label != null) {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Buffer.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Buffer.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Label.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Label.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/CompilationResult.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/CompilationResult.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DataSection.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DataSection.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFileDisassemblerProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFileDisassemblerProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64.test/src/org/graalvm/compiler/core/aarch64/test/AArch64CbzTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64.test/src/org/graalvm/compiler/core/aarch64/test/AArch64CbzTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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.
  * Copyright (c) 2018, Arm Limited. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -67,14 +67,6 @@
         }
     }
 
-    public static String objectEqualsNull(String s1, String s2) {
-        if (s1.equals(null)) {
-            return s1 + "abc";
-        } else {
-            return s2 + "abd";
-        }
-    }
-
     public static String objectEquals(String s1, String s2) {
         if (s1.equals(s2)) {
             return s1 + "abc";
@@ -112,13 +104,6 @@
     }
 
     @Test
-    public void testObjectEqualsNull() {
-        test("objectEqualsNull", "ab", "ac");
-        test("objectEqualsNull", "abc", "abc");
-        checkLIR("objectEqualsNull", predicate, 1);
-    }
-
-    @Test
     public void testObjectEquals() {
         test("objectEquals", "ab", "ac");
         test("objectEquals", "abc", "abc");
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRGenerator.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRGenerator.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -66,6 +66,7 @@
 import org.graalvm.compiler.lir.aarch64.AArch64Move.MembarOp;
 import org.graalvm.compiler.lir.aarch64.AArch64PauseOp;
 import org.graalvm.compiler.lir.aarch64.AArch64SpeculativeBarrier;
+import org.graalvm.compiler.lir.aarch64.AArch64ZeroMemoryOp;
 import org.graalvm.compiler.lir.gen.LIRGenerationResult;
 import org.graalvm.compiler.lir.gen.LIRGenerator;
 import org.graalvm.compiler.phases.util.Providers;
@@ -530,7 +531,7 @@
     }
 
     @Override
-    public Variable emitArrayEquals(JavaKind kind, Value array1, Value array2, Value length, int constantLength, boolean directPointers) {
+    public Variable emitArrayEquals(JavaKind kind, Value array1, Value array2, Value length, boolean directPointers) {
         Variable result = newVariable(LIRKind.value(AArch64Kind.DWORD));
         append(new AArch64ArrayEqualsOp(this, kind, result, array1, array2, asAllocatable(length), directPointers));
         return result;
@@ -583,4 +584,10 @@
     public void emitSpeculationFence() {
         append(new AArch64SpeculativeBarrier());
     }
+
+    @Override
+    public void emitZeroMemory(Value address, Value length) {
+        // Value address is 8-byte aligned; Value length is multiple of 8.
+        append(new AArch64ZeroMemoryOp(asAllocatable(address), asAllocatable(length), false, -1));
+    }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LoweringProviderMixin.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LoweringProviderMixin.java	Wed Sep 25 22:40:41 2019 +0200
@@ -35,7 +35,7 @@
     }
 
     @Override
-    default boolean supportBulkZeroing() {
-        return false;
+    default int bulkZeroingStride() {
+        return 8;
     }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ReadNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ReadNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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.
  * Copyright (c) 2017, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -72,6 +72,11 @@
         gen.setResult(this, arithgen.emitExtendMemory(isSigned, readKind, resultBits, (AArch64AddressValue) gen.operand(getAddress()), gen.state(this)));
     }
 
+    @Override
+    public Stamp getAccessStamp() {
+        return accessStamp;
+    }
+
     /**
      * replace a ReadNode with an AArch64-specific variant which knows how to merge a downstream
      * zero or sign extend into the read operation.
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64SuitesCreator.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64SuitesCreator.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/AMD64MatchRuleTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/AMD64MatchRuleTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64ArithmeticLIRGenerator.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64ArithmeticLIRGenerator.java	Wed Sep 25 22:40:41 2019 +0200
@@ -124,7 +124,6 @@
 import org.graalvm.compiler.lir.amd64.AMD64SignExtendOp;
 import org.graalvm.compiler.lir.amd64.AMD64Ternary;
 import org.graalvm.compiler.lir.amd64.AMD64Unary;
-import org.graalvm.compiler.lir.amd64.AMD64ZeroMemoryOp;
 import org.graalvm.compiler.lir.amd64.vector.AMD64VectorBinary;
 import org.graalvm.compiler.lir.amd64.vector.AMD64VectorBinary.AVXBinaryConstFloatOp;
 import org.graalvm.compiler.lir.amd64.vector.AMD64VectorBinary.AVXBinaryOp;
@@ -1130,12 +1129,6 @@
         return new AMD64MathPowOp().emitLIRWrapper(getLIRGen(), x, y);
     }
 
-    @Override
-    public void emitZeroMemory(Value address, Value length) {
-        RegisterValue lengthReg = moveToReg(AMD64.rcx, length);
-        getLIRGen().append(new AMD64ZeroMemoryOp(getAMD64LIRGen().asAddressValue(address), lengthReg));
-    }
-
     protected AMD64LIRGenerator getAMD64LIRGen() {
         return (AMD64LIRGenerator) getLIRGen();
     }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRGenerator.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRGenerator.java	Wed Sep 25 22:40:41 2019 +0200
@@ -48,7 +48,10 @@
 import org.graalvm.compiler.asm.amd64.AMD64Assembler.AMD64RMOp;
 import org.graalvm.compiler.asm.amd64.AMD64Assembler.ConditionFlag;
 import org.graalvm.compiler.asm.amd64.AMD64Assembler.SSEOp;
+import org.graalvm.compiler.asm.amd64.AMD64Assembler.VexRMOp;
 import org.graalvm.compiler.asm.amd64.AMD64BaseAssembler.OperandSize;
+import org.graalvm.compiler.asm.amd64.AVXKind;
+import org.graalvm.compiler.asm.amd64.AVXKind.AVXSize;
 import org.graalvm.compiler.core.common.LIRKind;
 import org.graalvm.compiler.core.common.NumUtil;
 import org.graalvm.compiler.core.common.calc.Condition;
@@ -61,7 +64,7 @@
 import org.graalvm.compiler.lir.LIRValueUtil;
 import org.graalvm.compiler.lir.LabelRef;
 import org.graalvm.compiler.lir.StandardOp.JumpOp;
-import org.graalvm.compiler.lir.StandardOp.SaveRegistersOp;
+import org.graalvm.compiler.lir.StandardOp.ZapRegistersOp;
 import org.graalvm.compiler.lir.SwitchStrategy;
 import org.graalvm.compiler.lir.Variable;
 import org.graalvm.compiler.lir.amd64.AMD64AddressValue;
@@ -94,6 +97,8 @@
 import org.graalvm.compiler.lir.amd64.AMD64StringUTF16CompressOp;
 import org.graalvm.compiler.lir.amd64.AMD64ZapRegistersOp;
 import org.graalvm.compiler.lir.amd64.AMD64ZapStackOp;
+import org.graalvm.compiler.lir.amd64.AMD64ZeroMemoryOp;
+import org.graalvm.compiler.lir.amd64.vector.AMD64VectorCompareOp;
 import org.graalvm.compiler.lir.gen.LIRGenerationResult;
 import org.graalvm.compiler.lir.gen.LIRGenerator;
 import org.graalvm.compiler.lir.hashing.Hasher;
@@ -404,17 +409,30 @@
         return result;
     }
 
+    private static AVXSize getRegisterSize(Value a) {
+        AMD64Kind kind = (AMD64Kind) a.getPlatformKind();
+        if (kind.isXMM()) {
+            return AVXKind.getRegisterSize(kind);
+        } else {
+            return AVXSize.XMM;
+        }
+    }
+
     private void emitIntegerTest(Value a, Value b) {
-        assert ((AMD64Kind) a.getPlatformKind()).isInteger();
-        OperandSize size = a.getPlatformKind() == AMD64Kind.QWORD ? QWORD : DWORD;
-        if (isJavaConstant(b) && NumUtil.is32bit(asJavaConstant(b).asLong())) {
-            append(new AMD64BinaryConsumer.ConstOp(AMD64MIOp.TEST, size, asAllocatable(a), (int) asJavaConstant(b).asLong()));
-        } else if (isJavaConstant(a) && NumUtil.is32bit(asJavaConstant(a).asLong())) {
-            append(new AMD64BinaryConsumer.ConstOp(AMD64MIOp.TEST, size, asAllocatable(b), (int) asJavaConstant(a).asLong()));
-        } else if (isAllocatableValue(b)) {
-            append(new AMD64BinaryConsumer.Op(AMD64RMOp.TEST, size, asAllocatable(b), asAllocatable(a)));
+        if (a.getPlatformKind().getVectorLength() > 1) {
+            append(new AMD64VectorCompareOp(VexRMOp.VPTEST, getRegisterSize(a), asAllocatable(a), asAllocatable(b)));
         } else {
-            append(new AMD64BinaryConsumer.Op(AMD64RMOp.TEST, size, asAllocatable(a), asAllocatable(b)));
+            assert ((AMD64Kind) a.getPlatformKind()).isInteger();
+            OperandSize size = a.getPlatformKind() == AMD64Kind.QWORD ? QWORD : DWORD;
+            if (isJavaConstant(b) && NumUtil.is32bit(asJavaConstant(b).asLong())) {
+                append(new AMD64BinaryConsumer.ConstOp(AMD64MIOp.TEST, size, asAllocatable(a), (int) asJavaConstant(b).asLong()));
+            } else if (isJavaConstant(a) && NumUtil.is32bit(asJavaConstant(a).asLong())) {
+                append(new AMD64BinaryConsumer.ConstOp(AMD64MIOp.TEST, size, asAllocatable(b), (int) asJavaConstant(a).asLong()));
+            } else if (isAllocatableValue(b)) {
+                append(new AMD64BinaryConsumer.Op(AMD64RMOp.TEST, size, asAllocatable(b), asAllocatable(a)));
+            } else {
+                append(new AMD64BinaryConsumer.Op(AMD64RMOp.TEST, size, asAllocatable(a), asAllocatable(b)));
+            }
         }
     }
 
@@ -547,27 +565,20 @@
     }
 
     @Override
-    public Variable emitArrayEquals(JavaKind kind, Value array1, Value array2, Value length, int constantLength, boolean directPointers) {
+    public Variable emitArrayEquals(JavaKind kind, Value array1, Value array2, Value length, boolean directPointers) {
         Variable result = newVariable(LIRKind.value(AMD64Kind.DWORD));
-        append(new AMD64ArrayEqualsOp(this, kind, kind, result, array1, array2, asAllocatable(length), constantLength, directPointers, getMaxVectorSize()));
+        append(new AMD64ArrayEqualsOp(this, kind, kind, result, array1, array2, length, directPointers, getMaxVectorSize()));
         return result;
     }
 
     @Override
-    public Variable emitArrayEquals(JavaKind kind1, JavaKind kind2, Value array1, Value array2, Value length, int constantLength, boolean directPointers) {
+    public Variable emitArrayEquals(JavaKind kind1, JavaKind kind2, Value array1, Value array2, Value length, boolean directPointers) {
         Variable result = newVariable(LIRKind.value(AMD64Kind.DWORD));
-        append(new AMD64ArrayEqualsOp(this, kind1, kind2, result, array1, array2, asAllocatable(length), constantLength, directPointers, getMaxVectorSize()));
+        append(new AMD64ArrayEqualsOp(this, kind1, kind2, result, array1, array2, length, directPointers, getMaxVectorSize()));
         return result;
     }
 
     /**
-     * Return a conservative estimate of the page size for use by the String.indexOf intrinsic.
-     */
-    protected int getVMPageSize() {
-        return 4096;
-    }
-
-    /**
      * Return the maximum size of vector registers used in SSE/AVX instructions.
      */
     protected int getMaxVectorSize() {
@@ -661,7 +672,7 @@
     }
 
     @Override
-    public SaveRegistersOp createZapRegisters(Register[] zappedRegisters, JavaConstant[] zapValues) {
+    public ZapRegistersOp createZapRegisters(Register[] zappedRegisters, JavaConstant[] zapValues) {
         return new AMD64ZapRegistersOp(zappedRegisters, zapValues);
     }
 
@@ -674,4 +685,11 @@
     public void emitSpeculationFence() {
         append(new AMD64LFenceOp());
     }
+
+    @Override
+    public void emitZeroMemory(Value address, Value length) {
+        RegisterValue lengthReg = AMD64.rcx.asValue(length.getValueKind());
+        emitMove(lengthReg, length);
+        append(new AMD64ZeroMemoryOp(asAddressValue(address), lengthReg));
+    }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LoweringProviderMixin.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LoweringProviderMixin.java	Wed Sep 25 22:40:41 2019 +0200
@@ -35,7 +35,7 @@
     }
 
     @Override
-    default boolean supportBulkZeroing() {
-        return true;
+    default int bulkZeroingStride() {
+        return 1;
     }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeMatchRules.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeMatchRules.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/Fields.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/Fields.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldsScanner.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldsScanner.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/GraalOptions.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/GraalOptions.java	Wed Sep 25 22:40:41 2019 +0200
@@ -63,7 +63,7 @@
     public static final OptionKey<Integer> MaximumInliningSize = new OptionKey<>(300);
 
     @Option(help = "If the previous low-level graph size of the method exceeds the threshold, it is not inlined.", type = OptionType.Expert)
-    public static final OptionKey<Integer> SmallCompiledLowLevelGraphSize = new OptionKey<>(300);
+    public static final OptionKey<Integer> SmallCompiledLowLevelGraphSize = new OptionKey<>(330);
 
     @Option(help = "", type = OptionType.Expert)
     public static final OptionKey<Double> LimitInlinedInvokes = new OptionKey<>(5.0);
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LIRKind.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LIRKind.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/SpeculativeExecutionAttacksMitigations.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/SpeculativeExecutionAttacksMitigations.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/CanonicalCondition.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/CanonicalCondition.java	Wed Sep 25 22:40:41 2019 +0200
@@ -51,4 +51,8 @@
     public boolean foldCondition(PrimitiveConstant lp, PrimitiveConstant rp, boolean unorderedIsTrue) {
         return asCondition().foldCondition(lp, rp, unorderedIsTrue);
     }
+
+    public boolean isUnsigned() {
+        return this == BT;
+    }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractBlockBase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractBlockBase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/CFGVerifier.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/CFGVerifier.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/Loop.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/Loop.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallsProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallsProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractObjectStamp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractObjectStamp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractPointerStamp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractPointerStamp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -112,14 +112,14 @@
         return pointer.asAlwaysNull();
     }
 
-    public Stamp asNonNull() {
+    public AbstractPointerStamp asNonNull() {
         if (isEmpty()) {
             return this;
         }
         return copyWith(true, false);
     }
 
-    public Stamp asMaybeNull() {
+    public AbstractPointerStamp asMaybeNull() {
         if (isEmpty()) {
             return this;
         }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/FloatStamp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/FloatStamp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IllegalStamp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IllegalStamp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IntegerStamp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IntegerStamp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/PrimitiveStamp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/PrimitiveStamp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/Stamp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/Stamp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/VoidStamp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/VoidStamp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeReader.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeReader.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeWriter.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeWriter.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeReader.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeReader.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsignedLong.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsignedLong.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/org/graalvm/compiler/core/match/processor/MatchProcessor.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/org/graalvm/compiler/core/match/processor/MatchProcessor.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRGenerator.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRGenerator.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -420,7 +420,7 @@
     }
 
     @Override
-    public Variable emitArrayEquals(JavaKind kind, Value array1, Value array2, Value length, int constantLength, boolean directPointers) {
+    public Variable emitArrayEquals(JavaKind kind, Value array1, Value array2, Value length, boolean directPointers) {
         Variable result = newVariable(LIRKind.value(SPARCKind.WORD));
         append(new SPARCArrayEqualsOp(this, kind, result, load(array1), load(array2), asAllocatable(length), directPointers));
         return result;
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeMatchRules.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeMatchRules.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SparcLoweringProviderMixin.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SparcLoweringProviderMixin.java	Wed Sep 25 22:40:41 2019 +0200
@@ -35,7 +35,7 @@
     }
 
     @Override
-    default boolean supportBulkZeroing() {
-        return false;
+    default int bulkZeroingStride() {
+        return 0;
     }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BasePhaseBinaryGraphTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BasePhaseBinaryGraphTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CanonicalizedConversionTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CanonicalizedConversionTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CheckGraalInvariants.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CheckGraalInvariants.java	Wed Sep 25 22:40:41 2019 +0200
@@ -77,6 +77,8 @@
 import org.graalvm.compiler.phases.util.Providers;
 import org.graalvm.compiler.runtime.RuntimeProvider;
 import org.graalvm.compiler.serviceprovider.JavaVersionUtil;
+import org.graalvm.compiler.test.AddExports;
+import org.graalvm.compiler.test.ModuleSupport;
 import jdk.internal.vm.compiler.word.LocationIdentity;
 import org.junit.Assert;
 import org.junit.Assume;
@@ -98,8 +100,15 @@
  * global invariants such as using {@link Object#equals(Object)} to compare certain types instead of
  * identity comparisons.
  */
+@AddExports("jdk.internal.vm.ci/*=jdk.aot")
 public class CheckGraalInvariants extends GraalCompilerTest {
 
+    /**
+     * Magic token to denote the classes in the Java runtime image (i.e. in the {@code jrt:/} file
+     * system).
+     */
+    public static final String JRT_CLASS_PATH_ENTRY = "<jrt>";
+
     private static boolean shouldVerifyEquals(ResolvedJavaMethod m) {
         if (m.getName().equals("identityEquals")) {
             ResolvedJavaType c = m.getDeclaringClass();
@@ -119,6 +128,9 @@
     public static class InvariantsTool {
 
         protected boolean shouldProcess(String classpathEntry) {
+            if (classpathEntry.equals(JRT_CLASS_PATH_ENTRY)) {
+                return true;
+            }
             if (classpathEntry.endsWith(".jar")) {
                 String name = new File(classpathEntry).getName();
                 return name.contains("jvmci") || name.contains("graal") || name.contains("jdk.internal.vm.compiler");
@@ -131,7 +143,7 @@
             if (JavaVersionUtil.JAVA_SPEC <= 8) {
                 bootclasspath = System.getProperty("sun.boot.class.path");
             } else {
-                bootclasspath = System.getProperty("jdk.module.path") + File.pathSeparatorChar + System.getProperty("jdk.module.upgrade.path");
+                bootclasspath = JRT_CLASS_PATH_ENTRY;
             }
             return bootclasspath;
         }
@@ -208,19 +220,8 @@
         for (String path : bootclasspath.split(File.pathSeparator)) {
             if (tool.shouldProcess(path)) {
                 try {
-                    final ZipFile zipFile = new ZipFile(new File(path));
-                    for (final Enumeration<? extends ZipEntry> entry = zipFile.entries(); entry.hasMoreElements();) {
-                        final ZipEntry zipEntry = entry.nextElement();
-                        String name = zipEntry.getName();
-                        if (name.endsWith(".class") && !name.startsWith("META-INF/versions/")) {
-                            String className = name.substring(0, name.length() - ".class".length()).replace('/', '.');
-                            if (isInNativeImage(className)) {
-                                /*
-                                 * Native Image is an external tool and does not need to follow the
-                                 * Graal invariants.
-                                 */
-                                continue;
-                            }
+                    if (path.equals(JRT_CLASS_PATH_ENTRY)) {
+                        for (String className : ModuleSupport.getJRTGraalClassNames()) {
                             if (isGSON(className)) {
                                 /*
                                  * GSON classes are compiled with old JDK
@@ -229,6 +230,29 @@
                             }
                             classNames.add(className);
                         }
+                    } else {
+                        final ZipFile zipFile = new ZipFile(new File(path));
+                        for (final Enumeration<? extends ZipEntry> entry = zipFile.entries(); entry.hasMoreElements();) {
+                            final ZipEntry zipEntry = entry.nextElement();
+                            String name = zipEntry.getName();
+                            if (name.endsWith(".class") && !name.startsWith("META-INF/versions/")) {
+                                String className = name.substring(0, name.length() - ".class".length()).replace('/', '.');
+                                if (isInNativeImage(className)) {
+                                    /*
+                                     * Native Image is an external tool and does not need to follow
+                                     * the Graal invariants.
+                                     */
+                                    continue;
+                                }
+                                if (isGSON(className)) {
+                                    /*
+                                     * GSON classes are compiled with old JDK
+                                     */
+                                    continue;
+                                }
+                                classNames.add(className);
+                            }
+                        }
                     }
                 } catch (IOException ex) {
                     Assert.fail(ex.toString());
@@ -314,8 +338,12 @@
 
                 ResolvedJavaType type = metaAccess.lookupJavaType(c);
                 List<ResolvedJavaMethod> methods = new ArrayList<>();
-                methods.addAll(Arrays.asList(type.getDeclaredMethods()));
-                methods.addAll(Arrays.asList(type.getDeclaredConstructors()));
+                try {
+                    methods.addAll(Arrays.asList(type.getDeclaredMethods()));
+                    methods.addAll(Arrays.asList(type.getDeclaredConstructors()));
+                } catch (Throwable e) {
+                    errors.add(String.format("Error while checking %s:%n%s", className, printStackTraceToString(e)));
+                }
                 ResolvedJavaMethod clinit = type.getClassInitializer();
                 if (clinit != null) {
                     methods.add(clinit);
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest2.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest2.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest3.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest3.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest10.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest10.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest13.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest13.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest14.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest14.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest15.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest15.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest2.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest2.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTestBase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTestBase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalNodeTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalNodeTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CopyOfVirtualizationTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CopyOfVirtualizationTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CountedLoopTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CountedLoopTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -70,21 +70,24 @@
     /**
      * Get a property of an induction variable.
      */
-    private static int get(@SuppressWarnings("unused") IVProperty property, @SuppressWarnings("unused") StaticIVProperty staticProperty, @SuppressWarnings("unused") IVPredicate constantCheck,
-                    int iv) {
+    @SuppressWarnings("unused")
+    private static int get(IVProperty property, StaticIVProperty staticProperty, IVPredicate constantCheck, int iv) {
         return iv;
     }
 
-    private static int get(@SuppressWarnings("unused") IVProperty property, int iv) {
+    @SuppressWarnings("unused")
+    private static int get(IVProperty property, int iv) {
         return iv;
     }
 
-    private static long get(@SuppressWarnings("unused") IVProperty property, @SuppressWarnings("unused") StaticIVProperty staticProperty, @SuppressWarnings("unused") IVPredicate constantCheck,
+    @SuppressWarnings("unused")
+    private static long get(IVProperty property, StaticIVProperty staticProperty, IVPredicate constantCheck,
                     long iv) {
         return iv;
     }
 
-    private static long get(@SuppressWarnings("unused") IVProperty property, long iv) {
+    @SuppressWarnings("unused")
+    private static long get(IVProperty property, long iv) {
         return iv;
     }
 
@@ -150,12 +153,12 @@
 
     @Test
     public void increment5() {
-        testCounted("incrementSnippet", 256, 256, 1);
+        testRemovableCounted("incrementSnippet", 256, 256, 1);
     }
 
     @Test
     public void increment6() {
-        testCounted("incrementSnippet", 257, 256, 1);
+        testRemovableCounted("incrementSnippet", 257, 256, 1);
     }
 
     @Test
@@ -207,7 +210,7 @@
 
     @Test
     public void incrementEq6() {
-        testCounted("incrementEqSnippet", 257, 256, 1);
+        testRemovableCounted("incrementEqSnippet", 257, 256, 1);
     }
 
     @Test
@@ -220,6 +223,16 @@
         testCounted("incrementEqSnippet", -10, Integer.MAX_VALUE - 2, 2);
     }
 
+    @Test
+    public void incrementEq9() {
+        testCounted("incrementEqSnippet", 0, 0, 1);
+    }
+
+    @Test
+    public void incrementEq10() {
+        testCounted("incrementEqSnippet", 0, 0, 3);
+    }
+
     public static Result decrementSnippet(int start, int limit, int step) {
         int i;
         int dec = ((step - 1) & 0xFFFF) + 1; // make sure this value is always strictly positive
@@ -286,7 +299,7 @@
 
     @Test
     public void decrementEq4() {
-        testCounted("decrementEqSnippet", -10, 0, Integer.MAX_VALUE);
+        testRemovableCounted("decrementEqSnippet", -10, 0, Integer.MAX_VALUE);
     }
 
     @Test
@@ -299,6 +312,16 @@
         testCounted("decrementEqSnippet", Integer.MAX_VALUE, -10, 2);
     }
 
+    @Test
+    public void decrementEq7() {
+        testCounted("decrementEqSnippet", 10, 10, 1);
+    }
+
+    @Test
+    public void decrementEq8() {
+        testCounted("decrementEqSnippet", 10, 10, 3);
+    }
+
     public static Result twoVariablesSnippet() {
         Result ret = new Result();
         int j = 0;
@@ -384,45 +407,175 @@
 
     @Test
     public void incrementLong5() {
-        testCounted("incrementLongSnippet", 256L, 256L, 1L);
+        testRemovableCounted("incrementLongSnippet", 256L, 256L, 1L);
     }
 
     @Test
     public void incrementLong6() {
-        testCounted("incrementLongSnippet", 257L, 256L, 1L);
+        testRemovableCounted("incrementLongSnippet", 257L, 256L, 1L);
+    }
+
+    public static Result incrementUnsignedSnippet(int start, int limit, int step) {
+        int i;
+        int inc = ((step - 1) & 0xFFFF) + 1; // make sure this value is always strictly positive
+        Result ret = new Result();
+        for (i = start; Integer.compareUnsigned(i, limit) < 0; i += inc) {
+            GraalDirectives.controlFlowAnchor();
+            ret.extremum = get(InductionVariable::extremumNode, InductionVariable::constantExtremum, InductionVariable::isConstantExtremum, i);
+        }
+        ret.exitValue = get(InductionVariable::exitValueNode, i);
+        return ret;
+    }
+
+    @Test
+    public void incrementUnsigned1() {
+        testCounted("incrementUnsignedSnippet", 0, 256, 1);
+    }
+
+    @Test
+    public void incrementUnsigned2() {
+        testCounted("incrementUnsignedSnippet", 0, 256, 2);
+    }
+
+    @Test
+    public void incrementUnsigned3() {
+        testCounted("incrementUnsignedSnippet", 0, 256, 3);
+    }
+
+    @Test
+    public void incrementUnsigned4() {
+        testCounted("incrementUnsignedSnippet", 1, Integer.MAX_VALUE + 10, Integer.MAX_VALUE);
+    }
+
+    @Test
+    public void incrementUnsigned5() {
+        testRemovableCounted("incrementUnsignedSnippet", 256, 256, 1);
+    }
+
+    @Test
+    public void incrementUnsigned6() {
+        testRemovableCounted("incrementUnsignedSnippet", 257, 256, 1);
+    }
+
+    @Test
+    public void incrementUnsigned7() {
+        testCounted("incrementUnsignedSnippet", 0, Integer.MAX_VALUE + 10, 1);
+    }
+
+    @Test
+    public void incrementUnsigned8a() {
+        testCounted("incrementUnsignedSnippet", 0, Integer.MAX_VALUE + 11, 2);
+    }
+
+    @Test
+    public void incrementUnsigned8b() {
+        testCounted("incrementUnsignedSnippet", 0, Integer.MAX_VALUE + 10, 2);
+    }
+
+    @Test
+    public void incrementUnsigned9() {
+        testCounted("incrementUnsignedSnippet", Integer.MAX_VALUE - 1, Integer.MAX_VALUE + 10, 1);
+    }
+
+    @Test
+    public void incrementUnsigned10() {
+        testCounted("incrementUnsignedSnippet", Integer.MAX_VALUE - 1, Integer.MAX_VALUE + 10, 2);
+    }
+
+    public static Result decrementUnsignedSnippet(int start, int limit, int step) {
+        int dec = ((step - 1) & 0xFFFF) + 1; // make sure this value is always strictly positive
+        Result ret = new Result();
+        int i;
+        for (i = start; Integer.compareUnsigned(i, limit) > 0; i -= dec) {
+            GraalDirectives.controlFlowAnchor();
+            ret.extremum = get(InductionVariable::extremumNode, InductionVariable::constantExtremum, InductionVariable::isConstantExtremum, i);
+        }
+        ret.exitValue = get(InductionVariable::exitValueNode, i);
+        return ret;
+    }
+
+    @Test
+    public void decrementUnsigned1() {
+        testCounted("decrementUnsignedSnippet", 256, 0, 1);
+    }
+
+    @Test
+    public void decrementUnsigned2() {
+        testCounted("decrementUnsignedSnippet", 256, 0, 2);
+    }
+
+    @Test
+    public void decrementUnsigned3() {
+        testCounted("decrementUnsignedSnippet", 256, 2, 3);
+    }
+
+    @Test
+    public void decrementUnsigned5() {
+        testRemovableCounted("decrementUnsignedSnippet", 256, 256, 1);
+    }
+
+    @Test
+    public void decrementUnsigned6() {
+        testRemovableCounted("decrementUnsignedSnippet", 256, 257, 1);
+    }
+
+    @Test
+    public void decrementUnsigned7() {
+        testCounted("decrementUnsignedSnippet", Integer.MAX_VALUE + 10, 0, 1);
+    }
+
+    @Test
+    public void decrementUnsigned8() {
+        testCounted("decrementUnsignedSnippet", Integer.MAX_VALUE + 11, 0, 2);
+    }
+
+    @Test
+    public void decrementUnsigned9() {
+        testCounted("decrementUnsignedSnippet", Integer.MAX_VALUE + 10, Integer.MAX_VALUE - 1, 1);
+    }
+
+    @Test
+    public void decrementUnsigned10() {
+        testCounted("decrementUnsignedSnippet", Integer.MAX_VALUE + 10, Integer.MAX_VALUE - 1, 2);
     }
 
     @NodeInfo(cycles = CYCLES_IGNORED, size = SIZE_IGNORED)
     private static class IVPropertyNode extends FloatingNode implements LIRLowerable {
-
         public static final NodeClass<IVPropertyNode> TYPE = NodeClass.create(IVPropertyNode.class);
 
         private final IVProperty property;
         private final StaticIVProperty staticProperty;
         private final IVPredicate staticCheck;
+        private final boolean loopCanBeRemoved;
         @Input private ValueNode iv;
 
-        protected IVPropertyNode(IVProperty property, StaticIVProperty staticProperty, IVPredicate staticCheck, ValueNode iv) {
+        protected IVPropertyNode(IVProperty property, StaticIVProperty staticProperty, IVPredicate staticCheck, ValueNode iv, boolean loopCanBeRemoved) {
             super(TYPE, iv.stamp(NodeView.DEFAULT).unrestricted());
             this.property = property;
             this.staticProperty = staticProperty;
             this.staticCheck = staticCheck;
             this.iv = iv;
+            this.loopCanBeRemoved = loopCanBeRemoved;
         }
 
         public void rewrite(LoopsData loops) {
             InductionVariable inductionVariable = loops.getInductionVariable(iv);
-            assert inductionVariable != null;
-            assertTrue(inductionVariable.getLoop().isCounted(), "must be counted");
             ValueNode node = null;
-            if (staticCheck != null) {
-                assert staticProperty != null;
-                if (staticCheck.test(inductionVariable)) {
-                    node = ConstantNode.forLong(staticProperty.get(inductionVariable), graph());
+            if (inductionVariable == null) {
+                assert loopCanBeRemoved;
+                assert loops.loops().isEmpty();
+                node = iv;
+            } else {
+                assertTrue(inductionVariable.getLoop().isCounted(), "must be counted");
+                if (staticCheck != null) {
+                    assert staticProperty != null;
+                    if (staticCheck.test(inductionVariable)) {
+                        node = ConstantNode.forLong(staticProperty.get(inductionVariable), graph());
+                    }
                 }
-            }
-            if (node == null) {
-                node = property.get(inductionVariable);
+                if (node == null) {
+                    node = property.get(inductionVariable);
+                }
             }
             replaceAtUsagesAndDelete(node);
         }
@@ -450,7 +603,7 @@
                     property = getSnippetReflection().asObject(IVProperty.class, arg1.asJavaConstant());
                 }
                 if (property != null) {
-                    b.addPush(ivKind, new IVPropertyNode(property, null, null, arg2));
+                    b.addPush(ivKind, new IVPropertyNode(property, null, null, arg2, loopCanBeRemoved));
                     return true;
                 } else {
                     return false;
@@ -473,7 +626,7 @@
                     staticCheck = getSnippetReflection().asObject(IVPredicate.class, arg3.asJavaConstant());
                 }
                 if (property != null && staticProperty != null && staticCheck != null) {
-                    b.addPush(ivKind, new IVPropertyNode(property, staticProperty, staticCheck, arg4));
+                    b.addPush(ivKind, new IVPropertyNode(property, staticProperty, staticCheck, arg4, loopCanBeRemoved));
                     return true;
                 } else {
                     return false;
@@ -499,6 +652,7 @@
     }
 
     private Object[] argsToBind;
+    private boolean loopCanBeRemoved;
 
     @Override
     protected Object[] getArgumentToBind() {
@@ -506,9 +660,32 @@
     }
 
     public void testCounted(String snippetName, Object... args) {
+        this.loopCanBeRemoved = false;
         test(snippetName, args);
-        argsToBind = args;
+        this.argsToBind = args;
         test(snippetName, args);
-        argsToBind = null;
+        this.argsToBind = null;
+    }
+
+    public void testCounted(String snippetName, Object start, Object limit, Object step) {
+        testCounted(false, snippetName, start, limit, step);
+    }
+
+    public void testRemovableCounted(String snippetName, Object start, Object limit, Object step) {
+        testCounted(true, snippetName, start, limit, step);
+    }
+
+    public void testCounted(boolean removable, String snippetName, Object start, Object limit, Object step) {
+        this.loopCanBeRemoved = removable;
+        Object[] args = {start, limit, step};
+        test(snippetName, args);
+        this.argsToBind = args;
+        test(snippetName, args);
+        this.argsToBind = new Object[]{NO_BIND, NO_BIND, step};
+        test(snippetName, args);
+        this.argsToBind = new Object[]{start, NO_BIND, step};
+        test(snippetName, args);
+        this.argsToBind = null;
+        this.loopCanBeRemoved = false;
     }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CustomizedBytecodePatternTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CustomizedBytecodePatternTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -58,7 +58,7 @@
                 loadedClass = (Class<?>) defineClass.invoke(lookUp, gen);
             }
         } catch (Exception e) {
-            throw new ClassNotFoundException();
+            throw new ClassNotFoundException(className, e);
         }
         return loadedClass;
     }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DumpPathTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DumpPathTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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 java.nio.file.DirectoryStream;
 import java.nio.file.Files;
 import java.nio.file.Path;
+import java.nio.file.Paths;
 
 import jdk.internal.vm.compiler.collections.EconomicMap;
 import org.graalvm.compiler.debug.DebugOptions;
@@ -49,22 +50,20 @@
     @Test
     public void testDump() throws IOException {
         assumeManagementLibraryIsLoadable();
-        Path dumpDirectoryPath = Files.createTempDirectory("DumpPathTest");
-        String[] extensions = new String[]{".cfg", ".bgv", ".graph-strings"};
-        EconomicMap<OptionKey<?>, Object> overrides = OptionValues.newOptionMap();
-        overrides.put(DebugOptions.DumpPath, dumpDirectoryPath.toString());
-        overrides.put(DebugOptions.PrintCFG, true);
-        overrides.put(DebugOptions.PrintGraph, PrintGraphTarget.File);
-        overrides.put(DebugOptions.PrintCanonicalGraphStrings, true);
-        overrides.put(DebugOptions.Dump, "*");
+        try (TemporaryDirectory temp = new TemporaryDirectory(Paths.get("."), "DumpPathTest")) {
+            String[] extensions = new String[]{".cfg", ".bgv", ".graph-strings"};
+            EconomicMap<OptionKey<?>, Object> overrides = OptionValues.newOptionMap();
+            overrides.put(DebugOptions.DumpPath, temp.toString());
+            overrides.put(DebugOptions.PrintCFG, true);
+            overrides.put(DebugOptions.PrintGraph, PrintGraphTarget.File);
+            overrides.put(DebugOptions.PrintCanonicalGraphStrings, true);
+            overrides.put(DebugOptions.Dump, "*");
 
-        // Generate dump files.
-        test(new OptionValues(getInitialOptions(), overrides), "snippet");
-        // Check that IGV files got created, in the right place.
-        checkForFiles(dumpDirectoryPath, extensions);
-
-        // Clean up the generated files.
-        removeDirectory(dumpDirectoryPath);
+            // Generate dump files.
+            test(new OptionValues(getInitialOptions(), overrides), "snippet");
+            // Check that IGV files got created, in the right place.
+            checkForFiles(temp.path, extensions);
+        }
     }
 
     /**
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/EnumSwitchTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/EnumSwitchTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -24,8 +24,6 @@
 
 package org.graalvm.compiler.core.test;
 
-import org.junit.Test;
-
 import org.graalvm.compiler.nodes.StructuredGraph;
 import org.graalvm.compiler.nodes.extended.IntegerSwitchNode;
 import org.graalvm.compiler.nodes.java.LoadIndexedNode;
@@ -33,6 +31,8 @@
 import org.graalvm.compiler.phases.Phase;
 import org.graalvm.compiler.phases.common.RemoveValueProxyPhase;
 import org.graalvm.compiler.phases.tiers.Suites;
+import org.junit.Assume;
+import org.junit.Test;
 
 public class EnumSwitchTest extends GraalCompilerTest {
 
@@ -145,6 +145,7 @@
         ret.getHighTier().prependPhase(new Phase() {
             @Override
             protected void run(StructuredGraph graph) {
+                Assume.assumeTrue(graph.getNodes().filter(LoadIndexedNode.class).first().array().isConstant());
                 /* Array load from the enum switch map. */
                 assertTrue(graph.getNodes().filter(LoadIndexedNode.class).count() == 1);
                 /* The actual switch. */
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FinalizableSubclassTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FinalizableSubclassTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueConcreteMethodBugTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueConcreteMethodBugTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatingReadTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatingReadTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -43,6 +43,7 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.EnumMap;
+import java.util.HashMap;
 import java.util.List;
 import java.util.ListIterator;
 import java.util.Map;
@@ -62,7 +63,6 @@
 import org.graalvm.compiler.core.target.Backend;
 import org.graalvm.compiler.debug.DebugContext;
 import org.graalvm.compiler.debug.DebugDumpHandler;
-import org.graalvm.compiler.debug.DebugDumpScope;
 import org.graalvm.compiler.debug.DebugHandlersFactory;
 import org.graalvm.compiler.debug.GraalError;
 import org.graalvm.compiler.debug.TTY;
@@ -74,6 +74,7 @@
 import org.graalvm.compiler.java.GraphBuilderPhase;
 import org.graalvm.compiler.lir.asm.CompilationResultBuilderFactory;
 import org.graalvm.compiler.lir.phases.LIRSuites;
+import org.graalvm.compiler.loop.phases.ConvertDeoptimizeToGuardPhase;
 import org.graalvm.compiler.nodeinfo.NodeInfo;
 import org.graalvm.compiler.nodeinfo.NodeSize;
 import org.graalvm.compiler.nodeinfo.Verbosity;
@@ -111,7 +112,6 @@
 import org.graalvm.compiler.phases.Phase;
 import org.graalvm.compiler.phases.PhaseSuite;
 import org.graalvm.compiler.phases.common.CanonicalizerPhase;
-import org.graalvm.compiler.loop.phases.ConvertDeoptimizeToGuardPhase;
 import org.graalvm.compiler.phases.common.inlining.InliningPhase;
 import org.graalvm.compiler.phases.common.inlining.info.InlineInfo;
 import org.graalvm.compiler.phases.common.inlining.policy.GreedyInliningPolicy;
@@ -124,12 +124,12 @@
 import org.graalvm.compiler.phases.util.Providers;
 import org.graalvm.compiler.printer.GraalDebugHandlersFactory;
 import org.graalvm.compiler.runtime.RuntimeProvider;
-import org.graalvm.compiler.serviceprovider.JavaVersionUtil;
 import org.graalvm.compiler.test.AddExports;
 import org.graalvm.compiler.test.GraalTest;
-import org.graalvm.compiler.test.JLModule;
+import org.graalvm.compiler.test.ModuleSupport;
 import org.junit.After;
 import org.junit.Assert;
+import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.internal.AssumptionViolatedException;
 
@@ -195,9 +195,7 @@
      * as of JDK 9.
      */
     protected final void exportPackage(Class<?> moduleMember, String packageName) {
-        if (JavaVersionUtil.JAVA_SPEC > 8) {
-            JLModule.exportPackageTo(moduleMember, packageName, getClass());
-        }
+        ModuleSupport.exportPackageTo(moduleMember, packageName, getClass());
     }
 
     /**
@@ -344,6 +342,13 @@
         return ret;
     }
 
+    private static final ThreadLocal<HashMap<ResolvedJavaMethod, InstalledCode>> cache = ThreadLocal.withInitial(HashMap::new);
+
+    @BeforeClass
+    public static void resetCache() {
+        cache.get().clear();
+    }
+
     public GraalCompilerTest() {
         this.backend = Graal.getRequiredCapability(RuntimeProvider.class).getHostBackend();
         this.providers = getBackend().getProviders();
@@ -923,8 +928,6 @@
         }
     }
 
-    private Map<ResolvedJavaMethod, InstalledCode> cache = new ConcurrentHashMap<>();
-
     /**
      * Gets installed code for a given method, compiling it first if necessary. The graph is parsed
      * {@link #parseEager eagerly}.
@@ -976,7 +979,7 @@
     protected InstalledCode getCode(final ResolvedJavaMethod installedCodeOwner, StructuredGraph graph, boolean forceCompile, boolean installAsDefault, OptionValues options) {
         boolean useCache = !forceCompile && getArgumentToBind() == null;
         if (useCache && graph == null) {
-            InstalledCode cached = cache.get(installedCodeOwner);
+            InstalledCode cached = cache.get().get(installedCodeOwner);
             if (cached != null) {
                 if (cached.isValid()) {
                     return cached;
@@ -991,7 +994,7 @@
             StructuredGraph graphToCompile = graph == null ? parseForCompile(installedCodeOwner, id, options) : graph;
             DebugContext debug = graphToCompile.getDebug();
 
-            try (AllocSpy spy = AllocSpy.open(installedCodeOwner); DebugContext.Scope ds = debug.scope("Compiling", new DebugDumpScope(id.toString(CompilationIdentifier.Verbosity.ID), true))) {
+            try (AllocSpy spy = AllocSpy.open(installedCodeOwner); DebugContext.Scope ds = debug.scope("Compiling", graph)) {
                 CompilationPrinter printer = CompilationPrinter.begin(options, id, installedCodeOwner, INVOCATION_ENTRY_BCI);
                 CompilationResult compResult = compile(installedCodeOwner, graphToCompile, new CompilationResult(graphToCompile.compilationId()), id, options);
                 printer.finish(compResult);
@@ -1023,7 +1026,7 @@
             }
 
             if (useCache) {
-                cache.put(installedCodeOwner, installedCode);
+                cache.get().put(installedCodeOwner, installedCode);
             }
             return installedCode;
         }
@@ -1322,6 +1325,8 @@
         }
     }
 
+    protected static final Object NO_BIND = new Object();
+
     protected void bindArguments(StructuredGraph graph, Object[] argsToBind) {
         ResolvedJavaMethod m = graph.method();
         Object receiver = isStatic(m.getModifiers()) ? null : this;
@@ -1329,9 +1334,12 @@
         JavaType[] parameterTypes = m.toParameterTypes();
         assert parameterTypes.length == args.length;
         for (ParameterNode param : graph.getNodes(ParameterNode.TYPE)) {
-            JavaConstant c = getSnippetReflection().forBoxed(parameterTypes[param.index()].getJavaKind(), args[param.index()]);
-            ConstantNode replacement = ConstantNode.forConstant(c, getMetaAccess(), graph);
-            param.replaceAtUsages(replacement);
+            Object arg = args[param.index()];
+            if (arg != NO_BIND) {
+                JavaConstant c = getSnippetReflection().forBoxed(parameterTypes[param.index()].getJavaKind(), arg);
+                ConstantNode replacement = ConstantNode.forConstant(c, getMetaAccess(), graph);
+                param.replaceAtUsages(replacement);
+            }
         }
     }
 
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphEncoderTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphEncoderTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphPrinterTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,55 @@
+/*
+ * 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 org.graalvm.compiler.core.test;
+
+import org.graalvm.compiler.printer.CanonicalStringGraphPrinter;
+import org.junit.Test;
+
+import jdk.vm.ci.meta.JavaConstant;
+
+/**
+ * Tests related to graph printing.
+ */
+public class GraphPrinterTest extends GraalCompilerTest {
+
+    /**
+     * Tests that a self-recursive object does not cause stack overflow when formatted as a string.
+     */
+    @Test
+    public void testGraphPrinterDoesNotStackOverflow() {
+        CanonicalStringGraphPrinter printer = new CanonicalStringGraphPrinter(getSnippetReflection());
+        Object[] topArray = {null};
+        Object[] parent = topArray;
+        Object[] lastArray = null;
+        for (int i = 0; i < 5; i++) {
+            lastArray = new Object[1];
+            parent[0] = lastArray;
+            parent = lastArray;
+        }
+        lastArray[0] = topArray;
+        JavaConstant constant = getSnippetReflection().forObject(topArray);
+        printer.format(constant);
+    }
+}
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphResetDebugTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphResetDebugTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardPrioritiesTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardPrioritiesTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfCanonicalizerTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfCanonicalizerTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ImplicitNullCheckTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ImplicitNullCheckTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerEqualsCanonicalizerTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerEqualsCanonicalizerTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LockEliminationTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LockEliminationTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopFullUnrollTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopFullUnrollTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopUnswitchTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopUnswitchTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MergeCanonicalizerTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MergeCanonicalizerTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NestedLoopTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NestedLoopTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NewInstanceTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NewInstanceTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePropertiesTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePropertiesTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OptionsVerifierTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OptionsVerifierTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -26,30 +26,19 @@
 
 import static java.lang.String.format;
 
-import java.io.ByteArrayOutputStream;
-import java.io.File;
 import java.io.IOException;
-import java.io.InputStream;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Executable;
 import java.lang.reflect.Method;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.nio.file.Files;
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
 import java.util.Set;
 
 import org.graalvm.compiler.options.OptionDescriptor;
 import org.graalvm.compiler.options.OptionDescriptors;
 import org.graalvm.compiler.options.OptionKey;
 import org.graalvm.compiler.options.OptionsParser;
-import org.graalvm.compiler.serviceprovider.JavaVersionUtil;
+import org.graalvm.compiler.serviceprovider.GraalServices;
 import org.junit.Test;
 import org.objectweb.asm.ClassReader;
 import org.objectweb.asm.ClassVisitor;
@@ -67,87 +56,26 @@
 
     @Test
     public void verifyOptions() throws IOException {
-        try (Classpath cp = new Classpath()) {
-            HashSet<Class<?>> checked = new HashSet<>();
-            for (OptionDescriptors opts : OptionsParser.getOptionsLoader()) {
-                for (OptionDescriptor desc : opts) {
-                    OptionsVerifier.checkClass(desc.getDeclaringClass(), desc, checked, cp);
-                }
-            }
-        }
-    }
-
-    static class Classpath implements AutoCloseable {
-        private final Map<String, Object> entries = new LinkedHashMap<>();
-
-        Classpath() throws IOException {
-            List<String> names = new ArrayList<>(Arrays.asList(System.getProperty("java.class.path").split(File.pathSeparator)));
-            if (JavaVersionUtil.JAVA_SPEC <= 8) {
-                names.addAll(Arrays.asList(System.getProperty("sun.boot.class.path").split(File.pathSeparator)));
-            } else {
-                names.addAll(Arrays.asList(System.getProperty("jdk.module.path").split(File.pathSeparator)));
-            }
-            for (String n : names) {
-                File path = new File(n);
-                if (path.exists()) {
-                    if (path.isDirectory()) {
-                        entries.put(n, path);
-                    } else if (n.endsWith(".jar") || n.endsWith(".zip")) {
-                        URL url = new URL("jar", "", "file:" + n + "!/");
-                        entries.put(n, new URLClassLoader(new URL[]{url}));
-                    }
-                }
+        HashSet<Class<?>> checked = new HashSet<>();
+        for (OptionDescriptors opts : OptionsParser.getOptionsLoader()) {
+            for (OptionDescriptor desc : opts) {
+                OptionsVerifier.checkClass(desc.getDeclaringClass(), desc, checked);
             }
         }
-
-        @Override
-        public void close() throws IOException {
-            for (Object e : entries.values()) {
-                if (e instanceof URLClassLoader) {
-                    ((URLClassLoader) e).close();
-                }
-            }
-        }
-
-        public byte[] getInputStream(String classFilePath) throws IOException {
-            for (Object e : entries.values()) {
-                if (e instanceof File) {
-                    File path = new File((File) e, classFilePath.replace('/', File.separatorChar));
-                    if (path.exists()) {
-                        return Files.readAllBytes(path.toPath());
-                    }
-                } else {
-                    assert e instanceof URLClassLoader;
-                    URLClassLoader ucl = (URLClassLoader) e;
-                    try (InputStream in = ucl.getResourceAsStream(classFilePath)) {
-                        if (in != null) {
-                            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
-                            int nRead;
-                            byte[] data = new byte[1024];
-                            while ((nRead = in.read(data, 0, data.length)) != -1) {
-                                buffer.write(data, 0, nRead);
-                            }
-                            return buffer.toByteArray();
-                        }
-                    }
-                }
-            }
-            return null;
-        }
     }
 
     static final class OptionsVerifier extends ClassVisitor {
 
-        public static void checkClass(Class<?> cls, OptionDescriptor option, Set<Class<?>> checked, Classpath cp) throws IOException {
+        public static void checkClass(Class<?> cls, OptionDescriptor option, Set<Class<?>> checked) throws IOException {
             if (!checked.contains(cls)) {
                 checked.add(cls);
                 Class<?> superclass = cls.getSuperclass();
                 if (superclass != null && !superclass.equals(Object.class)) {
-                    checkClass(superclass, option, checked, cp);
+                    checkClass(superclass, option, checked);
                 }
 
-                String classFilePath = cls.getName().replace('.', '/') + ".class";
-                ClassReader cr = new ClassReader(Objects.requireNonNull(cp.getInputStream(classFilePath), "Could not find class file for " + cls.getName()));
+                GraalServices.getClassfileAsStream(cls);
+                ClassReader cr = new ClassReader(GraalServices.getClassfileAsStream(cls));
 
                 ClassVisitor cv = new OptionsVerifier(cls, option);
                 cr.accept(cv, 0);
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushNodesThroughPiTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushNodesThroughPiTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushThroughIfTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushThroughIfTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReadAfterCheckCastTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReadAfterCheckCastTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReassociateAndCanonicalTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReassociateAndCanonicalTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReferenceGetLoopTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReferenceGetLoopTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ScalarTypeSystemTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ScalarTypeSystemTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest2.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest2.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StampCanonicalizerTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StampCanonicalizerTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StraighteningTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StraighteningTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubprocessTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,63 @@
+/*
+ * 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 org.graalvm.compiler.core.test;
+
+import static org.graalvm.compiler.test.SubprocessUtil.getVMCommandLine;
+import static org.graalvm.compiler.test.SubprocessUtil.java;
+import static org.graalvm.compiler.test.SubprocessUtil.withoutDebuggerArguments;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.graalvm.compiler.test.SubprocessUtil;
+import org.junit.Assume;
+import org.junit.Before;
+
+public abstract class SubprocessTest extends GraalCompilerTest {
+
+    @Before
+    public void checkJavaAgent() {
+        Assume.assumeFalse("Java Agent found -> skipping", SubprocessUtil.isJavaAgentAttached());
+    }
+
+    public void launchSubprocess(Runnable runnable) throws InterruptedException, IOException {
+        String recursionPropName = getClass().getSimpleName() + ".Subprocess";
+        if (Boolean.getBoolean(recursionPropName)) {
+            runnable.run();
+        } else {
+            List<String> vmArgs = withoutDebuggerArguments(getVMCommandLine());
+            vmArgs.addAll(SubprocessUtil.getPackageOpeningOptions());
+            vmArgs.add("-D" + recursionPropName + "=true");
+            configSubprocess(vmArgs);
+            SubprocessUtil.Subprocess proc = java(vmArgs, "com.oracle.mxtool.junit.MxJUnitWrapper", getClass().getName());
+            assertTrue(proc.exitCode == 0, proc.toString() + " failed with exit code " + proc.exitCode);
+        }
+    }
+
+    @SuppressWarnings("unused")
+    public void configSubprocess(List<String> vmArgs) {
+    }
+
+}
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SwitchCanonicalizerTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SwitchCanonicalizerTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -120,7 +120,7 @@
     private void shouldFoldSwitch(String methodName) {
         StructuredGraph graph = parseForCompile(getResolvedJavaMethod(methodName));
         new CanonicalizerPhase().apply(graph, getDefaultHighTierContext());
-        assertFalse(graph.hasNode(IntegerSwitchNode.TYPE));
+        assertTrue(graph.getNodes().filter(IntegerSwitchNode.class).isEmpty());
     }
 
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SwitchDyingLoopTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SwitchDyingLoopTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -75,11 +75,11 @@
         StructuredGraph graph = parseEager("snippet", StructuredGraph.AllowAssumptions.YES);
         // there should be 1 loop and 1 switch
         assertThat(graph.getNodes(LoopBeginNode.TYPE), hasCount(1));
-        assertThat(graph.getNodes(IntegerSwitchNode.TYPE), hasCount(1));
+        assertThat(graph.getNodes().filter(IntegerSwitchNode.class), hasCount(1));
         canonicalizerPhase.apply(graph, highTierContext);
         // after canonicalization, the loop and switch should still be there
         assertThat(graph.getNodes(LoopBeginNode.TYPE), hasCount(1));
-        assertThat(graph.getNodes(IntegerSwitchNode.TYPE), hasCount(1));
+        assertThat(graph.getNodes().filter(IntegerSwitchNode.class), hasCount(1));
         // add stamp to `a` so that paths leading to continue can be trimmed
         ParameterNode parameter = graph.getParameter(0);
         assertNotNull(parameter);
@@ -87,6 +87,6 @@
         canonicalizerPhase.apply(graph, highTierContext);
         // the loop should have disappeared and there should still be a switch
         assertThat(graph.getNodes(LoopBeginNode.TYPE), isEmpty());
-        assertThat(graph.getNodes(IntegerSwitchNode.TYPE), hasCount(1));
+        assertThat(graph.getNodes().filter(IntegerSwitchNode.class), hasCount(1));
     }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeSystemTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeSystemTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeWriterTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeWriterTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnbalancedMonitorsTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnbalancedMonitorsTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsafeReadEliminationTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsafeReadEliminationTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsafeVirtualizationTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsafeVirtualizationTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnusedArray.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnusedArray.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyBailoutUsage.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyBailoutUsage.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyCallerSensitiveMethods.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyCallerSensitiveMethods.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyDebugUsage.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyDebugUsage.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -150,7 +150,8 @@
                     "org.graalvm.compiler.core.test.VerifyDebugUsageTest$ValidDumpUsagePhase.run",
                     "org.graalvm.compiler.core.test.VerifyDebugUsageTest$InvalidConcatDumpUsagePhase.run",
                     "org.graalvm.compiler.core.test.VerifyDebugUsageTest$InvalidDumpUsagePhase.run",
-                    "org.graalvm.compiler.hotspot.SymbolicSnippetEncoder.verifySnippetEncodeDecode"));
+                    "org.graalvm.compiler.hotspot.SymbolicSnippetEncoder.verifySnippetEncodeDecode",
+                    "org.graalvm.compiler.truffle.compiler.phases.inlining.CallTree.dumpBasic"));
 
     /**
      * The set of methods allowed to call a {@code Debug.dump(...)} method with the {@code level}
@@ -167,7 +168,8 @@
                     "org.graalvm.compiler.replacements.ReplacementsImpl$GraphMaker.makeGraph",
                     "org.graalvm.compiler.replacements.SnippetTemplate.instantiate",
                     "org.graalvm.compiler.replacements.SnippetTemplate.<init>",
-                    "org.graalvm.compiler.hotspot.SymbolicSnippetEncoder.verifySnippetEncodeDecode"));
+                    "org.graalvm.compiler.hotspot.SymbolicSnippetEncoder.verifySnippetEncodeDecode",
+                    "org.graalvm.compiler.truffle.compiler.phases.inlining.CallTree.dumpInfo"));
 
     private void verifyParameters(StructuredGraph callerGraph, MethodCallTargetNode debugCallTarget, List<? extends ValueNode> args, ResolvedJavaType stringType, int startArgIdx,
                     int varArgsIndex) {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyFoldableMethods.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyFoldableMethods.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyGetOptionsUsage.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyGetOptionsUsage.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyGraphAddUsage.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyGraphAddUsage.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyInstanceOfUsage.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyInstanceOfUsage.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifySystemPropertyUsage.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifySystemPropertyUsage.java	Wed Sep 25 22:40:41 2019 +0200
@@ -96,6 +96,10 @@
             // * its JDK substitutions to mimic required JDK semantics
             // * native-image for config info
             return;
+        } else if (packageName.startsWith("jdk.tools.jaotc")) {
+            // Workaround since jdk.internal.vm.ci/jdk.vm.ci.services is not exported to jdk.aot.
+            // The jaotc launcher dynamically adds these exports.
+            return;
         }
         for (MethodCallTargetNode t : graph.getNodes(MethodCallTargetNode.TYPE)) {
             ResolvedJavaMethod callee = t.targetMethod();
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyUpdateUsages.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyUpdateUsages.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyUsageWithEquals.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyUsageWithEquals.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyVirtualizableUsage.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyVirtualizableUsage.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/BackendTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/BackendTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/CompiledMethodTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/CompiledMethodTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -71,7 +71,7 @@
             }
         }
 
-        InstalledCode compiledMethod = getCode(javaMethod, graph);
+        InstalledCode compiledMethod = getCode(javaMethod, graph, true);
         try {
             Object result = compiledMethod.executeVarargs("1", "2", "3");
             if (!"1-2-3".equals(result)) {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/RethrowDeoptMaterializeTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/RethrowDeoptMaterializeTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SynchronizedMethodDeoptimizationTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SynchronizedMethodDeoptimizationTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EATestBase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EATestBase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EscapeAnalysisTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EscapeAnalysisTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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 @@
 import org.graalvm.compiler.nodes.virtual.CommitAllocationNode;
 import org.graalvm.compiler.phases.common.CanonicalizerPhase;
 import org.graalvm.compiler.phases.schedule.SchedulePhase;
+import org.graalvm.compiler.test.SubprocessUtil;
 import org.graalvm.compiler.virtual.phases.ea.PartialEscapePhase;
 import org.junit.Assert;
 import org.junit.Assume;
@@ -413,8 +414,11 @@
      */
     @Test
     public void testNewNode() {
-        // Trackking of creation interferes with escape analysis
+        // Tracking of creation interferes with escape analysis
         Assume.assumeFalse(Node.TRACK_CREATION_POSITION);
+        // JaCoco can add escaping allocations (e.g. allocation of coverage recording data
+        // structures)
+        Assume.assumeFalse("JaCoCo found -> skipping", SubprocessUtil.isJaCoCoAttached());
         testEscapeAnalysis("testNewNodeSnippet", null, false);
     }
 
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PoorMansEATest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PoorMansEATest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/UnsafeCompareAndSwapVirtualizationTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/UnsafeCompareAndSwapVirtualizationTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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,7 +46,7 @@
     @Test
     public void bothVirtualNoMatchTest() {
         testEscapeAnalysis("bothVirtualNoMatch", JavaConstant.INT_0, true);
-        assertTrue(graph.getNodes(LogicCompareAndSwapNode.TYPE).isEmpty());
+        assertTrue(graph.getNodes().filter(LogicCompareAndSwapNode.class).isEmpty());
     }
 
     public static boolean bothVirtualMatch() {
@@ -58,7 +58,7 @@
     @Test
     public void bothVirtualMatchTest() {
         testEscapeAnalysis("bothVirtualMatch", JavaConstant.INT_1, true);
-        assertTrue(graph.getNodes(LogicCompareAndSwapNode.TYPE).isEmpty());
+        assertTrue(graph.getNodes().filter(LogicCompareAndSwapNode.class).isEmpty());
     }
 
     public static boolean expectedVirtualMatch() {
@@ -70,7 +70,7 @@
     @Test
     public void expectedVirtualMatchTest() {
         testEscapeAnalysis("expectedVirtualMatch", JavaConstant.INT_1, true);
-        assertTrue(graph.getNodes(LogicCompareAndSwapNode.TYPE).isEmpty());
+        assertTrue(graph.getNodes().filter(LogicCompareAndSwapNode.class).isEmpty());
     }
 
     public static boolean expectedVirtualNoMatch() {
@@ -82,7 +82,7 @@
     @Test
     public void expectedVirtualNoMatchTest() {
         testEscapeAnalysis("expectedVirtualNoMatch", JavaConstant.INT_0, true);
-        assertTrue(graph.getNodes(LogicCompareAndSwapNode.TYPE).isEmpty());
+        assertTrue(graph.getNodes().filter(LogicCompareAndSwapNode.class).isEmpty());
     }
 
     public static boolean bothNonVirtualNoMatch() {
@@ -93,7 +93,7 @@
     @Test
     public void bothNonVirtualNoMatchTest() {
         testEscapeAnalysis("bothNonVirtualNoMatch", JavaConstant.INT_0, true);
-        assertTrue(graph.getNodes(LogicCompareAndSwapNode.TYPE).isEmpty());
+        assertTrue(graph.getNodes().filter(LogicCompareAndSwapNode.class).isEmpty());
     }
 
     public static boolean bothNonVirtualMatch() {
@@ -104,7 +104,7 @@
     @Test
     public void bothNonVirtualMatchTest() {
         testEscapeAnalysis("bothNonVirtualMatch", JavaConstant.INT_1, true);
-        assertTrue(graph.getNodes(LogicCompareAndSwapNode.TYPE).isEmpty());
+        assertTrue(graph.getNodes().filter(LogicCompareAndSwapNode.class).isEmpty());
     }
 
     public static boolean onlyInitialValueVirtualNoMatch() {
@@ -115,7 +115,7 @@
     @Test
     public void onlyInitialValueVirtualNoMatchTest() {
         testEscapeAnalysis("onlyInitialValueVirtualNoMatch", JavaConstant.INT_0, true);
-        assertTrue(graph.getNodes(LogicCompareAndSwapNode.TYPE).isEmpty());
+        assertTrue(graph.getNodes().filter(LogicCompareAndSwapNode.class).isEmpty());
     }
 
     public static boolean onlyInitialValueVirtualMatch() {
@@ -127,7 +127,7 @@
     @Test
     public void onlyInitialValueVirtualMatchTest() {
         testEscapeAnalysis("onlyInitialValueVirtualMatch", JavaConstant.INT_1, true);
-        assertTrue(graph.getNodes(LogicCompareAndSwapNode.TYPE).isEmpty());
+        assertTrue(graph.getNodes().filter(LogicCompareAndSwapNode.class).isEmpty());
     }
 
     public static boolean bothVirtualNoMatchArray() {
@@ -138,6 +138,6 @@
     @Test
     public void bothVirtualNoMatchArrayTest() {
         testEscapeAnalysis("bothVirtualNoMatchArray", JavaConstant.INT_0, true);
-        assertTrue(graph.getNodes(LogicCompareAndSwapNode.TYPE).isEmpty());
+        assertTrue(graph.getNodes().filter(LogicCompareAndSwapNode.class).isEmpty());
     }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/NestedLoopEffectsPhaseComplexityTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/NestedLoopEffectsPhaseComplexityTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/PolymorphicInliningTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,367 +0,0 @@
-/*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package org.graalvm.compiler.core.test.inlining;
-
-import static org.graalvm.compiler.test.SubprocessUtil.getVMCommandLine;
-import static org.graalvm.compiler.test.SubprocessUtil.java;
-import static org.graalvm.compiler.test.SubprocessUtil.withoutDebuggerArguments;
-
-import java.io.IOException;
-import java.util.List;
-
-import org.graalvm.compiler.core.test.GraalCompilerTest;
-import org.graalvm.compiler.debug.DebugContext;
-import org.graalvm.compiler.debug.DebugDumpScope;
-import org.graalvm.compiler.graph.Node;
-import org.graalvm.compiler.nodes.DeoptimizeNode;
-import org.graalvm.compiler.nodes.InvokeNode;
-import org.graalvm.compiler.nodes.StructuredGraph;
-import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions;
-import org.graalvm.compiler.nodes.StructuredGraph.Builder;
-import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration;
-import org.graalvm.compiler.nodes.java.TypeSwitchNode;
-import org.graalvm.compiler.phases.OptimisticOptimizations;
-import org.graalvm.compiler.phases.PhaseSuite;
-import org.graalvm.compiler.phases.common.CanonicalizerPhase;
-import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase;
-import org.graalvm.compiler.phases.tiers.HighTierContext;
-import org.graalvm.compiler.test.SubprocessUtil;
-import org.junit.Assert;
-import org.junit.Assume;
-import org.junit.Before;
-import org.junit.Test;
-
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-
-public class PolymorphicInliningTest extends GraalCompilerTest {
-
-    @Before
-    public void checkJavaAgent() {
-        Assume.assumeFalse("Java Agent found -> skipping", SubprocessUtil.isJavaAgentAttached());
-    }
-
-    @Test
-    public void testInSubprocess() throws InterruptedException, IOException {
-        String recursionPropName = getClass().getName() + ".recursion";
-        if (Boolean.getBoolean(recursionPropName)) {
-            testPolymorphicInlining();
-            testPolymorphicNotInlining();
-            testMegamorphicInlining();
-            testMegamorphicNotInlining();
-        } else {
-            List<String> vmArgs = withoutDebuggerArguments(getVMCommandLine());
-            NotInlinableSubClass.class.getCanonicalName();
-            vmArgs.add("-XX:CompileCommand=dontinline,org/graalvm/compiler/core/test/inlining/PolymorphicInliningTest$NotInlinableSubClass.publicOverriddenMethod");
-            vmArgs.add("-D" + recursionPropName + "=true");
-            SubprocessUtil.Subprocess proc = java(vmArgs, "com.oracle.mxtool.junit.MxJUnitWrapper", getClass().getName());
-            if (proc.exitCode != 0) {
-                Assert.fail(String.format("non-zero exit code %d for command:%n%s", proc.exitCode, proc));
-            }
-        }
-    }
-
-    public int polymorphicCallsite(SuperClass receiver) {
-        return receiver.publicOverriddenMethod();
-    }
-
-    public void testPolymorphicInlining() {
-        for (int i = 0; i < 10000; i++) {
-            if (i % 2 == 0) {
-                polymorphicCallsite(Receivers.subClassA);
-            } else {
-                polymorphicCallsite(Receivers.subClassB);
-            }
-        }
-        StructuredGraph graph = getGraph("polymorphicCallsite", false);
-        // This callsite should be inlined with a TypeCheckedInliningViolated deoptimization.
-        assertTrue(getNodeCount(graph, InvokeNode.class) == 0);
-        assertTrue(getNodeCount(graph, TypeSwitchNode.class) == 1);
-        assertTrue(getNodeCount(graph, DeoptimizeNode.class) >= 1);
-    }
-
-    /**
-     * This snippet is identical to {@link #polymorphicCallsite(SuperClass)}, and is for avoiding
-     * interference of the receiver type profile from different unit tests.
-     */
-    public int polymorphicCallsite1(SuperClass receiver) {
-        return receiver.publicOverriddenMethod();
-    }
-
-    public void testPolymorphicNotInlining() {
-        for (int i = 0; i < 10000; i++) {
-            if (i % 2 == 0) {
-                polymorphicCallsite1(Receivers.subClassA);
-            } else {
-                polymorphicCallsite1(Receivers.notInlinableSubClass);
-            }
-        }
-        StructuredGraph graph = getGraph("polymorphicCallsite1", false);
-        // This callsite should not be inlined due to one of the potential callee method is not
-        // inlinable.
-        assertTrue(getNodeCount(graph, InvokeNode.class) == 1);
-        assertTrue(getNodeCount(graph, TypeSwitchNode.class) == 0);
-    }
-
-    /**
-     * This snippet is identical to {@link #polymorphicCallsite(SuperClass)}, and is for avoiding
-     * interference of the receiver type profile from different unit tests.
-     */
-    public int polymorphicCallsite2(SuperClass receiver) {
-        return receiver.publicOverriddenMethod();
-    }
-
-    public void testMegamorphicInlining() {
-        // Construct a receiver type profile that exceeds the max type width (by default 8 in JVMCI,
-        // specified by -XX:TypeProfileWidth).
-        for (int i = 0; i < 2000; i++) {
-            // Ensure the following receiver type is within the type profile.
-            polymorphicCallsite2(Receivers.subClassA);
-        }
-        for (int i = 0; i < 10000; i++) {
-            switch (i % 20) {
-                case 0:
-                case 1:
-                case 2:
-                case 3:
-                case 4:
-                case 5:
-                case 6:
-                case 7:
-                    // Probability: 40%
-                    // Ensure the probability is greater than
-                    // GraalOptions.MegamorphicInliningMinMethodProbability (by default 0.33D);
-                    polymorphicCallsite2(Receivers.subClassA);
-                    break;
-                case 8:
-                    polymorphicCallsite2(Receivers.subClassB);
-                    break;
-                case 9:
-                    polymorphicCallsite2(Receivers.subClassC);
-                    break;
-                case 10:
-                    polymorphicCallsite2(Receivers.subClassD);
-                    break;
-                case 11:
-                    polymorphicCallsite2(Receivers.subClassE);
-                    break;
-                case 12:
-                    polymorphicCallsite2(Receivers.subClassF);
-                    break;
-                case 13:
-                    polymorphicCallsite2(Receivers.subClassG);
-                    break;
-                case 14:
-                    polymorphicCallsite2(Receivers.subClassH);
-                    break;
-                default:
-                    // Probability: 25%
-                    polymorphicCallsite2(Receivers.notInlinableSubClass);
-                    break;
-            }
-        }
-        StructuredGraph graph = getGraph("polymorphicCallsite2", false);
-        // This callsite should be inlined with a fallback invocation.
-        assertTrue(getNodeCount(graph, InvokeNode.class) == 1);
-        assertTrue(getNodeCount(graph, TypeSwitchNode.class) == 1);
-    }
-
-    /**
-     * This snippet is identical to {@link #polymorphicCallsite(SuperClass)}, and is for avoiding
-     * interference of the receiver type profile from different unit tests.
-     */
-    public int polymorphicCallsite3(SuperClass receiver) {
-        return receiver.publicOverriddenMethod();
-    }
-
-    public void testMegamorphicNotInlining() {
-        for (int i = 0; i < 10000; i++) {
-            switch (i % 10) {
-                case 0:
-                case 1:
-                    polymorphicCallsite3(Receivers.subClassA);
-                    break;
-                case 2:
-                    polymorphicCallsite3(Receivers.subClassB);
-                    break;
-                case 3:
-                    polymorphicCallsite3(Receivers.subClassC);
-                    break;
-                case 4:
-                    polymorphicCallsite3(Receivers.subClassD);
-                    break;
-                case 5:
-                    polymorphicCallsite3(Receivers.subClassE);
-                    break;
-                case 6:
-                    polymorphicCallsite3(Receivers.subClassF);
-                    break;
-                case 7:
-                    polymorphicCallsite3(Receivers.subClassG);
-                    break;
-                case 8:
-                    polymorphicCallsite3(Receivers.subClassH);
-                    break;
-                default:
-                    polymorphicCallsite3(Receivers.notInlinableSubClass);
-                    break;
-            }
-        }
-        StructuredGraph graph = getGraph("polymorphicCallsite3", false);
-        // This callsite should not be inlined due to non of the potential callee method exceeds the
-        // probability specified by GraalOptions.MegamorphicInliningMinMethodProbability.
-        assertTrue(getNodeCount(graph, InvokeNode.class) == 1);
-        assertTrue(getNodeCount(graph, TypeSwitchNode.class) == 0);
-    }
-
-    @SuppressWarnings("try")
-    private StructuredGraph getGraph(final String snippet, final boolean eagerInfopointMode) {
-        DebugContext debug = getDebugContext();
-        try (DebugContext.Scope s = debug.scope("InliningTest", new DebugDumpScope(snippet, true))) {
-            ResolvedJavaMethod method = getResolvedJavaMethod(snippet);
-            Builder builder = builder(method, AllowAssumptions.YES, debug);
-            StructuredGraph graph = eagerInfopointMode ? parse(builder, getDebugGraphBuilderSuite()) : parse(builder, getEagerGraphBuilderSuite());
-            try (DebugContext.Scope s2 = debug.scope("Inlining", graph)) {
-                PhaseSuite<HighTierContext> graphBuilderSuite = eagerInfopointMode
-                                ? getCustomGraphBuilderSuite(GraphBuilderConfiguration.getDefault(getDefaultGraphBuilderPlugins()).withFullInfopoints(true))
-                                : getDefaultGraphBuilderSuite();
-                HighTierContext context = new HighTierContext(getProviders(), graphBuilderSuite, OptimisticOptimizations.ALL);
-                debug.dump(DebugContext.BASIC_LEVEL, graph, "Graph");
-                new CanonicalizerPhase().apply(graph, context);
-                createInliningPhase().apply(graph, context);
-                debug.dump(DebugContext.BASIC_LEVEL, graph, "Graph");
-                new CanonicalizerPhase().apply(graph, context);
-                new DeadCodeEliminationPhase().apply(graph);
-                return graph;
-            }
-        } catch (Throwable e) {
-            throw debug.handle(e);
-        }
-    }
-
-    private static int getNodeCount(StructuredGraph graph, Class<? extends Node> nodeClass) {
-        return graph.getNodes().filter(nodeClass).count();
-    }
-
-    private static final class Receivers {
-        static final SubClassA subClassA = new SubClassA();
-        static final SubClassB subClassB = new SubClassB();
-        static final SubClassC subClassC = new SubClassC();
-        static final SubClassD subClassD = new SubClassD();
-        static final SubClassE subClassE = new SubClassE();
-        static final SubClassF subClassF = new SubClassF();
-        static final SubClassG subClassG = new SubClassG();
-        static final SubClassH subClassH = new SubClassH();
-
-        static final NotInlinableSubClass notInlinableSubClass = new NotInlinableSubClass();
-    }
-
-    private abstract static class SuperClass {
-
-        public abstract int publicOverriddenMethod();
-
-    }
-
-    private static class SubClassA extends SuperClass {
-
-        @Override
-        public int publicOverriddenMethod() {
-            return 'A';
-        }
-
-    }
-
-    private static class SubClassB extends SuperClass {
-
-        @Override
-        public int publicOverriddenMethod() {
-            return 'B';
-        }
-
-    }
-
-    private static class SubClassC extends SuperClass {
-
-        @Override
-        public int publicOverriddenMethod() {
-            return 'C';
-        }
-
-    }
-
-    private static class SubClassD extends SuperClass {
-
-        @Override
-        public int publicOverriddenMethod() {
-            return 'D';
-        }
-
-    }
-
-    private static class SubClassE extends SuperClass {
-
-        @Override
-        public int publicOverriddenMethod() {
-            return 'E';
-        }
-
-    }
-
-    private static class SubClassF extends SuperClass {
-
-        @Override
-        public int publicOverriddenMethod() {
-            return 'F';
-        }
-
-    }
-
-    private static class SubClassG extends SuperClass {
-
-        @Override
-        public int publicOverriddenMethod() {
-            return 'G';
-        }
-
-    }
-
-    private static class SubClassH extends SuperClass {
-
-        @Override
-        public int publicOverriddenMethod() {
-            return 'H';
-        }
-
-    }
-
-    private static final class NotInlinableSubClass extends SuperClass {
-
-        @Override
-        public int publicOverriddenMethod() {
-            return 'X';
-        }
-
-    }
-
-}
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysis.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysis.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysisTests.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysisTests.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilationPrinter.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilationPrinter.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -99,15 +99,15 @@
     public void finish(CompilationResult result) {
         if (id != null) {
             final long stop = System.nanoTime();
-            final long duration = (stop - start) / 1000000;
+            final long duration = (stop - start) / 1000;
             final int targetCodeSize = result != null ? result.getTargetCodeSize() : -1;
             final int bytecodeSize = result != null ? result.getBytecodeSize() : 0;
             if (allocatedBytesBefore == -1) {
-                TTY.println(getMethodDescription() + String.format(" | %4dms %5dB %5dB", duration, bytecodeSize, targetCodeSize));
+                TTY.println(getMethodDescription() + String.format(" | %4dus %5dB bytecodes %5dB codesize", duration, bytecodeSize, targetCodeSize));
             } else {
                 final long allocatedBytesAfter = getCurrentThreadAllocatedBytes();
                 final long allocatedKBytes = (allocatedBytesAfter - allocatedBytesBefore) / 1024;
-                TTY.println(getMethodDescription() + String.format(" | %4dms %5dB %5dB %5dkB", duration, bytecodeSize, targetCodeSize, allocatedKBytes));
+                TTY.println(getMethodDescription() + String.format(" | %4dus %5dB bytecodes %5dB codesize %5dkB allocated", duration, bytecodeSize, targetCodeSize, allocatedKBytes));
             }
         }
     }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilationWrapper.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilationWrapper.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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 static org.graalvm.compiler.core.GraalCompilerOptions.CompilationFailureAction;
 import static org.graalvm.compiler.core.GraalCompilerOptions.ExitVMOnException;
 import static org.graalvm.compiler.core.GraalCompilerOptions.MaxCompilationProblemsPerAction;
+import static org.graalvm.compiler.core.common.GraalOptions.TrackNodeSourcePosition;
 import static org.graalvm.compiler.debug.DebugContext.VERBOSE_LEVEL;
 import static org.graalvm.compiler.debug.DebugOptions.Dump;
 import static org.graalvm.compiler.debug.DebugOptions.DumpPath;
@@ -274,7 +275,8 @@
                 OptionValues retryOptions = new OptionValues(initialOptions,
                                 Dump, ":" + VERBOSE_LEVEL,
                                 MethodFilter, null,
-                                DumpPath, dumpPath.getPath());
+                                DumpPath, dumpPath.getPath(),
+                                TrackNodeSourcePosition, true);
 
                 ByteArrayOutputStream logBaos = new ByteArrayOutputStream();
                 PrintStream ps = new PrintStream(logBaos);
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompilerOptions.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompilerOptions.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/LIRGenerationPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/LIRGenerationPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/DebugInfoBuilder.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/DebugInfoBuilder.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/LIRCompilerBackend.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/LIRCompilerBackend.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -145,7 +145,8 @@
             LIR lir = new LIR(schedule.getCFG(), linearScanOrder, codeEmittingOrder, graph.getOptions(), graph.getDebug());
 
             LIRGenerationProvider lirBackend = (LIRGenerationProvider) backend;
-            LIRGenerationResult lirGenRes = lirBackend.newLIRGenerationResult(graph.compilationId(), lir, registerConfig, graph, stub);
+            RegisterAllocationConfig registerAllocationConfig = backend.newRegisterAllocationConfig(registerConfig, allocationRestrictedTo);
+            LIRGenerationResult lirGenRes = lirBackend.newLIRGenerationResult(graph.compilationId(), lir, registerAllocationConfig, graph, stub);
             LIRGeneratorTool lirGen = lirBackend.newLIRGenerator(lirGenRes);
             NodeLIRBuilderTool nodeLirGen = lirBackend.newNodeLIRBuilder(graph, lirGen);
 
@@ -156,7 +157,7 @@
             try (DebugContext.Scope s = debug.scope("LIRStages", nodeLirGen, lirGenRes, lir)) {
                 // Dump LIR along with HIR (the LIR is looked up from context)
                 debug.dump(DebugContext.BASIC_LEVEL, graph.getLastSchedule(), "After LIR generation");
-                LIRGenerationResult result = emitLowLevel(backend.getTarget(), lirGenRes, lirGen, lirSuites, backend.newRegisterAllocationConfig(registerConfig, allocationRestrictedTo));
+                LIRGenerationResult result = emitLowLevel(backend.getTarget(), lirGenRes, lirGen, lirSuites, registerAllocationConfig);
                 return result;
             } catch (Throwable e) {
                 throw debug.handle(e);
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/LIRGenerationProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/LIRGenerationProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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 org.graalvm.compiler.code.CompilationResult;
 import org.graalvm.compiler.core.common.CompilationIdentifier;
+import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig;
 import org.graalvm.compiler.lir.LIR;
 import org.graalvm.compiler.lir.asm.CompilationResultBuilder;
 import org.graalvm.compiler.lir.asm.CompilationResultBuilderFactory;
@@ -35,7 +36,6 @@
 import org.graalvm.compiler.nodes.StructuredGraph;
 import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool;
 
-import jdk.vm.ci.code.RegisterConfig;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 
 /**
@@ -46,7 +46,7 @@
 
     LIRGenerationResult newLIRGenerationResult(CompilationIdentifier compilationId,
                     LIR lir,
-                    RegisterConfig registerConfig,
+                    RegisterAllocationConfig registerAllocationConfig,
                     StructuredGraph graph,
                     Object stub);
 
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeMatchRules.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeMatchRules.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchContext.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchContext.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchPattern.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchPattern.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatement.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatement.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyLowTier.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyLowTier.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyMidTier.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyMidTier.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/GraphChangeMonitoringPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/GraphChangeMonitoringPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/HighTier.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/HighTier.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/LowTier.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/LowTier.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -39,7 +39,6 @@
 import org.graalvm.compiler.phases.common.ExpandLogicPhase;
 import org.graalvm.compiler.phases.common.FixReadsPhase;
 import org.graalvm.compiler.phases.common.LoweringPhase;
-import org.graalvm.compiler.phases.common.OptimizeDivPhase;
 import org.graalvm.compiler.phases.common.ProfileCompiledMethodsPhase;
 import org.graalvm.compiler.phases.common.PropagateDeoptimizeProbabilityPhase;
 import org.graalvm.compiler.phases.common.UseTrappingNullChecksPhase;
@@ -73,8 +72,6 @@
 
         appendPhase(new LoweringPhase(canonicalizer, LoweringTool.StandardLoweringStage.LOW_TIER));
 
-        appendPhase(new OptimizeDivPhase());
-
         appendPhase(new ExpandLogicPhase());
 
         appendPhase(new FixReadsPhase(true,
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/MidTier.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/MidTier.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -55,6 +55,7 @@
 import org.graalvm.compiler.phases.common.LockEliminationPhase;
 import org.graalvm.compiler.phases.common.LoopSafepointInsertionPhase;
 import org.graalvm.compiler.phases.common.LoweringPhase;
+import org.graalvm.compiler.phases.common.OptimizeDivPhase;
 import org.graalvm.compiler.phases.common.VerifyHeapAtReturnPhase;
 import org.graalvm.compiler.phases.common.WriteBarrierAdditionPhase;
 import org.graalvm.compiler.phases.tiers.MidTierContext;
@@ -93,6 +94,8 @@
 
         appendPhase(new LoweringPhase(canonicalizer, LoweringTool.StandardLoweringStage.MID_TIER));
 
+        appendPhase(new OptimizeDivPhase());
+
         appendPhase(new FrameStateAssignmentPhase());
 
         LoopPolicies loopPolicies = createLoopPolicies();
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/target/Backend.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/target/Backend.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugContext.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugContext.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugOptions.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugOptions.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GlobalMetrics.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GlobalMetrics.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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,9 @@
             EconomicMap<MetricKey, Long> map = asKeyValueMap();
             String metricsFile = DebugOptions.AggregatedMetricsFile.getValue(options);
             boolean csv = metricsFile != null && (metricsFile.endsWith(".csv") || metricsFile.endsWith(".CSV"));
-            try (PrintStream p = metricsFile == null ? DebugContext.DEFAULT_LOG_STREAM : new PrintStream(Files.newOutputStream(Paths.get(metricsFile)))) {
+            PrintStream p = null;
+            try {
+                p = metricsFile == null ? DebugContext.DEFAULT_LOG_STREAM : new PrintStream(Files.newOutputStream(Paths.get(metricsFile)));
                 if (!csv) {
                     if (!map.isEmpty()) {
                         p.println("++ Aggregated Metrics ++");
@@ -110,6 +112,11 @@
                 }
             } catch (IOException e) {
                 e.printStackTrace();
+            } finally {
+                // Don't close DEFAULT_LOG_STREAM
+                if (metricsFile != null && p != null) {
+                    p.close();
+                }
             }
         }
 
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/IgvDumpChannel.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/IgvDumpChannel.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MemUseTrackerKey.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MemUseTrackerKey.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/PathUtilities.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/PathUtilities.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTY.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTY.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Edges.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Edges.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Graph.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Graph.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/IterableNodeType.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/IterableNodeType.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -27,8 +27,8 @@
 /**
  * A marker for a node type supporting {@linkplain Graph#getNodes(NodeClass) fast iteration} of its
  * instances in a graph. The support for fast iteration comes with a memory cost (e.g., extra data
- * structures {@link Graph}) so only node types for which fast iteration provides a compilation
- * performance benefit should implement this interface.
+ * structures {@link Graph}) and additional bookkeeping when adding nodes, so only node types for
+ * which fast iteration provides a compilation performance benefit should implement this interface.
  */
 public interface IterableNodeType {
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Node.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Node.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -936,6 +936,12 @@
         }
     }
 
+    public void replaceAllInputs(Node oldInput, Node newInput) {
+        while (nodeClass.replaceFirstInput(this, oldInput, newInput)) {
+            updateUsages(oldInput, newInput);
+        }
+    }
+
     public void replaceFirstInput(Node oldInput, Node newInput, InputType type) {
         for (Position pos : inputPositions()) {
             if (pos.getInputType() == type && pos.get(this) == oldInput) {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeClass.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeClass.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -1217,8 +1217,8 @@
                     return false;
                 }
             } else {
-                Object v1 = Edges.getNodeListUnsafe(node, offset);
-                Object v2 = Edges.getNodeListUnsafe(other, offset);
+                NodeList<Node> v1 = Edges.getNodeListUnsafe(node, offset);
+                NodeList<Node> v2 = Edges.getNodeListUnsafe(other, offset);
                 if (!Objects.equals(v1, v2)) {
                     return false;
                 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeList.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeList.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -108,6 +108,20 @@
         }
     }
 
+    /**
+     * Removes null values from the list.
+     */
+    public void trim() {
+        int newSize = 0;
+        for (int i = 0; i < nodes.length; ++i) {
+            if (nodes[i] != null) {
+                nodes[newSize] = nodes[i];
+                newSize++;
+            }
+        }
+        size = newSize;
+    }
+
     public boolean isList() {
         return true;
     }
@@ -143,7 +157,7 @@
     @SuppressWarnings("unchecked")
     @Override
     public boolean add(Node node) {
-        assert node == null || !node.isDeleted();
+        assert node == null || !node.isDeleted() : node;
         self.incModCount();
         incModCount();
         int length = nodes.length;
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeMap.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeMap.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSourcePosition.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSourcePosition.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackend.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackend.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -44,7 +44,6 @@
 import org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler.ScratchRegister;
 import org.graalvm.compiler.code.CompilationResult;
 import org.graalvm.compiler.core.aarch64.AArch64NodeMatchRules;
-import org.graalvm.compiler.core.common.CompilationIdentifier;
 import org.graalvm.compiler.core.common.LIRKind;
 import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig;
 import org.graalvm.compiler.core.common.spi.ForeignCallLinkage;
@@ -89,7 +88,6 @@
 import jdk.vm.ci.meta.JavaKind;
 import jdk.vm.ci.meta.JavaType;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
-
 import sun.misc.Unsafe;
 
 /**
@@ -101,7 +99,8 @@
         super(config, runtime, providers);
     }
 
-    private FrameMapBuilder newFrameMapBuilder(RegisterConfig registerConfig) {
+    @Override
+    protected FrameMapBuilder newFrameMapBuilder(RegisterConfig registerConfig) {
         RegisterConfig registerConfigNonNull = registerConfig == null ? getCodeCache().getRegisterConfig() : registerConfig;
         FrameMap frameMap = new AArch64FrameMap(getCodeCache(), registerConfigNonNull, this);
         return new AArch64FrameMapBuilder(frameMap, getCodeCache(), registerConfigNonNull);
@@ -113,12 +112,6 @@
     }
 
     @Override
-    public LIRGenerationResult newLIRGenerationResult(CompilationIdentifier compilationId, LIR lir, RegisterConfig registerConfig, StructuredGraph graph, Object stub) {
-        return new HotSpotLIRGenerationResult(compilationId, lir, newFrameMapBuilder(registerConfig), makeCallingConvention(graph, (Stub) stub), stub,
-                        config.requiresReservedStackCheck(graph.getMethods()));
-    }
-
-    @Override
     public NodeLIRBuilderTool newNodeLIRBuilder(StructuredGraph graph, LIRGeneratorTool lirGen) {
         return new AArch64HotSpotNodeLIRBuilder(graph, lirGen, new AArch64NodeMatchRules(lirGen));
     }
@@ -284,8 +277,7 @@
         }
 
         if (stub != null) {
-            EconomicSet<Register> destroyedCallerRegisters = gatherDestroyedCallerRegisters(lir);
-            updateStub(stub, destroyedCallerRegisters, gen.getCalleeSaveInfo(), frameMap);
+            updateStub(stub, gen, frameMap);
         }
         return crb;
     }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackendFactory.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackendFactory.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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.
  * Copyright (c) 2018, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -155,7 +155,8 @@
                 replacements = createReplacements(target, p, snippetReflection, bytecodeProvider);
             }
             try (InitTimer rt = timer("create GraphBuilderPhase plugins")) {
-                plugins = createGraphBuilderPlugins(compilerConfiguration, config, constantReflection, foreignCalls, metaAccess, snippetReflection, replacements, wordTypes, graalRuntime.getOptions());
+                plugins = createGraphBuilderPlugins(graalRuntime, compilerConfiguration, config, constantReflection, foreignCalls, metaAccess, snippetReflection, replacements, wordTypes,
+                                graalRuntime.getOptions());
                 replacements.setGraphBuilderPlugins(plugins);
             }
             try (InitTimer rt = timer("create Suites provider")) {
@@ -170,11 +171,27 @@
         }
     }
 
-    protected Plugins createGraphBuilderPlugins(CompilerConfiguration compilerConfiguration, GraalHotSpotVMConfig config, HotSpotConstantReflectionProvider constantReflection,
-                    HotSpotHostForeignCallsProvider foreignCalls, HotSpotMetaAccessProvider metaAccess, HotSpotSnippetReflectionProvider snippetReflection,
-                    HotSpotReplacementsImpl replacements, HotSpotWordTypes wordTypes, OptionValues options) {
-        Plugins plugins = HotSpotGraphBuilderPlugins.create(compilerConfiguration, config, wordTypes, metaAccess, constantReflection, snippetReflection, foreignCalls, replacements, options);
-        AArch64GraphBuilderPlugins.register(plugins, replacements.getDefaultReplacementBytecodeProvider(), false, //
+    protected Plugins createGraphBuilderPlugins(HotSpotGraalRuntimeProvider graalRuntime,
+                    CompilerConfiguration compilerConfiguration,
+                    GraalHotSpotVMConfig config,
+                    HotSpotConstantReflectionProvider constantReflection,
+                    HotSpotHostForeignCallsProvider foreignCalls,
+                    HotSpotMetaAccessProvider metaAccess,
+                    HotSpotSnippetReflectionProvider snippetReflection,
+                    HotSpotReplacementsImpl replacements,
+                    HotSpotWordTypes wordTypes,
+                    OptionValues options) {
+        Plugins plugins = HotSpotGraphBuilderPlugins.create(graalRuntime,
+                        compilerConfiguration,
+                        config,
+                        wordTypes,
+                        metaAccess,
+                        constantReflection,
+                        snippetReflection,
+                        foreignCalls,
+                        replacements,
+                        options);
+        AArch64GraphBuilderPlugins.register(plugins, replacements.getDefaultReplacementBytecodeProvider(), false,
                         /* registerMathPlugins */true);
         return plugins;
     }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotForeignCallsProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotForeignCallsProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -30,7 +30,7 @@
 import static jdk.vm.ci.meta.Value.ILLEGAL;
 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.JUMP_ADDRESS;
 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Reexecutability.NOT_REEXECUTABLE;
-import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.PRESERVES_REGISTERS;
+import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.DESTROYS_ALL_CALLER_SAVE_REGISTERS;
 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition.LEAF;
 import static org.graalvm.compiler.hotspot.replacements.CRC32CSubstitutions.UPDATE_BYTES_CRC32C;
 import static org.graalvm.compiler.hotspot.replacements.CRC32Substitutions.UPDATE_BYTES_CRC32;
@@ -76,15 +76,17 @@
         RegisterValue exception = r0.asValue(LIRKind.reference(word));
         RegisterValue exceptionPc = r3.asValue(LIRKind.value(word));
         CallingConvention exceptionCc = new CallingConvention(0, ILLEGAL, exception, exceptionPc);
-        register(new HotSpotForeignCallLinkageImpl(HotSpotBackend.EXCEPTION_HANDLER, 0L, PRESERVES_REGISTERS, LEAF, NOT_REEXECUTABLE, exceptionCc, null, any()));
-        register(new HotSpotForeignCallLinkageImpl(HotSpotBackend.EXCEPTION_HANDLER_IN_CALLER, JUMP_ADDRESS, PRESERVES_REGISTERS, LEAF, NOT_REEXECUTABLE, exceptionCc, null, any()));
+        register(new HotSpotForeignCallLinkageImpl(HotSpotBackend.EXCEPTION_HANDLER, 0L, DESTROYS_ALL_CALLER_SAVE_REGISTERS, LEAF, NOT_REEXECUTABLE, exceptionCc, null, any()));
+        register(new HotSpotForeignCallLinkageImpl(HotSpotBackend.EXCEPTION_HANDLER_IN_CALLER, JUMP_ADDRESS, DESTROYS_ALL_CALLER_SAVE_REGISTERS, LEAF, NOT_REEXECUTABLE, exceptionCc,
+                        null,
+                        any()));
 
         // These stubs do callee saving
         if (config.useCRC32Intrinsics) {
-            registerForeignCall(UPDATE_BYTES_CRC32, config.updateBytesCRC32Stub, NativeCall, PRESERVES_REGISTERS, LEAF, NOT_REEXECUTABLE, any());
+            registerForeignCall(UPDATE_BYTES_CRC32, config.updateBytesCRC32Stub, NativeCall, LEAF, NOT_REEXECUTABLE, any());
         }
         if (config.useCRC32CIntrinsics) {
-            registerForeignCall(UPDATE_BYTES_CRC32C, config.updateBytesCRC32C, NativeCall, PRESERVES_REGISTERS, LEAF, NOT_REEXECUTABLE, any());
+            registerForeignCall(UPDATE_BYTES_CRC32C, config.updateBytesCRC32C, NativeCall, LEAF, NOT_REEXECUTABLE, any());
         }
 
         super.initialize(providers, options);
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotJumpToExceptionHandlerInCallerOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotJumpToExceptionHandlerInCallerOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRGenerator.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRGenerator.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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.
  * Copyright (c) 2018, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -38,6 +38,7 @@
 import static org.graalvm.compiler.lir.LIRValueUtil.asConstant;
 import static org.graalvm.compiler.lir.LIRValueUtil.isConstantValue;
 
+import java.util.EnumSet;
 import java.util.function.Function;
 
 import org.graalvm.compiler.asm.Label;
@@ -48,6 +49,7 @@
 import org.graalvm.compiler.core.aarch64.AArch64LIRGenerator;
 import org.graalvm.compiler.core.aarch64.AArch64LIRKindTool;
 import org.graalvm.compiler.core.common.CompressEncoding;
+import org.graalvm.compiler.core.common.GraalOptions;
 import org.graalvm.compiler.core.common.LIRKind;
 import org.graalvm.compiler.core.common.calc.Condition;
 import org.graalvm.compiler.core.common.spi.ForeignCallDescriptor;
@@ -68,7 +70,7 @@
 import org.graalvm.compiler.lir.LIRFrameState;
 import org.graalvm.compiler.lir.LIRInstruction;
 import org.graalvm.compiler.lir.LabelRef;
-import org.graalvm.compiler.lir.StandardOp.SaveRegistersOp;
+import org.graalvm.compiler.lir.StandardOp.ZapRegistersOp;
 import org.graalvm.compiler.lir.SwitchStrategy;
 import org.graalvm.compiler.lir.Variable;
 import org.graalvm.compiler.lir.VirtualStackSlot;
@@ -82,6 +84,7 @@
 import org.graalvm.compiler.lir.aarch64.AArch64PrefetchOp;
 import org.graalvm.compiler.lir.aarch64.AArch64RestoreRegistersOp;
 import org.graalvm.compiler.lir.aarch64.AArch64SaveRegistersOp;
+import org.graalvm.compiler.lir.aarch64.AArch64ZeroMemoryOp;
 import org.graalvm.compiler.lir.gen.LIRGenerationResult;
 import org.graalvm.compiler.options.OptionValues;
 
@@ -167,10 +170,9 @@
     /**
      * @param savedRegisters the registers saved by this operation which may be subject to pruning
      * @param savedRegisterLocations the slots to which the registers are saved
-     * @param supportsRemove determines if registers can be pruned
      */
-    protected AArch64SaveRegistersOp emitSaveRegisters(Register[] savedRegisters, AllocatableValue[] savedRegisterLocations, boolean supportsRemove) {
-        AArch64SaveRegistersOp save = new AArch64SaveRegistersOp(savedRegisters, savedRegisterLocations, supportsRemove);
+    protected AArch64SaveRegistersOp emitSaveRegisters(Register[] savedRegisters, AllocatableValue[] savedRegisterLocations) {
+        AArch64SaveRegistersOp save = new AArch64SaveRegistersOp(savedRegisters, savedRegisterLocations);
         append(save);
         return save;
     }
@@ -182,7 +184,7 @@
         PlatformKind kind = target().arch.getLargestStorableKind(register.getRegisterCategory());
         if (kind.getVectorLength() > 1) {
             // we don't use vector registers, so there is no need to save them
-            kind = AArch64Kind.QWORD;
+            kind = AArch64Kind.DOUBLE;
         }
         return getResult().getFrameMapBuilder().allocateSpillSlot(LIRKind.value(kind));
     }
@@ -190,15 +192,14 @@
     /**
      * Adds a node to the graph that saves all allocatable registers to the stack.
      *
-     * @param supportsRemove determines if registers can be pruned
      * @return the register save node
      */
-    private AArch64SaveRegistersOp emitSaveAllRegisters(Register[] savedRegisters, boolean supportsRemove) {
+    private AArch64SaveRegistersOp emitSaveAllRegisters(Register[] savedRegisters) {
         AllocatableValue[] savedRegisterLocations = new AllocatableValue[savedRegisters.length];
         for (int i = 0; i < savedRegisters.length; i++) {
             savedRegisterLocations[i] = allocateSaveRegisterLocation(savedRegisters[i]);
         }
-        return emitSaveRegisters(savedRegisters, savedRegisterLocations, supportsRemove);
+        return emitSaveRegisters(savedRegisters, savedRegisterLocations);
     }
 
     protected void emitRestoreRegisters(AArch64SaveRegistersOp save) {
@@ -347,11 +348,9 @@
 
         AArch64SaveRegistersOp save = null;
         Stub stub = getStub();
-        if (destroysRegisters) {
-            if (stub != null && stub.preservesRegisters()) {
-                Register[] savedRegisters = getRegisterConfig().getAllocatableRegisters().toArray();
-                save = emitSaveAllRegisters(savedRegisters, true);
-            }
+        if (destroysRegisters && stub != null && stub.shouldSaveRegistersAroundCalls()) {
+            Register[] savedRegisters = getRegisterConfig().getAllocatableRegisters().toArray();
+            save = emitSaveAllRegisters(savedRegisters);
         }
 
         Variable result;
@@ -379,19 +378,15 @@
             result = super.emitForeignCall(hotspotLinkage, debugInfo, args);
         }
 
-        if (destroysRegisters) {
-            if (stub != null) {
-                if (stub.preservesRegisters()) {
-                    HotSpotLIRGenerationResult generationResult = getResult();
-                    LIRFrameState key = currentRuntimeCallInfo;
-                    if (key == null) {
-                        key = LIRFrameState.NO_STATE;
-                    }
-                    assert !generationResult.getCalleeSaveInfo().containsKey(key);
-                    generationResult.getCalleeSaveInfo().put(key, save);
-                    emitRestoreRegisters(save);
-                }
+        if (save != null) {
+            HotSpotLIRGenerationResult generationResult = getResult();
+            LIRFrameState key = currentRuntimeCallInfo;
+            if (key == null) {
+                key = LIRFrameState.NO_STATE;
             }
+            assert !generationResult.getCalleeSaveInfo().containsKey(key);
+            generationResult.getCalleeSaveInfo().put(key, save);
+            emitRestoreRegisters(save);
         }
 
         return result;
@@ -539,7 +534,7 @@
     }
 
     @Override
-    public SaveRegistersOp createZapRegisters(Register[] zappedRegisters, JavaConstant[] zapValues) {
+    public ZapRegistersOp createZapRegisters(Register[] zappedRegisters, JavaConstant[] zapValues) {
         throw GraalError.unimplemented();
     }
 
@@ -547,4 +542,28 @@
     public LIRInstruction createZapArgumentSpace(StackSlot[] zappedStack, JavaConstant[] zapValues) {
         throw GraalError.unimplemented();
     }
+
+    @Override
+    public void emitZeroMemory(Value address, Value length) {
+        int dczidValue = config.psrInfoDczidValue;
+        EnumSet<AArch64.Flag> flags = ((AArch64) target().arch).getFlags();
+
+        // ARMv8-A architecture reference manual D12.2.35 Data Cache Zero ID register says:
+        // * BS, bits [3:0] indicate log2 of the DC ZVA block size in (4-byte) words.
+        // * DZP, bit [4] of indicates whether use of DC ZVA instruction is prohibited.
+        int zvaLength = 4 << (dczidValue & 0xF);
+        boolean isDcZvaProhibited = ((dczidValue & 0x10) != 0);
+
+        // Use DC ZVA if it's not prohibited and AArch64 HotSpot flag UseBlockZeroing is on.
+        boolean useDcZva = !isDcZvaProhibited && flags.contains(AArch64.Flag.UseBlockZeroing);
+
+        // Set zva length negative (unknown at compile-time) for AOT compilation, since the value
+        // could be different on different AArch64 CPU implementations.
+        if (GraalOptions.ImmutableCode.getValue(getResult().getLIR().getOptions())) {
+            useDcZva = false;
+        }
+
+        // Value address is 8-byte aligned; Value length is multiple of 8.
+        append(new AArch64ZeroMemoryOp(asAllocatable(address), asAllocatable(length), useDcZva, zvaLength));
+    }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLoweringProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLoweringProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64IndirectCallOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64IndirectCallOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/StubAVXTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/StubAVXTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -25,6 +25,7 @@
 
 package org.graalvm.compiler.hotspot.amd64.test;
 
+import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.COMPUTES_REGISTERS_KILLED;
 import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG;
 
 import org.graalvm.compiler.api.replacements.Snippet;
@@ -234,7 +235,8 @@
     public void test() {
         HotSpotProviders providers = (HotSpotProviders) getProviders();
         HotSpotForeignCallsProviderImpl foreignCalls = (HotSpotForeignCallsProviderImpl) providers.getForeignCalls();
-        HotSpotForeignCallLinkage linkage = foreignCalls.registerStubCall(TEST_STUB, HotSpotForeignCallLinkage.Transition.LEAF_NO_VZERO, HotSpotForeignCallLinkage.Reexecutability.REEXECUTABLE);
+        HotSpotForeignCallLinkage linkage = foreignCalls.registerStubCall(TEST_STUB, HotSpotForeignCallLinkage.Transition.LEAF_NO_VZERO, HotSpotForeignCallLinkage.Reexecutability.REEXECUTABLE,
+                        COMPUTES_REGISTERS_KILLED);
         linkage.setCompiledStub(new TestStub(getInitialOptions(), providers, linkage));
         runTest("testStub");
     }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/UnaryMathStubTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/UnaryMathStubTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64ArrayIndexOfStub.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64ArrayIndexOfStub.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackend.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackend.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -40,7 +40,6 @@
 import org.graalvm.compiler.asm.amd64.AMD64MacroAssembler;
 import org.graalvm.compiler.code.CompilationResult;
 import org.graalvm.compiler.core.amd64.AMD64NodeMatchRules;
-import org.graalvm.compiler.core.common.CompilationIdentifier;
 import org.graalvm.compiler.core.common.LIRKind;
 import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig;
 import org.graalvm.compiler.core.gen.LIRGenerationProvider;
@@ -91,7 +90,8 @@
         super(config, runtime, providers);
     }
 
-    private FrameMapBuilder newFrameMapBuilder(RegisterConfig registerConfig) {
+    @Override
+    protected FrameMapBuilder newFrameMapBuilder(RegisterConfig registerConfig) {
         RegisterConfig registerConfigNonNull = registerConfig == null ? getCodeCache().getRegisterConfig() : registerConfig;
         FrameMap frameMap = new AMD64FrameMap(getCodeCache(), registerConfigNonNull, this);
         return new AMD64FrameMapBuilder(frameMap, getCodeCache(), registerConfigNonNull);
@@ -103,12 +103,6 @@
     }
 
     @Override
-    public LIRGenerationResult newLIRGenerationResult(CompilationIdentifier compilationId, LIR lir, RegisterConfig registerConfig, StructuredGraph graph, Object stub) {
-        return new HotSpotLIRGenerationResult(compilationId, lir, newFrameMapBuilder(registerConfig), makeCallingConvention(graph, (Stub) stub), stub,
-                        config.requiresReservedStackCheck(graph.getMethods()));
-    }
-
-    @Override
     public NodeLIRBuilderTool newNodeLIRBuilder(StructuredGraph graph, LIRGeneratorTool lirGen) {
         return new AMD64HotSpotNodeLIRBuilder(graph, lirGen, new AMD64NodeMatchRules(lirGen));
     }
@@ -219,8 +213,7 @@
         }
 
         if (stub != null) {
-            EconomicSet<Register> destroyedCallerRegisters = gatherDestroyedCallerRegisters(lir);
-            updateStub(stub, destroyedCallerRegisters, gen.getCalleeSaveInfo(), frameMap);
+            updateStub(stub, gen, frameMap);
         }
 
         return crb;
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackendFactory.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackendFactory.java	Wed Sep 25 22:40:41 2019 +0200
@@ -148,7 +148,8 @@
                 replacements = createReplacements(target, p, snippetReflection, bytecodeProvider);
             }
             try (InitTimer rt = timer("create GraphBuilderPhase plugins")) {
-                plugins = createGraphBuilderPlugins(compilerConfiguration, config, target, constantReflection, foreignCalls, metaAccess, snippetReflection, replacements, wordTypes, options);
+                plugins = createGraphBuilderPlugins(graalRuntime, compilerConfiguration, config, target, constantReflection, foreignCalls, metaAccess, snippetReflection, replacements, wordTypes,
+                                options);
                 replacements.setGraphBuilderPlugins(plugins);
             }
             try (InitTimer rt = timer("create Suites provider")) {
@@ -163,10 +164,28 @@
         }
     }
 
-    protected Plugins createGraphBuilderPlugins(CompilerConfiguration compilerConfiguration, GraalHotSpotVMConfig config, TargetDescription target,
-                    HotSpotConstantReflectionProvider constantReflection, HotSpotHostForeignCallsProvider foreignCalls, HotSpotMetaAccessProvider metaAccess,
-                    HotSpotSnippetReflectionProvider snippetReflection, HotSpotReplacementsImpl replacements, HotSpotWordTypes wordTypes, OptionValues options) {
-        Plugins plugins = HotSpotGraphBuilderPlugins.create(compilerConfiguration, config, wordTypes, metaAccess, constantReflection, snippetReflection, foreignCalls, replacements, options);
+    protected Plugins createGraphBuilderPlugins(HotSpotGraalRuntimeProvider graalRuntime,
+                    CompilerConfiguration compilerConfiguration,
+                    GraalHotSpotVMConfig config,
+                    TargetDescription target,
+                    HotSpotConstantReflectionProvider constantReflection,
+                    HotSpotHostForeignCallsProvider foreignCalls,
+                    HotSpotMetaAccessProvider metaAccess,
+                    HotSpotSnippetReflectionProvider snippetReflection,
+                    HotSpotReplacementsImpl replacements,
+                    HotSpotWordTypes wordTypes,
+                    OptionValues options) {
+        Plugins plugins = HotSpotGraphBuilderPlugins.create(
+                        graalRuntime,
+                        compilerConfiguration,
+                        config,
+                        wordTypes,
+                        metaAccess,
+                        constantReflection,
+                        snippetReflection,
+                        foreignCalls,
+                        replacements,
+                        options);
         AMD64GraphBuilderPlugins.register(plugins, replacements.getDefaultReplacementBytecodeProvider(), (AMD64) target.arch, false, JavaVersionUtil.JAVA_SPEC >= 9, config.useFMAIntrinsics);
         return plugins;
     }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -34,7 +34,8 @@
 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.JUMP_ADDRESS;
 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Reexecutability.NOT_REEXECUTABLE;
 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Reexecutability.REEXECUTABLE;
-import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.PRESERVES_REGISTERS;
+import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.COMPUTES_REGISTERS_KILLED;
+import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.DESTROYS_ALL_CALLER_SAVE_REGISTERS;
 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition.LEAF;
 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition.LEAF_NO_VZERO;
 import static org.graalvm.compiler.hotspot.replacements.CRC32CSubstitutions.UPDATE_BYTES_CRC32C;
@@ -89,79 +90,80 @@
         RegisterValue exception = rax.asValue(LIRKind.reference(word));
         RegisterValue exceptionPc = rdx.asValue(LIRKind.value(word));
         CallingConvention exceptionCc = new CallingConvention(0, ILLEGAL, exception, exceptionPc);
-        register(new HotSpotForeignCallLinkageImpl(EXCEPTION_HANDLER, 0L, PRESERVES_REGISTERS, LEAF_NO_VZERO, NOT_REEXECUTABLE, exceptionCc, null, any()));
-        register(new HotSpotForeignCallLinkageImpl(EXCEPTION_HANDLER_IN_CALLER, JUMP_ADDRESS, PRESERVES_REGISTERS, LEAF_NO_VZERO, NOT_REEXECUTABLE, exceptionCc, null, any()));
+        register(new HotSpotForeignCallLinkageImpl(EXCEPTION_HANDLER, 0L, DESTROYS_ALL_CALLER_SAVE_REGISTERS, LEAF_NO_VZERO, NOT_REEXECUTABLE, exceptionCc, null, any()));
+        register(new HotSpotForeignCallLinkageImpl(EXCEPTION_HANDLER_IN_CALLER, JUMP_ADDRESS, DESTROYS_ALL_CALLER_SAVE_REGISTERS, LEAF_NO_VZERO, NOT_REEXECUTABLE, exceptionCc, null,
+                        any()));
 
         if (config.useCRC32Intrinsics) {
             // This stub does callee saving
-            registerForeignCall(UPDATE_BYTES_CRC32, config.updateBytesCRC32Stub, NativeCall, PRESERVES_REGISTERS, LEAF_NO_VZERO, NOT_REEXECUTABLE, any());
+            registerForeignCall(UPDATE_BYTES_CRC32, config.updateBytesCRC32Stub, NativeCall, LEAF_NO_VZERO, NOT_REEXECUTABLE, any());
         }
         if (config.useCRC32CIntrinsics) {
-            registerForeignCall(UPDATE_BYTES_CRC32C, config.updateBytesCRC32C, NativeCall, PRESERVES_REGISTERS, LEAF_NO_VZERO, NOT_REEXECUTABLE, any());
+            registerForeignCall(UPDATE_BYTES_CRC32C, config.updateBytesCRC32C, NativeCall, LEAF_NO_VZERO, NOT_REEXECUTABLE, any());
         }
 
         link(new AMD64ArrayIndexOfStub(AMD64ArrayIndexOf.STUB_INDEX_OF_TWO_CONSECUTIVE_BYTES, options, providers,
-                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_TWO_CONSECUTIVE_BYTES, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_TWO_CONSECUTIVE_BYTES, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayIndexOfStub(AMD64ArrayIndexOf.STUB_INDEX_OF_TWO_CONSECUTIVE_CHARS, options, providers,
-                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_TWO_CONSECUTIVE_CHARS, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_TWO_CONSECUTIVE_CHARS, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayIndexOfStub(AMD64ArrayIndexOf.STUB_INDEX_OF_TWO_CONSECUTIVE_CHARS_COMPACT, options, providers,
-                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_TWO_CONSECUTIVE_CHARS_COMPACT, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_TWO_CONSECUTIVE_CHARS_COMPACT, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayIndexOfStub(AMD64ArrayIndexOf.STUB_INDEX_OF_1_BYTE, options, providers,
-                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_1_BYTE, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_1_BYTE, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayIndexOfStub(AMD64ArrayIndexOf.STUB_INDEX_OF_2_BYTES, options, providers,
-                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_2_BYTES, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_2_BYTES, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayIndexOfStub(AMD64ArrayIndexOf.STUB_INDEX_OF_3_BYTES, options, providers,
-                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_3_BYTES, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_3_BYTES, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayIndexOfStub(AMD64ArrayIndexOf.STUB_INDEX_OF_4_BYTES, options, providers,
-                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_4_BYTES, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_4_BYTES, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayIndexOfStub(AMD64ArrayIndexOf.STUB_INDEX_OF_1_CHAR, options, providers,
-                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_1_CHAR, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_1_CHAR, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayIndexOfStub(AMD64ArrayIndexOf.STUB_INDEX_OF_2_CHARS, options, providers,
-                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_2_CHARS, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_2_CHARS, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayIndexOfStub(AMD64ArrayIndexOf.STUB_INDEX_OF_3_CHARS, options, providers,
-                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_3_CHARS, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_3_CHARS, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayIndexOfStub(AMD64ArrayIndexOf.STUB_INDEX_OF_4_CHARS, options, providers,
-                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_4_CHARS, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_4_CHARS, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayIndexOfStub(AMD64ArrayIndexOf.STUB_INDEX_OF_1_CHAR_COMPACT, options, providers,
-                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_1_CHAR_COMPACT, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_1_CHAR_COMPACT, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayIndexOfStub(AMD64ArrayIndexOf.STUB_INDEX_OF_2_CHARS_COMPACT, options, providers,
-                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_2_CHARS_COMPACT, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_2_CHARS_COMPACT, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayIndexOfStub(AMD64ArrayIndexOf.STUB_INDEX_OF_3_CHARS_COMPACT, options, providers,
-                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_3_CHARS_COMPACT, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_3_CHARS_COMPACT, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayIndexOfStub(AMD64ArrayIndexOf.STUB_INDEX_OF_4_CHARS_COMPACT, options, providers,
-                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_4_CHARS_COMPACT, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayIndexOf.STUB_INDEX_OF_4_CHARS_COMPACT, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
 
         link(new AMD64ArrayEqualsStub(AMD64ArrayEqualsStub.STUB_BOOLEAN_ARRAY_EQUALS, options, providers,
-                        registerStubCall(AMD64ArrayEqualsStub.STUB_BOOLEAN_ARRAY_EQUALS, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayEqualsStub.STUB_BOOLEAN_ARRAY_EQUALS, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayEqualsStub(AMD64ArrayEqualsStub.STUB_BYTE_ARRAY_EQUALS, options, providers,
-                        registerStubCall(AMD64ArrayEqualsStub.STUB_BYTE_ARRAY_EQUALS, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayEqualsStub.STUB_BYTE_ARRAY_EQUALS, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayEqualsStub(AMD64ArrayEqualsStub.STUB_CHAR_ARRAY_EQUALS, options, providers,
-                        registerStubCall(AMD64ArrayEqualsStub.STUB_CHAR_ARRAY_EQUALS, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayEqualsStub.STUB_CHAR_ARRAY_EQUALS, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayEqualsStub(AMD64ArrayEqualsStub.STUB_SHORT_ARRAY_EQUALS, options, providers,
-                        registerStubCall(AMD64ArrayEqualsStub.STUB_SHORT_ARRAY_EQUALS, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayEqualsStub.STUB_SHORT_ARRAY_EQUALS, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayEqualsStub(AMD64ArrayEqualsStub.STUB_INT_ARRAY_EQUALS, options, providers,
-                        registerStubCall(AMD64ArrayEqualsStub.STUB_INT_ARRAY_EQUALS, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayEqualsStub.STUB_INT_ARRAY_EQUALS, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayEqualsStub(AMD64ArrayEqualsStub.STUB_LONG_ARRAY_EQUALS, options, providers,
-                        registerStubCall(AMD64ArrayEqualsStub.STUB_LONG_ARRAY_EQUALS, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayEqualsStub.STUB_LONG_ARRAY_EQUALS, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayEqualsStub(AMD64ArrayEqualsStub.STUB_FLOAT_ARRAY_EQUALS, options, providers,
-                        registerStubCall(AMD64ArrayEqualsStub.STUB_FLOAT_ARRAY_EQUALS, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayEqualsStub.STUB_FLOAT_ARRAY_EQUALS, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayEqualsStub(AMD64ArrayEqualsStub.STUB_DOUBLE_ARRAY_EQUALS, options, providers,
-                        registerStubCall(AMD64ArrayEqualsStub.STUB_DOUBLE_ARRAY_EQUALS, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayEqualsStub.STUB_DOUBLE_ARRAY_EQUALS, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayEqualsStub(AMD64ArrayEqualsStub.STUB_BYTE_ARRAY_EQUALS_DIRECT, options, providers,
-                        registerStubCall(AMD64ArrayEqualsStub.STUB_BYTE_ARRAY_EQUALS_DIRECT, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayEqualsStub.STUB_BYTE_ARRAY_EQUALS_DIRECT, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayEqualsStub(AMD64ArrayEqualsStub.STUB_CHAR_ARRAY_EQUALS_DIRECT, options, providers,
-                        registerStubCall(AMD64ArrayEqualsStub.STUB_CHAR_ARRAY_EQUALS_DIRECT, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayEqualsStub.STUB_CHAR_ARRAY_EQUALS_DIRECT, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayEqualsStub(AMD64ArrayEqualsStub.STUB_CHAR_ARRAY_EQUALS_BYTE_ARRAY, options, providers,
-                        registerStubCall(AMD64ArrayEqualsStub.STUB_CHAR_ARRAY_EQUALS_BYTE_ARRAY, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayEqualsStub.STUB_CHAR_ARRAY_EQUALS_BYTE_ARRAY, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
 
         link(new AMD64ArrayCompareToStub(AMD64ArrayCompareToStub.STUB_BYTE_ARRAY_COMPARE_TO_BYTE_ARRAY, options, providers,
-                        registerStubCall(AMD64ArrayCompareToStub.STUB_BYTE_ARRAY_COMPARE_TO_BYTE_ARRAY, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayCompareToStub.STUB_BYTE_ARRAY_COMPARE_TO_BYTE_ARRAY, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayCompareToStub(AMD64ArrayCompareToStub.STUB_BYTE_ARRAY_COMPARE_TO_CHAR_ARRAY, options, providers,
-                        registerStubCall(AMD64ArrayCompareToStub.STUB_BYTE_ARRAY_COMPARE_TO_CHAR_ARRAY, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayCompareToStub.STUB_BYTE_ARRAY_COMPARE_TO_CHAR_ARRAY, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayCompareToStub(AMD64ArrayCompareToStub.STUB_CHAR_ARRAY_COMPARE_TO_BYTE_ARRAY, options, providers,
-                        registerStubCall(AMD64ArrayCompareToStub.STUB_CHAR_ARRAY_COMPARE_TO_BYTE_ARRAY, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayCompareToStub.STUB_CHAR_ARRAY_COMPARE_TO_BYTE_ARRAY, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         link(new AMD64ArrayCompareToStub(AMD64ArrayCompareToStub.STUB_CHAR_ARRAY_COMPARE_TO_CHAR_ARRAY, options, providers,
-                        registerStubCall(AMD64ArrayCompareToStub.STUB_CHAR_ARRAY_COMPARE_TO_CHAR_ARRAY, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+                        registerStubCall(AMD64ArrayCompareToStub.STUB_CHAR_ARRAY_COMPARE_TO_CHAR_ARRAY, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
 
         super.initialize(providers, options);
     }
@@ -174,13 +176,13 @@
     @Override
     protected void registerMathStubs(GraalHotSpotVMConfig hotSpotVMConfig, HotSpotProviders providers, OptionValues options) {
         if (GraalArithmeticStubs.getValue(options)) {
-            link(new AMD64MathStub(SIN, options, providers, registerStubCall(SIN.foreignCallDescriptor, LEAF, REEXECUTABLE, NO_LOCATIONS)));
-            link(new AMD64MathStub(COS, options, providers, registerStubCall(COS.foreignCallDescriptor, LEAF, REEXECUTABLE, NO_LOCATIONS)));
-            link(new AMD64MathStub(TAN, options, providers, registerStubCall(TAN.foreignCallDescriptor, LEAF, REEXECUTABLE, NO_LOCATIONS)));
-            link(new AMD64MathStub(EXP, options, providers, registerStubCall(EXP.foreignCallDescriptor, LEAF, REEXECUTABLE, NO_LOCATIONS)));
-            link(new AMD64MathStub(LOG, options, providers, registerStubCall(LOG.foreignCallDescriptor, LEAF, REEXECUTABLE, NO_LOCATIONS)));
-            link(new AMD64MathStub(LOG10, options, providers, registerStubCall(LOG10.foreignCallDescriptor, LEAF, REEXECUTABLE, NO_LOCATIONS)));
-            link(new AMD64MathStub(POW, options, providers, registerStubCall(POW.foreignCallDescriptor, LEAF, REEXECUTABLE, NO_LOCATIONS)));
+            link(new AMD64MathStub(SIN, options, providers, registerStubCall(SIN.foreignCallDescriptor, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
+            link(new AMD64MathStub(COS, options, providers, registerStubCall(COS.foreignCallDescriptor, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
+            link(new AMD64MathStub(TAN, options, providers, registerStubCall(TAN.foreignCallDescriptor, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
+            link(new AMD64MathStub(EXP, options, providers, registerStubCall(EXP.foreignCallDescriptor, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
+            link(new AMD64MathStub(LOG, options, providers, registerStubCall(LOG.foreignCallDescriptor, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
+            link(new AMD64MathStub(LOG10, options, providers, registerStubCall(LOG10.foreignCallDescriptor, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
+            link(new AMD64MathStub(POW, options, providers, registerStubCall(POW.foreignCallDescriptor, LEAF, REEXECUTABLE, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
         } else {
             super.registerMathStubs(hotSpotVMConfig, providers, options);
         }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotJumpToExceptionHandlerInCallerOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotJumpToExceptionHandlerInCallerOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java	Wed Sep 25 22:40:41 2019 +0200
@@ -299,7 +299,7 @@
              * machine instruction actually zeros _all_ XMM registers which is fine since we know
              * that their upper half is not used.
              */
-            append(new AMD64VZeroUpper(arguments));
+            append(new AMD64VZeroUpper(arguments, getRegisterConfig()));
         }
         super.emitForeignCallOp(linkage, result, arguments, temps, info);
     }
@@ -307,10 +307,9 @@
     /**
      * @param savedRegisters the registers saved by this operation which may be subject to pruning
      * @param savedRegisterLocations the slots to which the registers are saved
-     * @param supportsRemove determines if registers can be pruned
      */
-    protected AMD64SaveRegistersOp emitSaveRegisters(Register[] savedRegisters, AllocatableValue[] savedRegisterLocations, boolean supportsRemove) {
-        AMD64SaveRegistersOp save = new AMD64SaveRegistersOp(savedRegisters, savedRegisterLocations, supportsRemove);
+    protected AMD64SaveRegistersOp emitSaveRegisters(Register[] savedRegisters, AllocatableValue[] savedRegisterLocations) {
+        AMD64SaveRegistersOp save = new AMD64SaveRegistersOp(savedRegisters, savedRegisterLocations);
         append(save);
         return save;
     }
@@ -330,15 +329,19 @@
     /**
      * Adds a node to the graph that saves all allocatable registers to the stack.
      *
-     * @param supportsRemove determines if registers can be pruned
      * @return the register save node
      */
-    private AMD64SaveRegistersOp emitSaveAllRegisters(Register[] savedRegisters, boolean supportsRemove) {
+    private AMD64SaveRegistersOp emitSaveAllRegisters() {
+        Register[] savedRegisters = getSaveableRegisters();
         AllocatableValue[] savedRegisterLocations = new AllocatableValue[savedRegisters.length];
         for (int i = 0; i < savedRegisters.length; i++) {
             savedRegisterLocations[i] = allocateSaveRegisterLocation(savedRegisters[i]);
         }
-        return emitSaveRegisters(savedRegisters, savedRegisterLocations, supportsRemove);
+        return emitSaveRegisters(savedRegisters, savedRegisterLocations);
+    }
+
+    protected Register[] getSaveableRegisters() {
+        return getResult().getRegisterAllocationConfig().getAllocatableRegisters().toArray();
     }
 
     protected void emitRestoreRegisters(AMD64SaveRegistersOp save) {
@@ -369,11 +372,8 @@
 
         AMD64SaveRegistersOp save = null;
         Stub stub = getStub();
-        if (destroysRegisters) {
-            if (stub != null && stub.preservesRegisters()) {
-                Register[] savedRegisters = getRegisterConfig().getAllocatableRegisters().toArray();
-                save = emitSaveAllRegisters(savedRegisters, true);
-            }
+        if (destroysRegisters && stub != null && stub.shouldSaveRegistersAroundCalls()) {
+            save = emitSaveAllRegisters();
         }
 
         Variable result;
@@ -392,19 +392,15 @@
             result = super.emitForeignCall(hotspotLinkage, debugInfo, args);
         }
 
-        if (destroysRegisters) {
-            if (stub != null) {
-                if (stub.preservesRegisters()) {
-                    HotSpotLIRGenerationResult generationResult = getResult();
-                    LIRFrameState key = currentRuntimeCallInfo;
-                    if (key == null) {
-                        key = LIRFrameState.NO_STATE;
-                    }
-                    assert !generationResult.getCalleeSaveInfo().containsKey(key);
-                    generationResult.getCalleeSaveInfo().put(key, save);
-                    emitRestoreRegisters(save);
-                }
+        if (save != null) {
+            HotSpotLIRGenerationResult generationResult = getResult();
+            LIRFrameState key = currentRuntimeCallInfo;
+            if (key == null) {
+                key = LIRFrameState.NO_STATE;
             }
+            assert !generationResult.getCalleeSaveInfo().containsKey(key);
+            generationResult.getCalleeSaveInfo().put(key, save);
+            emitRestoreRegisters(save);
         }
 
         return result;
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotStrategySwitchOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotStrategySwitchOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64X87MathIntrinsicNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64X87MathIntrinsicNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64X87MathSnippets.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64X87MathSnippets.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.jdk9.test/src/org/graalvm/compiler/hotspot/jdk9/test/MathDoubleFMATest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.jdk9.test/src/org/graalvm/compiler/hotspot/jdk9/test/MathDoubleFMATest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -34,7 +34,6 @@
 import org.graalvm.compiler.core.test.GraalCompilerTest;
 import org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider;
 import org.graalvm.compiler.runtime.RuntimeProvider;
-import org.graalvm.compiler.test.AddExports;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -44,7 +43,6 @@
 
 import jdk.vm.ci.amd64.AMD64;
 
-@AddExports({"java.base/java.lang"})
 @RunWith(Parameterized.class)
 public final class MathDoubleFMATest extends GraalCompilerTest {
 
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.jdk9.test/src/org/graalvm/compiler/hotspot/jdk9/test/MathFMAConstantInputTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.jdk9.test/src/org/graalvm/compiler/hotspot/jdk9/test/MathFMAConstantInputTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -27,13 +27,11 @@
 import static org.junit.Assume.assumeTrue;
 
 import org.graalvm.compiler.core.test.GraalCompilerTest;
-import org.graalvm.compiler.test.AddExports;
 import org.junit.Before;
 import org.junit.Test;
 
 import jdk.vm.ci.amd64.AMD64;
 
-@AddExports({"java.base/java.lang"})
 public final class MathFMAConstantInputTest extends GraalCompilerTest {
 
     @Before
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.jdk9.test/src/org/graalvm/compiler/hotspot/jdk9/test/MathFloatFMATest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.jdk9.test/src/org/graalvm/compiler/hotspot/jdk9/test/MathFloatFMATest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -34,7 +34,6 @@
 import org.graalvm.compiler.core.test.GraalCompilerTest;
 import org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider;
 import org.graalvm.compiler.runtime.RuntimeProvider;
-import org.graalvm.compiler.test.AddExports;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -44,7 +43,6 @@
 
 import jdk.vm.ci.amd64.AMD64;
 
-@AddExports({"java.base/java.lang"})
 @RunWith(Parameterized.class)
 public final class MathFloatFMATest extends GraalCompilerTest {
 
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.jdk9.test/src/org/graalvm/compiler/hotspot/jdk9/test/StringUTF16ToBytesGetCharsTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.jdk9.test/src/org/graalvm/compiler/hotspot/jdk9/test/StringUTF16ToBytesGetCharsTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.lir.test/src/org/graalvm/compiler/hotspot/lir/test/BenchmarkCounterOverflowTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.lir.test/src/org/graalvm/compiler/hotspot/lir/test/BenchmarkCounterOverflowTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -106,6 +106,7 @@
         List<String> vmArgs = withoutDebuggerArguments(getVMCommandLine());
         vmArgs.add("-XX:JVMCICounterSize=1");
         vmArgs.add("-Dgraal." + BenchmarkCounters.Options.AbortOnBenchmarkCounterOverflow.getName() + "=true");
+        vmArgs.addAll(SubprocessUtil.getPackageOpeningOptions());
         vmArgs.add("-D" + SUBPROCESS_PROPERTY + "=true");
 
         // Disable increment range checks (e.g. HotSpotCounterOp.checkIncrements())
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackend.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackend.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -48,7 +48,6 @@
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
-import jdk.internal.vm.compiler.collections.EconomicMap;
 import jdk.internal.vm.compiler.collections.EconomicSet;
 import jdk.internal.vm.compiler.collections.Equivalence;
 import org.graalvm.compiler.asm.Assembler;
@@ -60,7 +59,6 @@
 import org.graalvm.compiler.code.CompilationResult;
 import org.graalvm.compiler.code.DataSection;
 import org.graalvm.compiler.code.DataSection.Data;
-import org.graalvm.compiler.core.common.CompilationIdentifier;
 import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig;
 import org.graalvm.compiler.core.common.cfg.AbstractBlockBase;
 import org.graalvm.compiler.core.gen.LIRGenerationProvider;
@@ -77,9 +75,7 @@
 import org.graalvm.compiler.hotspot.stubs.Stub;
 import org.graalvm.compiler.lir.InstructionValueConsumer;
 import org.graalvm.compiler.lir.LIR;
-import org.graalvm.compiler.lir.LIRFrameState;
 import org.graalvm.compiler.lir.LIRInstruction;
-import org.graalvm.compiler.lir.StandardOp.SaveRegistersOp;
 import org.graalvm.compiler.lir.asm.CompilationResultBuilder;
 import org.graalvm.compiler.lir.asm.CompilationResultBuilderFactory;
 import org.graalvm.compiler.lir.asm.DataBuilder;
@@ -135,7 +131,8 @@
         }
     }
 
-    private FrameMapBuilder newFrameMapBuilder(RegisterConfig registerConfig) {
+    @Override
+    protected FrameMapBuilder newFrameMapBuilder(RegisterConfig registerConfig) {
         RegisterConfig registerConfigNonNull = registerConfig == null ? getCodeCache().getRegisterConfig() : registerConfig;
         FrameMap frameMap = new SPARCFrameMap(getCodeCache(), registerConfigNonNull, this);
         return new SPARCFrameMapBuilder(frameMap, getCodeCache(), registerConfigNonNull);
@@ -147,12 +144,6 @@
     }
 
     @Override
-    public LIRGenerationResult newLIRGenerationResult(CompilationIdentifier compilationId, LIR lir, RegisterConfig registerConfig, StructuredGraph graph, Object stub) {
-        return new HotSpotLIRGenerationResult(compilationId, lir, newFrameMapBuilder(registerConfig), makeCallingConvention(graph, (Stub) stub), stub,
-                        config.requiresReservedStackCheck(graph.getMethods()));
-    }
-
-    @Override
     public NodeLIRBuilderTool newNodeLIRBuilder(StructuredGraph graph, LIRGeneratorTool lirGen) {
         return new SPARCHotSpotNodeLIRBuilder(graph, lirGen, new SPARCNodeMatchRules(lirGen));
     }
@@ -246,10 +237,7 @@
         }
 
         if (stub != null) {
-            // Even on sparc we need to save floating point registers
-            EconomicSet<Register> destroyedCallerRegisters = gatherDestroyedCallerRegisters(lir);
-            EconomicMap<LIRFrameState, SaveRegistersOp> calleeSaveInfo = gen.getCalleeSaveInfo();
-            updateStub(stub, destroyedCallerRegisters, calleeSaveInfo, frameMap);
+            updateStub(stub, gen, frameMap);
         }
         assert registerSizePredictionValidator(crb, debug);
         return crb;
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackendFactory.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackendFactory.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -105,7 +105,8 @@
         HotSpotSnippetReflectionProvider snippetReflection = createSnippetReflection(runtime, constantReflection, wordTypes);
         BytecodeProvider bytecodeProvider = createBytecodeProvider(metaAccess, snippetReflection);
         HotSpotReplacementsImpl replacements = createReplacements(target, p, snippetReflection, bytecodeProvider);
-        Plugins plugins = createGraphBuilderPlugins(compilerConfiguration, config, metaAccess, constantReflection, foreignCalls, snippetReflection, replacements, wordTypes, runtime.getOptions());
+        Plugins plugins = createGraphBuilderPlugins(runtime, compilerConfiguration, config, metaAccess, constantReflection, foreignCalls, snippetReflection, replacements, wordTypes,
+                        runtime.getOptions());
         replacements.setGraphBuilderPlugins(plugins);
         HotSpotSuitesProvider suites = createSuites(config, runtime, compilerConfiguration, plugins, replacements);
         HotSpotProviders providers = new HotSpotProviders(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, suites, registers,
@@ -115,10 +116,27 @@
         return createBackend(config, runtime, providers);
     }
 
-    protected Plugins createGraphBuilderPlugins(CompilerConfiguration compilerConfiguration, GraalHotSpotVMConfig config, HotSpotMetaAccessProvider metaAccess,
-                    HotSpotConstantReflectionProvider constantReflection, HotSpotForeignCallsProvider foreignCalls,
-                    HotSpotSnippetReflectionProvider snippetReflection, HotSpotReplacementsImpl replacements, HotSpotWordTypes wordTypes, OptionValues options) {
-        Plugins plugins = HotSpotGraphBuilderPlugins.create(compilerConfiguration, config, wordTypes, metaAccess, constantReflection, snippetReflection, foreignCalls, replacements, options);
+    protected Plugins createGraphBuilderPlugins(HotSpotGraalRuntimeProvider graalRuntime,
+                    CompilerConfiguration compilerConfiguration,
+                    GraalHotSpotVMConfig config,
+                    HotSpotMetaAccessProvider metaAccess,
+                    HotSpotConstantReflectionProvider constantReflection,
+                    HotSpotForeignCallsProvider foreignCalls,
+                    HotSpotSnippetReflectionProvider snippetReflection,
+                    HotSpotReplacementsImpl replacements,
+                    HotSpotWordTypes wordTypes,
+                    OptionValues options) {
+        Plugins plugins = HotSpotGraphBuilderPlugins.create(
+                        graalRuntime,
+                        compilerConfiguration,
+                        config,
+                        wordTypes,
+                        metaAccess,
+                        constantReflection,
+                        snippetReflection,
+                        foreignCalls,
+                        replacements,
+                        options);
         SPARCGraphBuilderPlugins.register(plugins, replacements.getDefaultReplacementBytecodeProvider(), false);
         return plugins;
     }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -33,8 +33,8 @@
 import static org.graalvm.compiler.hotspot.HotSpotBackend.EXCEPTION_HANDLER;
 import static org.graalvm.compiler.hotspot.HotSpotBackend.EXCEPTION_HANDLER_IN_CALLER;
 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.JUMP_ADDRESS;
+import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.DESTROYS_ALL_CALLER_SAVE_REGISTERS;
 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Reexecutability.NOT_REEXECUTABLE;
-import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.PRESERVES_REGISTERS;
 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition.LEAF_NO_VZERO;
 import static org.graalvm.compiler.hotspot.replacements.CRC32CSubstitutions.UPDATE_BYTES_CRC32C;
 import static org.graalvm.compiler.hotspot.replacements.CRC32Substitutions.UPDATE_BYTES_CRC32;
@@ -84,16 +84,18 @@
         RegisterValue incomingExceptionPc = i1.asValue(LIRKind.value(word));
         CallingConvention outgoingExceptionCc = new CallingConvention(0, ILLEGAL, outgoingException, outgoingExceptionPc);
         CallingConvention incomingExceptionCc = new CallingConvention(0, ILLEGAL, incomingException, incomingExceptionPc);
-        register(new HotSpotForeignCallLinkageImpl(EXCEPTION_HANDLER, 0L, PRESERVES_REGISTERS, LEAF_NO_VZERO, NOT_REEXECUTABLE, outgoingExceptionCc, incomingExceptionCc, any()));
-        register(new HotSpotForeignCallLinkageImpl(EXCEPTION_HANDLER_IN_CALLER, JUMP_ADDRESS, PRESERVES_REGISTERS, LEAF_NO_VZERO, NOT_REEXECUTABLE, outgoingExceptionCc,
+        register(new HotSpotForeignCallLinkageImpl(EXCEPTION_HANDLER, 0L, DESTROYS_ALL_CALLER_SAVE_REGISTERS, LEAF_NO_VZERO, NOT_REEXECUTABLE, outgoingExceptionCc,
+                        incomingExceptionCc,
+                        any()));
+        register(new HotSpotForeignCallLinkageImpl(EXCEPTION_HANDLER_IN_CALLER, JUMP_ADDRESS, DESTROYS_ALL_CALLER_SAVE_REGISTERS, LEAF_NO_VZERO, NOT_REEXECUTABLE, outgoingExceptionCc,
                         incomingExceptionCc, any()));
 
         if (config.useCRC32Intrinsics) {
             // This stub does callee saving
-            registerForeignCall(UPDATE_BYTES_CRC32, config.updateBytesCRC32Stub, NativeCall, PRESERVES_REGISTERS, LEAF_NO_VZERO, NOT_REEXECUTABLE, any());
+            registerForeignCall(UPDATE_BYTES_CRC32, config.updateBytesCRC32Stub, NativeCall, LEAF_NO_VZERO, NOT_REEXECUTABLE, any());
         }
         if (config.useCRC32CIntrinsics) {
-            registerForeignCall(UPDATE_BYTES_CRC32C, config.updateBytesCRC32C, NativeCall, PRESERVES_REGISTERS, LEAF_NO_VZERO, NOT_REEXECUTABLE, any());
+            registerForeignCall(UPDATE_BYTES_CRC32C, config.updateBytesCRC32C, NativeCall, LEAF_NO_VZERO, NOT_REEXECUTABLE, any());
         }
 
         super.initialize(providers, options);
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRGenerator.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRGenerator.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -28,6 +28,7 @@
 import static jdk.vm.ci.sparc.SPARCKind.XWORD;
 import static org.graalvm.compiler.lir.LIRValueUtil.asConstant;
 import static org.graalvm.compiler.lir.LIRValueUtil.isConstantValue;
+import static org.graalvm.compiler.lir.StandardOp.ZapRegistersOp;
 
 import org.graalvm.compiler.asm.sparc.SPARCAssembler;
 import org.graalvm.compiler.core.common.CompressEncoding;
@@ -53,7 +54,6 @@
 import org.graalvm.compiler.lir.LIRFrameState;
 import org.graalvm.compiler.lir.LIRInstruction;
 import org.graalvm.compiler.lir.LabelRef;
-import org.graalvm.compiler.lir.StandardOp.SaveRegistersOp;
 import org.graalvm.compiler.lir.SwitchStrategy;
 import org.graalvm.compiler.lir.Variable;
 import org.graalvm.compiler.lir.VirtualStackSlot;
@@ -349,10 +349,9 @@
     /**
      * @param savedRegisters the registers saved by this operation which may be subject to pruning
      * @param savedRegisterLocations the slots to which the registers are saved
-     * @param supportsRemove determines if registers can be pruned
      */
-    protected SPARCSaveRegistersOp emitSaveRegisters(Register[] savedRegisters, AllocatableValue[] savedRegisterLocations, boolean supportsRemove) {
-        SPARCSaveRegistersOp save = new SPARCSaveRegistersOp(savedRegisters, savedRegisterLocations, supportsRemove);
+    protected SPARCSaveRegistersOp emitSaveRegisters(Register[] savedRegisters, AllocatableValue[] savedRegisterLocations) {
+        SPARCSaveRegistersOp save = new SPARCSaveRegistersOp(savedRegisters, savedRegisterLocations);
         append(save);
         return save;
     }
@@ -402,7 +401,7 @@
     }
 
     @Override
-    public SaveRegistersOp createZapRegisters(Register[] zappedRegisters, JavaConstant[] zapValues) {
+    public ZapRegistersOp createZapRegisters(Register[] zappedRegisters, JavaConstant[] zapValues) {
         throw GraalError.unimplemented();
     }
 
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLoweringProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLoweringProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMove.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMove.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/AheadOfTimeCompilationTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/AheadOfTimeCompilationTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -179,7 +179,7 @@
         StructuredGraph result = compile("getBoxedBoolean", true);
 
         assertDeepEquals(0, result.getNodes().filter(FloatingReadNode.class).count());
-        assertDeepEquals(0, result.getNodes(PiNode.TYPE).count());
+        assertDeepEquals(0, result.getNodes().filter(PiNode.class).count());
         assertDeepEquals(1, getConstantNodes(result).count());
         ConstantNode constant = getConstantNodes(result).first();
         assertDeepEquals(JavaKind.Object, constant.getStackKind());
@@ -192,7 +192,7 @@
     public void testBoxedBoolean() {
         StructuredGraph result = compile("getBoxedBoolean", false);
         assertDeepEquals(0, result.getNodes().filter(FloatingReadNode.class).count());
-        assertDeepEquals(0, result.getNodes(PiNode.TYPE).count());
+        assertDeepEquals(0, result.getNodes().filter(PiNode.class).count());
         assertDeepEquals(1, getConstantNodes(result).count());
         ConstantNode constant = getConstantNodes(result).first();
         assertDeepEquals(JavaKind.Object, constant.getStackKind());
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ArrayCopyIntrinsificationTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ArrayCopyIntrinsificationTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CRC32CSubstitutionsTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CRC32CSubstitutionsTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompilationWrapperTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompilationWrapperTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -24,6 +24,7 @@
 
 package org.graalvm.compiler.hotspot.test;
 
+import static org.graalvm.compiler.test.SubprocessUtil.getPackageOpeningOptions;
 import static org.graalvm.compiler.test.SubprocessUtil.getVMCommandLine;
 import static org.graalvm.compiler.test.SubprocessUtil.withoutDebuggerArguments;
 
@@ -50,6 +51,13 @@
  */
 public class CompilationWrapperTest extends GraalCompilerTest {
 
+    private static List<String> join(List<String> l1, List<String> l2) {
+        ArrayList<String> result = new ArrayList<>(l1.size() + l2.size());
+        result.addAll(l1);
+        result.addAll(l2);
+        return result;
+    }
+
     /**
      * Tests compilation requested by the VM.
      */
@@ -152,10 +160,11 @@
     public void testTruffleCompilation1() throws IOException, InterruptedException {
         assumeManagementLibraryIsLoadable();
         testHelper(Collections.emptyList(),
-                        Arrays.asList(
-                                        "-Dgraal.CompilationFailureAction=ExitVM",
-                                        "-Dgraal.TrufflePerformanceWarningsAreFatal=true",
-                                        "-Dgraal.CrashAt=root test1"),
+                        join(getPackageOpeningOptions(),
+                                        Arrays.asList(
+                                                        "-Dgraal.CompilationFailureAction=ExitVM",
+                                                        "-Dgraal.TrufflePerformanceWarningsAreFatal=true",
+                                                        "-Dgraal.CrashAt=root test1")),
                         "org.graalvm.compiler.truffle.test.SLTruffleGraalTestSuite", "test");
     }
 
@@ -168,10 +177,11 @@
                         new Probe("Exiting VM due to TruffleCompilationExceptionsAreFatal=true", 1),
         };
         testHelper(Arrays.asList(probes),
-                        Arrays.asList(
-                                        "-Dgraal.CompilationFailureAction=Silent",
-                                        "-Dgraal.TruffleCompilationExceptionsAreFatal=true",
-                                        "-Dgraal.CrashAt=root test1"),
+                        join(getPackageOpeningOptions(),
+                                        Arrays.asList(
+                                                        "-Dgraal.CompilationFailureAction=Silent",
+                                                        "-Dgraal.TruffleCompilationExceptionsAreFatal=true",
+                                                        "-Dgraal.CrashAt=root test1")),
                         "org.graalvm.compiler.truffle.test.SLTruffleGraalTestSuite", "test");
     }
 
@@ -185,10 +195,11 @@
                         new Probe("Exiting VM due to TrufflePerformanceWarningsAreFatal=true", 1),
         };
         testHelper(Arrays.asList(probes),
-                        Arrays.asList(
-                                        "-Dgraal.CompilationFailureAction=Silent",
-                                        "-Dgraal.TrufflePerformanceWarningsAreFatal=true",
-                                        "-Dgraal.CrashAt=root test1:PermanentBailout"),
+                        join(getPackageOpeningOptions(),
+                                        Arrays.asList(
+                                                        "-Dgraal.CompilationFailureAction=Silent",
+                                                        "-Dgraal.TrufflePerformanceWarningsAreFatal=true",
+                                                        "-Dgraal.CrashAt=root test1:PermanentBailout")),
                         "org.graalvm.compiler.truffle.test.SLTruffleGraalTestSuite", "test");
     }
 
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompileTheWorld.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompileTheWorld.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -30,7 +30,10 @@
 import static org.graalvm.compiler.core.GraalCompilerOptions.CompilationFailureAction;
 import static org.graalvm.compiler.core.test.ReflectionOptionDescriptors.extractEntries;
 import static org.graalvm.compiler.debug.MemUseTrackerKey.getCurrentThreadAllocatedBytes;
+import static org.graalvm.compiler.hotspot.CompilationTask.CompilationTime;
+import static org.graalvm.compiler.hotspot.CompilationTask.CompiledAndInstalledBytecodes;
 import static org.graalvm.compiler.hotspot.test.CompileTheWorld.Options.DESCRIPTORS;
+import static org.graalvm.compiler.hotspot.test.CompileTheWorld.Options.InvalidateInstalledCode;
 import static sun.misc.Unsafe.ARRAY_BYTE_BASE_OFFSET;
 
 import java.io.ByteArrayOutputStream;
@@ -81,12 +84,15 @@
 import org.graalvm.compiler.core.phases.HighTier;
 import org.graalvm.compiler.core.test.ReflectionOptionDescriptors;
 import org.graalvm.compiler.debug.DebugOptions;
+import org.graalvm.compiler.debug.GlobalMetrics;
 import org.graalvm.compiler.debug.GraalError;
 import org.graalvm.compiler.debug.MethodFilter;
+import org.graalvm.compiler.debug.MetricKey;
 import org.graalvm.compiler.debug.TTY;
 import org.graalvm.compiler.hotspot.CompilationTask;
 import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig;
 import org.graalvm.compiler.hotspot.HotSpotGraalCompiler;
+import org.graalvm.compiler.hotspot.HotSpotGraalRuntime;
 import org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider;
 import org.graalvm.compiler.hotspot.test.CompileTheWorld.LibGraalParams.StackTraceBuffer;
 import org.graalvm.compiler.options.OptionDescriptors;
@@ -95,6 +101,7 @@
 import org.graalvm.compiler.options.OptionsParser;
 import org.graalvm.compiler.serviceprovider.GraalUnsafeAccess;
 import org.graalvm.compiler.serviceprovider.JavaVersionUtil;
+import org.graalvm.compiler.test.ModuleSupport;
 import jdk.internal.vm.compiler.libgraal.LibGraal;
 import jdk.internal.vm.compiler.libgraal.LibGraalScope;
 import jdk.internal.vm.compiler.libgraal.OptionsEncoder;
@@ -116,6 +123,10 @@
  */
 public final class CompileTheWorld {
 
+    static {
+        ModuleSupport.exportAndOpenAllPackagesToUnnamed("jdk.internal.vm.compiler");
+    }
+
     /**
      * Magic token to denote that JDK classes are to be compiled. For JDK 8, the classes in
      * {@code rt.jar} are compiled. Otherwise the classes in the Java runtime image are compiled.
@@ -383,7 +394,7 @@
                         Options.MaxClasses.getValue(harnessOptions),
                         Options.MethodFilter.getValue(harnessOptions),
                         Options.ExcludeMethodFilter.getValue(harnessOptions),
-                        Options.Verbose.getValue(harnessOptions),
+                        Options.Verbose.hasBeenSet(harnessOptions) ? Options.Verbose.getValue(harnessOptions) : !Options.MultiThreaded.getValue(harnessOptions),
                         harnessOptions,
                         new OptionValues(compilerOptions, parseOptions(Options.Config.getValue(harnessOptions))));
     }
@@ -419,13 +430,6 @@
         }
     }
 
-    private AutoCloseable enterCompilation() {
-        if (!LibGraal.isAvailable()) {
-            return null;
-        }
-        return new LibGraalParams(compilerOptions);
-    }
-
     public void println() {
         println("");
     }
@@ -672,7 +676,7 @@
     @SuppressWarnings("try")
     private void compile(String classPath, LibGraalParams libgraal) throws IOException {
         final String[] entries = classPath.split(File.pathSeparator);
-        long start = System.currentTimeMillis();
+        long start = System.nanoTime();
         Map<Thread, StackTraceElement[]> initialThreads = Thread.getAllStackTraces();
 
         if (libgraal == null) {
@@ -802,7 +806,7 @@
                         // Are we compiling this class?
                         if (classFileCounter >= compileStartAt) {
 
-                            long start0 = System.currentTimeMillis();
+                            long start0 = System.nanoTime();
                             // Compile each constructor/method in the class.
                             for (Constructor<?> constructor : javaClass.getDeclaredConstructors()) {
                                 HotSpotResolvedJavaMethod javaMethod = (HotSpotResolvedJavaMethod) metaAccess.lookupJavaMethod(constructor);
@@ -822,7 +826,7 @@
                             if (clinit != null && canBeCompiled(clinit, clinit.getModifiers())) {
                                 compileMethod(clinit, libgraal);
                             }
-                            println("CompileTheWorld (%d) : %s (%d ms)", classFileCounter, className, System.currentTimeMillis() - start0);
+                            println("CompileTheWorld (%d) : %s (%d us)", classFileCounter, className, (System.nanoTime() - start0) / 1000);
                         }
                     } catch (Throwable t) {
                         if (isClassIncluded(className)) {
@@ -838,9 +842,11 @@
             startThreads();
         }
         int wakeups = 0;
-        while (threadPool.getCompletedTaskCount() != threadPool.getTaskCount()) {
+        long lastCompletedTaskCount = 0;
+        for (long completedTaskCount = threadPool.getCompletedTaskCount(); completedTaskCount != threadPool.getTaskCount(); completedTaskCount = threadPool.getCompletedTaskCount()) {
             if (wakeups % 15 == 0) {
-                TTY.println("CompileTheWorld : Waiting for " + (threadPool.getTaskCount() - threadPool.getCompletedTaskCount()) + " compiles");
+                TTY.printf("CompileTheWorld : Waiting for %d compiles, just completed %d compiles%n", threadPool.getTaskCount() - completedTaskCount, completedTaskCount - lastCompletedTaskCount);
+                lastCompletedTaskCount = completedTaskCount;
             }
             try {
                 threadPool.awaitTermination(1, TimeUnit.SECONDS);
@@ -848,19 +854,32 @@
             } catch (InterruptedException e) {
             }
         }
+        threadPool.shutdown();
         threadPool = null;
 
-        long elapsedTime = System.currentTimeMillis() - start;
+        long elapsedTime = System.nanoTime() - start;
 
         println();
         int compiledClasses = classFileCounter > compileStartAt ? classFileCounter - compileStartAt : 0;
         if (Options.MultiThreaded.getValue(harnessOptions)) {
             TTY.println("CompileTheWorld : Done (%d classes, %d methods, %d ms elapsed, %d ms compile time, %d bytes of memory used)", compiledClasses, compiledMethodsCounter.get(), elapsedTime,
-                            compileTime.get(), memoryUsed.get());
+                            compileTime.get() / 1000000, memoryUsed.get());
         } else {
             TTY.println("CompileTheWorld : Done (%d classes, %d methods, %d ms, %d bytes of memory used)", compiledClasses, compiledMethodsCounter.get(), compileTime.get(), memoryUsed.get());
         }
 
+        GlobalMetrics metricValues = ((HotSpotGraalRuntime) compiler.getGraalRuntime()).getMetricValues();
+        EconomicMap<MetricKey, Long> map = metricValues.asKeyValueMap();
+        Long compiledAndInstalledBytecodes = map.get(CompiledAndInstalledBytecodes);
+        Long compilationTime = map.get(CompilationTime);
+        if (compiledAndInstalledBytecodes != null && compilationTime != null) {
+            TTY.println("CompileTheWorld : Aggregate compile speed %d bytecodes per second (%d / %d)", (int) (compiledAndInstalledBytecodes / (compilationTime / 1000000000.0)),
+                            compiledAndInstalledBytecodes, compilationTime);
+        }
+
+        metricValues.print(compilerOptions);
+        metricValues.clear();
+
         // Apart from the main thread, there should be only be daemon threads
         // alive now. If not, then a class initializer has probably started
         // a thread that could cause a deadlock while trying to exit the VM.
@@ -926,6 +945,10 @@
 
     private static final Unsafe UNSAFE = GraalUnsafeAccess.getUnsafe();
 
+    /**
+     * Implemented by
+     * {@code com.oracle.svm.graal.hotspot.libgraal.LibGraalEntryPoints.compileMethod}.
+     */
     static native long compileMethodInLibgraal(long isolateThread,
                     long methodHandle,
                     boolean useProfilingInfo,
@@ -942,7 +965,7 @@
     @SuppressWarnings("try")
     private void compileMethod(HotSpotResolvedJavaMethod method, int counter, LibGraalParams libgraal) {
         try {
-            long start = System.currentTimeMillis();
+            long start = System.nanoTime();
             long allocatedAtStart = getCurrentThreadAllocatedBytes();
             // For more stable CTW execution, disable use of profiling information
             boolean useProfilingInfo = false;
@@ -973,8 +996,8 @@
                         byte[] data = new byte[length];
                         UNSAFE.copyMemory(null, stackTraceBufferAddress + Integer.BYTES, data, ARRAY_BYTE_BASE_OFFSET, length);
                         String stackTrace = new String(data).trim();
-                        println("CompileTheWorld (%d) : Error compiling method: %s", counter, method.format("%H.%n(%p):%r"));
-                        println(stackTrace);
+                        println(true, String.format("CompileTheWorld (%d) : Error compiling method: %s", counter, method.format("%H.%n(%p):%r")));
+                        println(true, stackTrace);
                     }
                 }
             } else {
@@ -986,12 +1009,12 @@
             }
 
             // Invalidate the generated code so the code cache doesn't fill up
-            if (installedCode != null) {
+            if (installedCode != null && InvalidateInstalledCode.getValue(compilerOptions)) {
                 installedCode.invalidate();
             }
 
             memoryUsed.getAndAdd(getCurrentThreadAllocatedBytes() - allocatedAtStart);
-            compileTime.getAndAdd(System.currentTimeMillis() - start);
+            compileTime.getAndAdd(System.nanoTime() - start);
             compiledMethodsCounter.incrementAndGet();
         } catch (Throwable t) {
             // Catch everything and print a message
@@ -1048,12 +1071,13 @@
         public static final OptionKey<String> Config = new OptionKey<>(null);
         public static final OptionKey<Boolean> MultiThreaded = new OptionKey<>(false);
         public static final OptionKey<Integer> Threads = new OptionKey<>(0);
+        public static final OptionKey<Boolean> InvalidateInstalledCode = new OptionKey<>(false);
 
         // @formatter:off
         static final ReflectionOptionDescriptors DESCRIPTORS = new ReflectionOptionDescriptors(Options.class,
                            "Help", "List options and their help messages and then exit.",
                       "Classpath", "Class path denoting methods to compile. Default is to compile boot classes.",
-                        "Verbose", "Verbose operation.",
+                        "Verbose", "Verbose operation. Default is !MultiThreaded.",
                    "LimitModules", "Comma separated list of module names to which compilation should be limited. " +
                                    "Module names can be prefixed with \"~\" to exclude the named module.",
                      "Iterations", "The number of iterations to perform.",
@@ -1098,6 +1122,11 @@
 
             CompileTheWorld ctw = new CompileTheWorld(jvmciRuntime, compiler, harnessOptions, graalRuntime.getOptions());
             ctw.compile();
+            if (iterations > 1) {
+                // Force a GC to encourage reclamation of nmethods when their InstalledCode
+                // reference has been dropped.
+                System.gc();
+            }
         }
         // This is required as non-daemon threads can be started by class initializers
         System.exit(0);
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompileTheWorldTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompileTheWorldTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompressedOopTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompressedOopTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ConstantPoolSubstitutionsTests.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ConstantPoolSubstitutionsTests.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -25,7 +25,7 @@
 
 package org.graalvm.compiler.hotspot.test;
 
-import static org.graalvm.compiler.test.JLModule.uncheckedAddExports;
+import static org.graalvm.compiler.serviceprovider.JavaVersionUtil.JAVA_SPEC;
 
 import java.lang.reflect.Method;
 
@@ -36,7 +36,7 @@
 import org.graalvm.compiler.nodes.StructuredGraph;
 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions;
 import org.graalvm.compiler.serviceprovider.JavaVersionUtil;
-import org.graalvm.compiler.test.JLModule;
+import org.graalvm.compiler.test.ModuleSupport;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.objectweb.asm.ClassWriter;
@@ -109,19 +109,12 @@
     }
 
     /**
-     * This test uses some API hidden by the JDK9 module system.
+     * This test uses some non-public API.
      */
     private static void addExports(Class<?> c) {
-        if (JavaVersionUtil.JAVA_SPEC > 8) {
-            Object javaBaseModule = JLModule.fromClass(String.class);
-            Object cModule = JLModule.fromClass(c);
-            uncheckedAddExports(javaBaseModule, "jdk.internal.reflect", cModule);
-            if (JavaVersionUtil.JAVA_SPEC <= 11) {
-                uncheckedAddExports(javaBaseModule, "jdk.internal.misc", cModule);
-            } else {
-                uncheckedAddExports(javaBaseModule, "jdk.internal.access", cModule);
-            }
-        }
+        String packageName = JAVA_SPEC <= 11 ? "jdk.internal.misc" : "jdk.internal.access";
+        ModuleSupport.exportPackageTo(String.class, packageName, c);
+        ModuleSupport.exportPackageTo(String.class, "jdk.internal.reflect", c);
     }
 
     @Test
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/EliminateRedundantInitializationPhaseTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/EliminateRedundantInitializationPhaseTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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,7 +25,7 @@
 package org.graalvm.compiler.hotspot.test;
 
 import org.graalvm.compiler.core.test.GraalCompilerTest;
-import org.graalvm.compiler.hotspot.meta.HotSpotClassInitializationPlugin;
+import org.graalvm.compiler.hotspot.meta.HotSpotAOTClassInitializationPlugin;
 import org.graalvm.compiler.hotspot.nodes.aot.InitializeKlassNode;
 import org.graalvm.compiler.hotspot.phases.aot.EliminateRedundantInitializationPhase;
 import org.graalvm.compiler.nodes.StructuredGraph;
@@ -39,7 +39,7 @@
     @Override
     protected Plugins getDefaultGraphBuilderPlugins() {
         Plugins plugins = super.getDefaultGraphBuilderPlugins();
-        plugins.setClassInitializationPlugin(new HotSpotClassInitializationPlugin());
+        plugins.setClassInitializationPlugin(new HotSpotAOTClassInitializationPlugin());
         return plugins;
     }
 
@@ -219,6 +219,8 @@
 
     @Test
     public void test12() {
+        // Force initialization of SomeClass
+        SomeClass.inlinedMethod();
         test("invokestaticInlined", 1, 1);
     }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTestBase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTestBase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotClassInitializationTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,159 @@
+/*
+ * 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 org.graalvm.compiler.hotspot.test;
+
+import static org.junit.Assert.assertNotEquals;
+
+import org.graalvm.compiler.api.directives.GraalDirectives;
+import org.graalvm.compiler.graph.Node;
+import org.graalvm.compiler.hotspot.nodes.KlassBeingInitializedCheckNode;
+import org.graalvm.compiler.nodes.DeoptimizeNode;
+import org.graalvm.compiler.nodes.StructuredGraph;
+import org.graalvm.compiler.nodes.java.LoadFieldNode;
+import org.graalvm.compiler.nodes.java.NewInstanceNode;
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.Test;
+
+import jdk.vm.ci.code.InstalledCode;
+import jdk.vm.ci.code.InvalidInstalledCodeException;
+import jdk.vm.ci.meta.DeoptimizationReason;
+import jdk.vm.ci.meta.ResolvedJavaMethod;
+
+public class HotSpotClassInitializationTest extends HotSpotGraalCompilerTest {
+
+    static HotSpotClassInitializationTest instance;
+
+    static class InvokeStatic {
+        static {
+            instance.test(InvokeStatic.class, "m");
+        }
+
+        static boolean m() {
+            double value = 123;
+            doOtherWork(value);
+            return GraalDirectives.inCompiledCode();
+        }
+
+        static double doOtherWork(double value) {
+            return value;
+        }
+
+        static int field;
+    }
+
+    static class GetStatic {
+        static class Inner {
+            static int N = 5000;
+
+            static {
+                instance.test(GetStatic.class, "m", LoadFieldNode.class);
+            }
+        }
+
+        static {
+            @SuppressWarnings("unused")
+            int n = Inner.N;
+        }
+
+        @SuppressWarnings("unused")
+        static boolean m() {
+            double value = 123 * Inner.N;
+            return GraalDirectives.inCompiledCode();
+        }
+
+        static double field;
+    }
+
+    static class NewInstance {
+        static {
+            instance.test(NewInstance.class, "m", NewInstanceNode.class);
+        }
+
+        @SuppressWarnings("unused")
+        static boolean m() {
+            Object o = new NewInstance();
+            return GraalDirectives.inCompiledCode();
+        }
+
+        static double field;
+    }
+
+    @Before
+    public void checkAssumptions() {
+        // cannot be BeforeClass because we need a runtime and BeforeClass must be static
+        Assume.assumeTrue("init_thread field must be visible", runtime().getVMConfig().instanceKlassInitThreadOffset != -1);
+    }
+
+    @SafeVarargs
+    final void test(Class<?> testClass, String methodName, Class<? extends Node>... nodeTypes) {
+        ResolvedJavaMethod method = getResolvedJavaMethod(testClass, methodName);
+        StructuredGraph graph = parseProfiled(method, StructuredGraph.AllowAssumptions.NO);
+        for (DeoptimizeNode d : graph.getNodes().filter(DeoptimizeNode.class)) {
+            assertNotEquals("No unresolved deopts expected", d.getReason(), DeoptimizationReason.Unresolved);
+        }
+        assertTrue("A dynamic check should have been emitted", graph.getNodes().filter(KlassBeingInitializedCheckNode.class).count() == 1);
+
+        // Ensure that all expected nodes exist.
+        for (Class<? extends Node> nodeType : nodeTypes) {
+            assertTrue("expected node of type " + nodeType, graph.getNodes().filter(nodeType).count() == 1);
+        }
+
+        // Ensure that execution remains in the compiled code to the return point
+        InstalledCode code = instance.getCode(method, graph);
+        try {
+            boolean result = (boolean) code.executeVarargs();
+            Assert.assertEquals("should have completed in compiled code", result, true);
+        } catch (InvalidInstalledCodeException e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Test
+    public void testInvokeStatic() {
+        GraalDirectives.inCompiledCode();
+        instance = this;
+        InvokeStatic.field = 0;
+        instance = null;
+    }
+
+    @Test
+    public void testGetStatic() {
+        GraalDirectives.inCompiledCode();
+        instance = this;
+        GetStatic.field = 0;
+        instance = null;
+    }
+
+    @Test
+    public void testNewInstance() {
+        GraalDirectives.inCompiledCode();
+        instance = this;
+        NewInstance.field = 0;
+        instance = null;
+    }
+
+}
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotCryptoSubstitutionTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotCryptoSubstitutionTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotGraalCompilerTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotGraalCompilerTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotGraalManagementTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotGraalManagementTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotInvokeDynamicPluginTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotInvokeDynamicPluginTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -31,7 +31,7 @@
 import java.util.function.IntPredicate;
 
 import org.graalvm.compiler.core.common.GraalOptions;
-import org.graalvm.compiler.hotspot.meta.HotSpotClassInitializationPlugin;
+import org.graalvm.compiler.hotspot.meta.HotSpotAOTClassInitializationPlugin;
 import org.graalvm.compiler.hotspot.meta.HotSpotInvokeDynamicPlugin;
 import org.graalvm.compiler.hotspot.nodes.aot.ResolveDynamicConstantNode;
 import org.graalvm.compiler.hotspot.nodes.aot.ResolveDynamicStubCall;
@@ -59,7 +59,7 @@
     @Override
     protected Plugins getDefaultGraphBuilderPlugins() {
         Plugins plugins = super.getDefaultGraphBuilderPlugins();
-        plugins.setClassInitializationPlugin(new HotSpotClassInitializationPlugin());
+        plugins.setClassInitializationPlugin(new HotSpotAOTClassInitializationPlugin());
         plugins.setInvokeDynamicPlugin(new HotSpotInvokeDynamicPlugin() {
             @Override
             public boolean isResolvedDynamicInvoke(GraphBuilderContext builder, int index, int opcode) {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotLazyInitializationTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotLazyInitializationTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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,7 +25,7 @@
 package org.graalvm.compiler.hotspot.test;
 
 import org.graalvm.compiler.core.test.GraalCompilerTest;
-import org.graalvm.compiler.hotspot.meta.HotSpotClassInitializationPlugin;
+import org.graalvm.compiler.hotspot.meta.HotSpotAOTClassInitializationPlugin;
 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions;
 import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins;
 import org.junit.Assert;
@@ -36,7 +36,7 @@
 
 public class HotSpotLazyInitializationTest extends GraalCompilerTest {
 
-    HotSpotClassInitializationPlugin classInitPlugin = new HotSpotClassInitializationPlugin();
+    HotSpotAOTClassInitializationPlugin classInitPlugin = new HotSpotAOTClassInitializationPlugin();
 
     @Override
     protected Plugins getDefaultGraphBuilderPlugins() {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMethodSubstitutionTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMethodSubstitutionTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HsErrLogTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HsErrLogTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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,6 +57,8 @@
         List<String> args = new ArrayList<>();
         if (JavaVersionUtil.JAVA_SPEC <= 8) {
             args.add("-XX:-UseJVMCIClassLoader");
+        } else {
+            args.add("--add-exports=jdk.internal.vm.compiler/org.graalvm.compiler.api.directives=ALL-UNNAMED");
         }
         args.add("-XX:+UseJVMCICompiler");
         args.add("-XX:CompileOnly=" + Crasher.class.getName() + "::tryCrash");
@@ -90,7 +92,7 @@
             }
         }
 
-        Assert.fail("Could not find " + re.pattern());
+        Assert.fail(String.format("Could not find %s%n%s", re.pattern(), proc));
     }
 
     private static void checkHsErr(File hsErrPath) {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/JVMCIInfopointErrorTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/JVMCIInfopointErrorTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/LoadJavaMirrorWithKlassTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/LoadJavaMirrorWithKlassTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/MemoryUsageBenchmark.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/MemoryUsageBenchmark.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ObjectHashCodeInliningTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ObjectHashCodeInliningTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -24,15 +24,21 @@
 
 package org.graalvm.compiler.hotspot.test;
 
-import jdk.vm.ci.meta.ResolvedJavaMethod;
 import org.graalvm.compiler.core.test.GraalCompilerTest;
+import org.graalvm.compiler.java.BytecodeParserOptions;
 import org.graalvm.compiler.nodes.StructuredGraph;
 import org.graalvm.compiler.nodes.extended.ForeignCallNode;
 import org.graalvm.compiler.nodes.java.MethodCallTargetNode;
 import org.graalvm.compiler.nodes.memory.ReadNode;
-import org.junit.Assume;
+import org.graalvm.compiler.options.OptionValues;
 import org.junit.Test;
 
+import jdk.vm.ci.meta.JavaTypeProfile;
+import jdk.vm.ci.meta.JavaTypeProfile.ProfiledType;
+import jdk.vm.ci.meta.MetaAccessProvider;
+import jdk.vm.ci.meta.ResolvedJavaMethod;
+import jdk.vm.ci.meta.TriState;
+
 public class ObjectHashCodeInliningTest extends GraalCompilerTest {
 
     public static int getHash(Object obj) {
@@ -40,18 +46,21 @@
     }
 
     @Test
-    public void testInstallCodeInvalidation() {
-        for (int i = 0; i < 100000; i++) {
-            getHash(i % 10 == 0 ? new Object() : "");
-        }
+    public void testGetHash() {
+        MetaAccessProvider metaAccess = getMetaAccess();
+        ProfiledType[] injectedProfile = {
+                        new ProfiledType(metaAccess.lookupJavaType(String.class), 0.9D),
+                        new ProfiledType(metaAccess.lookupJavaType(Object.class), 0.1D)};
 
         ResolvedJavaMethod method = getResolvedJavaMethod("getHash");
-        StructuredGraph graph = parseForCompile(method);
+        StructuredGraph graph = parseForCompile(method,
+                        new OptionValues(getInitialOptions(), BytecodeParserOptions.InlineDuringParsing, false, BytecodeParserOptions.InlineIntrinsicsDuringParsing, false));
         for (MethodCallTargetNode callTargetNode : graph.getNodes(MethodCallTargetNode.TYPE)) {
             if ("Object.hashCode".equals(callTargetNode.targetName())) {
-                Assume.assumeTrue(callTargetNode.getProfile() != null);
+                callTargetNode.setJavaTypeProfile(new JavaTypeProfile(TriState.FALSE, 0.0D, injectedProfile));
             }
         }
+
         compile(method, graph);
     }
 
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/OptionsInFileTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/OptionsInFileTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/PolymorphicInliningTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+package org.graalvm.compiler.hotspot.test;
+
+import org.graalvm.compiler.core.test.GraalCompilerTest;
+import org.graalvm.compiler.graph.Node;
+import org.graalvm.compiler.java.BytecodeParserOptions;
+import org.graalvm.compiler.nodes.AbstractDeoptimizeNode;
+import org.graalvm.compiler.nodes.InvokeNode;
+import org.graalvm.compiler.nodes.StructuredGraph;
+import org.graalvm.compiler.nodes.java.MethodCallTargetNode;
+import org.graalvm.compiler.nodes.java.TypeSwitchNode;
+import org.graalvm.compiler.options.OptionValues;
+import org.junit.Before;
+import org.junit.Test;
+
+import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
+import jdk.vm.ci.meta.JavaTypeProfile;
+import jdk.vm.ci.meta.JavaTypeProfile.ProfiledType;
+import jdk.vm.ci.meta.MetaAccessProvider;
+import jdk.vm.ci.meta.ResolvedJavaMethod;
+import jdk.vm.ci.meta.TriState;
+
+public class PolymorphicInliningTest extends GraalCompilerTest {
+
+    @Before
+    public void initializeNotInlinableMethod() {
+        ((HotSpotResolvedJavaMethod) getResolvedJavaMethod(NotInlinableSubClass.class, "foo")).setNotInlinableOrCompilable();
+        // Resolve classes
+        new A().foo();
+        new B().foo();
+        new NotInlinableSubClass().foo();
+    }
+
+    public int snippet(SuperClass receiver) {
+        return receiver.foo();
+    }
+
+    @Test
+    public void testBimorphicInlined() {
+        ResolvedJavaMethod method = getResolvedJavaMethod("snippet");
+        StructuredGraph graph = parseForCompile(method, disableInlineDuringParsing());
+
+        MetaAccessProvider metaAccess = getMetaAccess();
+        ProfiledType[] injectedProfile = {
+                        new ProfiledType(metaAccess.lookupJavaType(A.class), 0.5D),
+                        new ProfiledType(metaAccess.lookupJavaType(B.class), 0.5D)};
+        injectTypeProfile(graph, "PolymorphicInliningTest$SuperClass.foo", new JavaTypeProfile(TriState.FALSE, 0.0D, injectedProfile));
+
+        createInliningPhase().apply(graph, getDefaultHighTierContext());
+
+        // This callsite should be inlined with a TypeCheckedInliningViolated deoptimization.
+        assertTrue(getNodeCount(graph, InvokeNode.class) == 0);
+        assertTrue(getNodeCount(graph, TypeSwitchNode.class) == 1);
+        assertTrue(getNodeCount(graph, AbstractDeoptimizeNode.class) == 1);
+    }
+
+    @Test
+    public void testBimorphicNotInlined() {
+        ResolvedJavaMethod method = getResolvedJavaMethod("snippet");
+        StructuredGraph graph = parseForCompile(method, disableInlineDuringParsing());
+
+        MetaAccessProvider metaAccess = getMetaAccess();
+        ProfiledType[] injectedProfile = {
+                        new ProfiledType(metaAccess.lookupJavaType(A.class), 0.8D),
+                        new ProfiledType(metaAccess.lookupJavaType(NotInlinableSubClass.class), 0.2D)};
+        injectTypeProfile(graph, "PolymorphicInliningTest$SuperClass.foo", new JavaTypeProfile(TriState.FALSE, 0.0D, injectedProfile));
+
+        createInliningPhase().apply(graph, getDefaultHighTierContext());
+
+        // This callsite is not inlined due to one of the potential callee method is not inlinable.
+        assertTrue(getNodeCount(graph, InvokeNode.class) == 1);
+        assertTrue(getNodeCount(graph, TypeSwitchNode.class) == 0);
+        assertTrue(getNodeCount(graph, AbstractDeoptimizeNode.class) == 0);
+    }
+
+    @Test
+    public void testMegamorphicInlined() {
+        ResolvedJavaMethod method = getResolvedJavaMethod("snippet");
+        StructuredGraph graph = parseForCompile(method, disableInlineDuringParsing());
+
+        MetaAccessProvider metaAccess = getMetaAccess();
+        ProfiledType[] injectedProfile = {
+                        new ProfiledType(metaAccess.lookupJavaType(A.class), 0.79D),
+                        new ProfiledType(metaAccess.lookupJavaType(NotInlinableSubClass.class), 0.2D)};
+        injectTypeProfile(graph, "PolymorphicInliningTest$SuperClass.foo", new JavaTypeProfile(TriState.FALSE, 0.01D, injectedProfile));
+
+        createInliningPhase().apply(graph, getDefaultHighTierContext());
+
+        assertTrue(getNodeCount(graph, InvokeNode.class) == 1);
+        assertTrue(getNodeCount(graph, TypeSwitchNode.class) == 1);
+        assertTrue(getNodeCount(graph, AbstractDeoptimizeNode.class) == 0);
+    }
+
+    @Test
+    public void testMegamorphicNotInlined() {
+        ResolvedJavaMethod method = getResolvedJavaMethod("snippet");
+        StructuredGraph graph = parseForCompile(method, disableInlineDuringParsing());
+
+        MetaAccessProvider metaAccess = getMetaAccess();
+        ProfiledType[] injectedProfile = {
+                        new ProfiledType(metaAccess.lookupJavaType(A.class), 0.3D),
+                        new ProfiledType(metaAccess.lookupJavaType(B.class), 0.3D),
+                        new ProfiledType(metaAccess.lookupJavaType(NotInlinableSubClass.class), 0.3D)};
+        injectTypeProfile(graph, "PolymorphicInliningTest$SuperClass.foo", new JavaTypeProfile(TriState.FALSE, 0.1D, injectedProfile));
+
+        createInliningPhase().apply(graph, getDefaultHighTierContext());
+
+        // This callsite should not be inlined due to non of the potential callee method exceeds the
+        // probability specified by GraalOptions.MegamorphicInliningMinMethodProbability.
+        assertTrue(getNodeCount(graph, InvokeNode.class) == 1);
+        assertTrue(getNodeCount(graph, TypeSwitchNode.class) == 0);
+        assertTrue(getNodeCount(graph, AbstractDeoptimizeNode.class) == 0);
+    }
+
+    private static OptionValues disableInlineDuringParsing() {
+        return new OptionValues(getInitialOptions(), BytecodeParserOptions.InlineDuringParsing, false, BytecodeParserOptions.InlineIntrinsicsDuringParsing, false);
+    }
+
+    private static void injectTypeProfile(StructuredGraph graph, String targetMethod, JavaTypeProfile profile) {
+        for (MethodCallTargetNode callTargetNode : graph.getNodes(MethodCallTargetNode.TYPE)) {
+            if (targetMethod.equals(callTargetNode.targetName())) {
+                callTargetNode.setJavaTypeProfile(profile);
+            }
+        }
+    }
+
+    private static int getNodeCount(StructuredGraph graph, Class<? extends Node> nodeClass) {
+        return graph.getNodes().filter(nodeClass).count();
+    }
+
+    private abstract static class SuperClass {
+        abstract int foo();
+    }
+
+    private static class A extends SuperClass {
+        @Override
+        public int foo() {
+            return 'A';
+        }
+    }
+
+    private static class B extends SuperClass {
+        @Override
+        public int foo() {
+            return 'B';
+        }
+    }
+
+    private static class NotInlinableSubClass extends SuperClass {
+        @Override
+        public int foo() {
+            return 'X';
+        }
+    }
+
+}
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ReplaceConstantNodesPhaseTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ReplaceConstantNodesPhaseTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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,7 +26,7 @@
 
 import org.graalvm.compiler.core.common.GraalOptions;
 import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig;
-import org.graalvm.compiler.hotspot.meta.HotSpotClassInitializationPlugin;
+import org.graalvm.compiler.hotspot.meta.HotSpotAOTClassInitializationPlugin;
 import org.graalvm.compiler.hotspot.nodes.aot.InitializeKlassNode;
 import org.graalvm.compiler.hotspot.nodes.aot.LoadConstantIndirectlyNode;
 import org.graalvm.compiler.hotspot.nodes.aot.ResolveConstantNode;
@@ -50,7 +50,7 @@
     @Override
     protected Plugins getDefaultGraphBuilderPlugins() {
         Plugins plugins = super.getDefaultGraphBuilderPlugins();
-        plugins.setClassInitializationPlugin(new HotSpotClassInitializationPlugin());
+        plugins.setClassInitializationPlugin(new HotSpotAOTClassInitializationPlugin());
         return plugins;
     }
 
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ReservedStackAccessTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ReservedStackAccessTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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,12 +25,11 @@
 package org.graalvm.compiler.hotspot.test;
 
 import java.io.IOException;
+import java.util.List;
 import java.util.concurrent.locks.ReentrantLock;
-import java.util.List;
 
 import org.graalvm.compiler.test.SubprocessUtil;
 import org.graalvm.compiler.test.SubprocessUtil.Subprocess;
-
 import org.junit.Assume;
 import org.junit.Before;
 import org.junit.Test;
@@ -73,6 +72,7 @@
         vmArgs.add("-XX:+UseJVMCICompiler");
         vmArgs.add("-Dgraal.Inline=false");
         vmArgs.add("-XX:CompileCommand=exclude,java/util/concurrent/locks/AbstractOwnableSynchronizer.setExclusiveOwnerThread");
+        vmArgs.addAll(SubprocessUtil.getPackageOpeningOptions());
 
         // Avoid SOE in HotSpotJVMCIRuntime.adjustCompilationLevel
         vmArgs.add("-Dgraal.CompileGraalWithC1Only=false");
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestIntrinsicCompiles.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestIntrinsicCompiles.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierAdditionTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierAdditionTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -28,18 +28,16 @@
 
 import java.lang.ref.WeakReference;
 
-import org.graalvm.compiler.api.replacements.Fold;
+import org.graalvm.compiler.api.test.Graal;
 import org.graalvm.compiler.debug.DebugContext;
 import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig;
-import org.graalvm.compiler.hotspot.GraalHotSpotVMConfigBase;
+import org.graalvm.compiler.hotspot.HotSpotBackend;
 import org.graalvm.compiler.nodes.StructuredGraph;
 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions;
 import org.graalvm.compiler.nodes.gc.G1PostWriteBarrier;
 import org.graalvm.compiler.nodes.gc.G1PreWriteBarrier;
 import org.graalvm.compiler.nodes.gc.G1ReferentFieldReadBarrier;
 import org.graalvm.compiler.nodes.gc.SerialWriteBarrier;
-import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins;
-import org.graalvm.compiler.nodes.graphbuilderconf.NodeIntrinsicPluginFactory;
 import org.graalvm.compiler.nodes.memory.HeapAccess.BarrierType;
 import org.graalvm.compiler.nodes.memory.ReadNode;
 import org.graalvm.compiler.nodes.memory.WriteNode;
@@ -54,7 +52,7 @@
 import org.graalvm.compiler.phases.common.inlining.policy.InlineEverythingPolicy;
 import org.graalvm.compiler.phases.tiers.HighTierContext;
 import org.graalvm.compiler.phases.tiers.MidTierContext;
-import org.graalvm.compiler.replacements.NodeIntrinsificationProvider;
+import org.graalvm.compiler.runtime.RuntimeProvider;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -161,29 +159,18 @@
     static Container con = new Container();
 
     /**
-     * Expected 4 barriers for the Serial GC and 9 for G1 (1 ref + 4 pre + 4 post). In this test, we
-     * load the correct offset of the WeakReference object so naturally we assert the presence of
-     * the pre barrier.
+     * Expected 0 barrier for the Serial GC and 1 for G1. In this test, we load the correct offset
+     * of the WeakReference object so naturally we assert the presence of the pre barrier.
      */
     @Test
     public void test5() throws Exception {
         testHelper("test5Snippet", config.useG1GC ? 1 : 0);
     }
 
-    @Override
-    protected void registerInvocationPlugins(InvocationPlugins invocationPlugins) {
-        NodeIntrinsicPluginFactory.InjectionProvider injection = new NodeIntrinsificationProvider(getMetaAccess(), getSnippetReflection(), getProviders().getForeignCalls(), null);
-        new PluginFactory_WriteBarrierAdditionTest().registerPlugins(invocationPlugins, injection);
-        super.registerInvocationPlugins(invocationPlugins);
-    }
+    private static final boolean useCompressedOops = ((HotSpotBackend) Graal.getRequiredCapability(RuntimeProvider.class).getHostBackend()).getRuntime().getVMConfig().useCompressedOops;
 
-    @Fold
-    public static boolean useCompressedOops(@Fold.InjectedParameter GraalHotSpotVMConfig config) {
-        return config.useCompressedOops;
-    }
-
-    public static Object test5Snippet() throws Exception {
-        return UNSAFE.getObject(wr, useCompressedOops(GraalHotSpotVMConfigBase.INJECTED_VMCONFIG) ? 12L : 16L);
+    public Object test5Snippet() {
+        return UNSAFE.getObject(wr, useCompressedOops ? 12L : 16L);
     }
 
     /**
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/BootstrapWatchDog.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/BootstrapWatchDog.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationCounters.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationCounters.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationTask.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationTask.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -278,7 +278,7 @@
     /**
      * Time spent in compilation.
      */
-    private static final TimerKey CompilationTime = DebugContext.timer("CompilationTime").doc("Time spent in compilation and code installation.");
+    public static final TimerKey CompilationTime = DebugContext.timer("CompilationTime").doc("Time spent in compilation and code installation.");
 
     /**
      * Counts the number of compiled {@linkplain CompilationResult#getBytecodeSize() bytecodes}.
@@ -289,7 +289,7 @@
      * Counts the number of compiled {@linkplain CompilationResult#getBytecodeSize() bytecodes} for
      * which {@linkplain CompilationResult#getTargetCode()} code was installed.
      */
-    private static final CounterKey CompiledAndInstalledBytecodes = DebugContext.counter("CompiledAndInstalledBytecodes");
+    public static final CounterKey CompiledAndInstalledBytecodes = DebugContext.counter("CompiledAndInstalledBytecodes");
 
     /**
      * Counts the number of installed {@linkplain CompilationResult#getTargetCodeSize()} bytes.
@@ -303,8 +303,8 @@
 
     public HotSpotCompilationRequestResult runCompilation(OptionValues initialOptions) {
         OptionValues options = filterOptions(initialOptions);
-        SnippetReflectionProvider snippetReflection = compiler.getGraalRuntime().getHostProviders().getSnippetReflection();
-        try (DebugContext debug = DebugContext.create(options, new GraalDebugHandlersFactory(snippetReflection))) {
+        HotSpotGraalRuntimeProvider graalRuntime = compiler.getGraalRuntime();
+        try (DebugContext debug = graalRuntime.openDebugContext(options, compilationId, getMethod(), compiler.getDebugHandlersFactories(), DebugContext.DEFAULT_LOG_STREAM)) {
             return runCompilation(debug);
         }
     }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationWatchDog.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationWatchDog.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerConfigurationFactory.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerConfigurationFactory.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -26,7 +26,6 @@
 
 import static jdk.vm.ci.common.InitTimer.timer;
 
-import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -52,6 +51,7 @@
 
 import jdk.vm.ci.code.Architecture;
 import jdk.vm.ci.common.InitTimer;
+import jdk.vm.ci.services.Services;
 
 /**
  * A factory that creates the {@link CompilerConfiguration} the compiler will use. Each factory must
@@ -247,7 +247,7 @@
     }
 
     private static void printConfigInfo(CompilerConfigurationFactory factory) {
-        URL location = factory.getClass().getResource(factory.getClass().getSimpleName() + ".class");
+        Object location = Services.IS_IN_NATIVE_IMAGE ? "JVMCI native library" : factory.getClass().getResource(factory.getClass().getSimpleName() + ".class");
         TTY.printf("Using compiler configuration '%s' provided by %s loaded from %s%n", factory.name, factory.getClass().getName(), location);
     }
 
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java	Wed Sep 25 22:40:41 2019 +0200
@@ -54,6 +54,7 @@
 
     private final CompressEncoding oopEncoding;
     private final CompressEncoding klassEncoding;
+    private final String markWord = versioned.markWordFieldType;
 
     public CompressEncoding getOopEncoding() {
         return oopEncoding;
@@ -208,46 +209,18 @@
     public final int stackBias = getConstant("STACK_BIAS", Integer.class);
     public final int vmPageSize = getFieldValue("CompilerToVM::Data::vm_page_size", Integer.class, "int");
 
-    public final int markOffset = getFieldOffset("oopDesc::_mark", Integer.class, "markWord");
+    public final int markOffset = getFieldOffset("oopDesc::_mark", Integer.class, markWord);
     public final int hubOffset = getFieldOffset("oopDesc::_metadata._klass", Integer.class, "Klass*");
 
-    public final int prototypeMarkWordOffset = getFieldOffset("Klass::_prototype_header", Integer.class, "markWord");
+    public final int prototypeMarkWordOffset = getFieldOffset("Klass::_prototype_header", Integer.class, markWord);
     public final int subklassOffset = getFieldOffset("Klass::_subklass", Integer.class, "Klass*");
     public final int nextSiblingOffset = getFieldOffset("Klass::_next_sibling", Integer.class, "Klass*");
     public final int superCheckOffsetOffset = getFieldOffset("Klass::_super_check_offset", Integer.class, "juint");
     public final int secondarySuperCacheOffset = getFieldOffset("Klass::_secondary_super_cache", Integer.class, "Klass*");
     public final int secondarySupersOffset = getFieldOffset("Klass::_secondary_supers", Integer.class, "Array<Klass*>*");
 
-    public final boolean classMirrorIsHandle;
-    public final int classMirrorOffset;
-    {
-        String name = "Klass::_java_mirror";
-        int offset = -1;
-        boolean isHandle = false;
-        try {
-            offset = getFieldOffset(name, Integer.class, "oop");
-        } catch (JVMCIError e) {
-
-        }
-        if (offset == -1) {
-            try {
-                offset = getFieldOffset(name, Integer.class, "jobject");
-                isHandle = true;
-            } catch (JVMCIError e) {
-                try {
-                    // JDK-8186777
-                    offset = getFieldOffset(name, Integer.class, "OopHandle");
-                    isHandle = true;
-                } catch (JVMCIError e2) {
-                }
-            }
-        }
-        if (offset == -1) {
-            throw new JVMCIError("cannot get offset of field " + name + " with type oop, jobject or OopHandle");
-        }
-        classMirrorOffset = offset;
-        classMirrorIsHandle = isHandle;
-    }
+    public final boolean classMirrorIsHandle = versioned.classMirrorIsHandle;
+    public final int classMirrorOffset = versioned.classMirrorOffset;
 
     public final int klassSuperKlassOffset = getFieldOffset("Klass::_super", Integer.class, "Klass*");
     public final int klassModifierFlagsOffset = getFieldOffset("Klass::_modifier_flags", Integer.class, "jint");
@@ -276,12 +249,14 @@
     public final int vtableEntryMethodOffset = getFieldOffset("vtableEntry::_method", Integer.class, "Method*");
 
     public final int instanceKlassInitStateOffset = getFieldOffset("InstanceKlass::_init_state", Integer.class, "u1");
+    public final int instanceKlassInitThreadOffset = getFieldOffset("InstanceKlass::_init_thread", Integer.class, "Thread*", -1);
     public final int instanceKlassConstantsOffset = getFieldOffset("InstanceKlass::_constants", Integer.class, "ConstantPool*");
     public final int instanceKlassFieldsOffset = getFieldOffset("InstanceKlass::_fields", Integer.class, "Array<u2>*");
     public final int klassVtableStartOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_start_offset", Integer.class, "int");
     public final int klassVtableLengthOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_length_offset", Integer.class, "int");
 
     public final int instanceKlassStateLinked = getConstant("InstanceKlass::linked", Integer.class);
+    public final int instanceKlassStateBeingInitialized = getConstant("InstanceKlass::being_initialized", Integer.class, -1);
     public final int instanceKlassStateFullyInitialized = getConstant("InstanceKlass::fully_initialized", Integer.class);
 
     public final int arrayOopDescSize = getFieldValue("CompilerToVM::Data::sizeof_arrayOopDesc", Integer.class, "int");
@@ -445,17 +420,17 @@
 
     public final int osThreadInterruptedOffset = getFieldOffset("OSThread::_interrupted", Integer.class, "jint");
 
-    public final long markWordHashShift = getConstant("markWord::hash_shift", Long.class);
+    public final long markWordHashShift = getConstant(markWordField("hash_shift"), Long.class);
 
-    public final int biasedLockMaskInPlace = getConstant("markWord::biased_lock_mask_in_place", Integer.class);
-    public final int ageMaskInPlace = getConstant("markWord::age_mask_in_place", Integer.class);
-    public final int epochMaskInPlace = getConstant("markWord::epoch_mask_in_place", Integer.class);
-    public final long markWordHashMask = getConstant("markWord::hash_mask", Long.class);
-    public final long markWordHashMaskInPlace = getConstant("markWord::hash_mask_in_place", Long.class);
+    public final int biasedLockMaskInPlace = getConstant(markWordField("biased_lock_mask_in_place"), Integer.class);
+    public final int ageMaskInPlace = getConstant(markWordField("age_mask_in_place"), Integer.class);
+    public final int epochMaskInPlace = getConstant(markWordField("epoch_mask_in_place"), Integer.class);
+    public final long markWordHashMask = getConstant(markWordField("hash_mask"), Long.class);
+    public final long markWordHashMaskInPlace = getConstant(markWordField("hash_mask_in_place"), Long.class);
 
-    public final int unlockedMask = getConstant("markWord::unlocked_value", Integer.class);
-    public final int monitorMask = getConstant("markWord::monitor_value", Integer.class, -1);
-    public final int biasedLockPattern = getConstant("markWord::biased_lock_pattern", Integer.class);
+    public final int unlockedMask = getConstant(markWordField("unlocked_value"), Integer.class);
+    public final int monitorMask = getConstant(markWordField("monitor_value"), Integer.class, -1);
+    public final int biasedLockPattern = getConstant(markWordField("biased_lock_pattern"), Integer.class);
 
     // This field has no type in vmStructs.cpp
     public final int objectMonitorOwner = getFieldOffset("ObjectMonitor::_owner", Integer.class, null, -1);
@@ -464,18 +439,18 @@
     public final int objectMonitorEntryList = getFieldOffset("ObjectMonitor::_EntryList", Integer.class, "ObjectWaiter*", -1);
     public final int objectMonitorSucc = getFieldOffset("ObjectMonitor::_succ", Integer.class, "Thread*", -1);
 
-    public final int markWordNoHashInPlace = getConstant("markWord::no_hash_in_place", Integer.class);
-    public final int markWordNoLockInPlace = getConstant("markWord::no_lock_in_place", Integer.class);
+    public final int markWordNoHashInPlace = getConstant(markWordField("no_hash_in_place"), Integer.class);
+    public final int markWordNoLockInPlace = getConstant(markWordField("no_lock_in_place"), Integer.class);
 
     /**
-     * See {@code markWord::prototype()}.
+     * See {@code markOopDesc::prototype()}/{@code markWord::prototype()}.
      */
     public long arrayPrototypeMarkWord() {
         return markWordNoHashInPlace | markWordNoLockInPlace;
     }
 
     /**
-     * See {@code markWord::copy_set_hash()}.
+     * See {@code markOopDesc::copy_set_hash()}/{@code markWord::copy_set_hash()}.
      */
     public long tlabIntArrayMarkWord() {
         long tmp = arrayPrototypeMarkWord() & (~markWordHashMaskInPlace);
@@ -483,15 +458,19 @@
         return tmp;
     }
 
+    private String markWordField(String simpleName) {
+        return versioned.markWordClassName + "::" + simpleName;
+    }
+
     /**
      * Mark word right shift to get identity hash code.
      */
-    public final int identityHashCodeShift = getConstant("markWord::hash_shift", Integer.class);
+    public final int identityHashCodeShift = getConstant(markWordField("hash_shift"), Integer.class);
 
     /**
      * Identity hash code value when uninitialized.
      */
-    public final int uninitializedIdentityHashCodeValue = getConstant("markWord::no_hash", Integer.class);
+    public final int uninitializedIdentityHashCodeValue = getConstant(markWordField("no_hash"), Integer.class);
 
     public final int methodAccessFlagsOffset = getFieldOffset("Method::_access_flags", Integer.class, "AccessFlags");
     public final int methodConstMethodOffset = getFieldOffset("Method::_constMethod", Integer.class, "ConstMethod*");
@@ -565,7 +544,7 @@
     public final int arrayKlassOffset = getFieldValue("java_lang_Class::_array_klass_offset", Integer.class, "int");
 
     public final int basicLockSize = getFieldValue("CompilerToVM::Data::sizeof_BasicLock", Integer.class, "int");
-    public final int basicLockDisplacedHeaderOffset = getFieldOffset("BasicLock::_displaced_header", Integer.class, "markWord");
+    public final int basicLockDisplacedHeaderOffset = getFieldOffset("BasicLock::_displaced_header", Integer.class, markWord);
 
     public final int threadPollingPageOffset = getFieldOffset("Thread::_polling_page", Integer.class, "address", -1);
     public final int threadAllocatedBytesOffset = getFieldOffset("Thread::_allocated_bytes", Integer.class, "jlong");
@@ -622,6 +601,12 @@
 
     public final boolean tlabStats = getFlag("TLABStats", Boolean.class);
 
+    // We set 0x10 as default value to disable DC ZVA if this field is not present in HotSpot.
+    // ARMv8-A architecture reference manual D12.2.35 Data Cache Zero ID register says:
+    // * BS, bits [3:0] indicate log2 of the DC ZVA block size in (4-byte) words.
+    // * DZP, bit [4] of indicates whether use of DC ZVA instruction is prohibited.
+    public final int psrInfoDczidValue = getFieldValue("VM_Version::_psr_info.dczid_el0", Integer.class, "uint32_t", 0x10);
+
     // FIXME This is only temporary until the GC code is changed.
     public final boolean inlineContiguousAllocationSupported = getFieldValue("CompilerToVM::Data::_supports_inline_contig_alloc", Boolean.class);
     public final long heapEndAddress = getFieldValue("CompilerToVM::Data::_heap_end_addr", Long.class, "HeapWord**");
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfigVersioned.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfigVersioned.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -34,7 +34,7 @@
  *
  * Fields are grouped according to the most recent JBS issue showing why they are versioned.
  *
- * JDK Version: 12+
+ * JDK Version: 14+
  */
 final class GraalHotSpotVMConfigVersioned extends HotSpotVMConfigAccess {
 
@@ -81,4 +81,12 @@
     // JDK-8015774
     long codeCacheLowBound = getFieldValue("CodeCache::_low_bound", Long.class, "address");
     long codeCacheHighBound = getFieldValue("CodeCache::_high_bound", Long.class, "address");
+
+    // JDK-8229258
+    String markWordClassName = "markWord";
+    String markWordFieldType = "markWord";
+
+    // JDK-8186777
+    int classMirrorOffset = getFieldOffset("Klass::_java_mirror", Integer.class, "OopHandle");
+    boolean classMirrorIsHandle = true;
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackend.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackend.java	Wed Sep 25 22:40:41 2019 +0200
@@ -61,6 +61,7 @@
 import org.graalvm.compiler.lir.LIRInstruction.OperandFlag;
 import org.graalvm.compiler.lir.LIRInstruction.OperandMode;
 import org.graalvm.compiler.lir.StandardOp.LabelOp;
+import org.graalvm.compiler.lir.StandardOp.RestoreRegistersOp;
 import org.graalvm.compiler.lir.StandardOp.SaveRegistersOp;
 import org.graalvm.compiler.lir.ValueConsumer;
 import org.graalvm.compiler.lir.asm.CompilationResultBuilder;
@@ -76,15 +77,16 @@
 import org.graalvm.compiler.word.Word;
 import jdk.internal.vm.compiler.word.Pointer;
 
+import jdk.vm.ci.code.CallingConvention;
 import jdk.vm.ci.code.CompilationRequest;
 import jdk.vm.ci.code.CompiledCode;
 import jdk.vm.ci.code.Register;
-import jdk.vm.ci.code.RegisterSaveLayout;
 import jdk.vm.ci.code.StackSlot;
 import jdk.vm.ci.code.ValueUtil;
 import jdk.vm.ci.hotspot.HotSpotCompilationRequest;
 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
+import jdk.vm.ci.meta.AllocatableValue;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 import jdk.vm.ci.meta.Value;
 import jdk.vm.ci.runtime.JVMCICompiler;
@@ -425,10 +427,12 @@
     /**
      * Finds all the registers that are defined by some given LIR.
      *
-     * @param lir the LIR to examine
+     * @param gen the result to examine
      * @return the registers that are defined by or used as temps for any instruction in {@code lir}
      */
-    protected final EconomicSet<Register> gatherDestroyedCallerRegisters(LIR lir) {
+    private EconomicSet<Register> gatherDestroyedCallerRegisters(HotSpotLIRGenerationResult gen) {
+        LIR lir = gen.getLIR();
+        final EconomicSet<Register> preservedRegisters = EconomicSet.create(Equivalence.IDENTITY);
         final EconomicSet<Register> destroyedRegisters = EconomicSet.create(Equivalence.IDENTITY);
         ValueConsumer defConsumer = new ValueConsumer() {
 
@@ -436,22 +440,46 @@
             public void visitValue(Value value, OperandMode mode, EnumSet<OperandFlag> flags) {
                 if (ValueUtil.isRegister(value)) {
                     final Register reg = ValueUtil.asRegister(value);
-                    destroyedRegisters.add(reg);
+                    if (!preservedRegisters.contains(reg)) {
+                        destroyedRegisters.add(reg);
+                    }
                 }
             }
         };
+        boolean sawSaveRegisters = false;
         for (AbstractBlockBase<?> block : lir.codeEmittingOrder()) {
             if (block == null) {
                 continue;
             }
+            // Ignore the effects of instructions bracketed by save/restore
+            SaveRegistersOp save = null;
             for (LIRInstruction op : lir.getLIRforBlock(block)) {
                 if (op instanceof LabelOp) {
                     // Don't consider this as a definition
+                } else if (op instanceof SaveRegistersOp) {
+                    save = (SaveRegistersOp) op;
+                    sawSaveRegisters = true;
+                    preservedRegisters.addAll(save.getSaveableRegisters());
+                } else if (op instanceof RestoreRegistersOp) {
+                    save = null;
+                    preservedRegisters.clear();
                 } else {
                     op.visitEachTemp(defConsumer);
                     op.visitEachOutput(defConsumer);
                 }
             }
+            assert save == null : "missing RestoreRegistersOp";
+        }
+
+        if (sawSaveRegisters) {
+            // The return value must be killed so it can be propagated out
+            CallingConvention cc = gen.getCallingConvention();
+            AllocatableValue returnValue = cc.getReturn();
+            if (returnValue != null) {
+                if (ValueUtil.isRegister(returnValue)) {
+                    destroyedRegisters.add(ValueUtil.asRegister(returnValue));
+                }
+            }
         }
         return translateToCallerRegisters(destroyedRegisters);
     }
@@ -464,30 +492,35 @@
     protected abstract EconomicSet<Register> translateToCallerRegisters(EconomicSet<Register> calleeRegisters);
 
     /**
-     * Updates a given stub with respect to the registers it destroys.
-     * <p>
-     * Any entry in {@code calleeSaveInfo} that {@linkplain SaveRegistersOp#supportsRemove()
-     * supports} pruning will have {@code destroyedRegisters}
-     * {@linkplain SaveRegistersOp#remove(EconomicSet) removed} as these registers are declared as
-     * temporaries in the stub's {@linkplain ForeignCallLinkage linkage} (and thus will be saved by
-     * the stub's caller).
+     * Updates a given stub with respect to the registers it destroys by
+     * {@link #gatherDestroyedCallerRegisters(HotSpotLIRGenerationResult) computing the destroyed
+     * registers} and removing those registers from the {@linkplain SaveRegistersOp SaveRegistersOp}
+     * as these registers are declared as temporaries in the stub's {@linkplain ForeignCallLinkage
+     * linkage} (and thus will be saved by the stub's caller).
      *
      * @param stub the stub to update
-     * @param destroyedRegisters the registers destroyed by the stub
-     * @param calleeSaveInfo a map from debug infos to the operations that provide their
-     *            {@linkplain RegisterSaveLayout callee-save information}
+     * @param gen the HotSpotLIRGenerationResult being emitted
      * @param frameMap used to {@linkplain FrameMap#offsetForStackSlot(StackSlot) convert} a virtual
-     *            slot to a frame slot index
      */
-    protected void updateStub(Stub stub, EconomicSet<Register> destroyedRegisters, EconomicMap<LIRFrameState, SaveRegistersOp> calleeSaveInfo, FrameMap frameMap) {
+    protected void updateStub(Stub stub, HotSpotLIRGenerationResult gen, FrameMap frameMap) {
+        EconomicSet<Register> destroyedRegisters = gatherDestroyedCallerRegisters(gen);
+        EconomicMap<LIRFrameState, SaveRegistersOp> calleeSaveInfo = gen.getCalleeSaveInfo();
+
+        if (stub.getLinkage().needsDebugInfo() && calleeSaveInfo.isEmpty()) {
+            // This call is a safepoint but no register saving was done so we must ensure that all
+            // registers appear to be killed. The Native ABI may allow caller save registers but
+            // for HotSpot they must be described in a RegisterMap so they are accessible.
+            for (Register r : frameMap.getRegisterConfig().getCallerSaveRegisters()) {
+                destroyedRegisters.add(r);
+            }
+        }
+
         stub.initDestroyedCallerRegisters(destroyedRegisters);
 
         MapCursor<LIRFrameState, SaveRegistersOp> cursor = calleeSaveInfo.getEntries();
         while (cursor.advance()) {
             SaveRegistersOp save = cursor.getValue();
-            if (save.supportsRemove()) {
-                save.remove(destroyedRegisters);
-            }
+            save.remove(destroyedRegisters);
             if (cursor.getKey() != LIRFrameState.NO_STATE) {
                 cursor.getKey().debugInfo().setCalleeSaveInfo(save.getMap(frameMap));
             }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackendFactory.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackendFactory.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompiledCodeBuilder.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompiledCodeBuilder.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkage.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkage.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -24,13 +24,13 @@
 
 package org.graalvm.compiler.hotspot;
 
-import jdk.vm.ci.meta.InvokeTarget;
-
 import org.graalvm.compiler.core.common.spi.ForeignCallLinkage;
 import org.graalvm.compiler.core.target.Backend;
 import org.graalvm.compiler.hotspot.stubs.Stub;
 import jdk.internal.vm.compiler.word.LocationIdentity;
 
+import jdk.vm.ci.meta.InvokeTarget;
+
 /**
  * The details required to link a HotSpot runtime or stub call.
  */
@@ -42,8 +42,8 @@
      * {@linkplain ForeignCallLinkage#getTemporaries() temporary} registers.
      */
     enum RegisterEffect {
-        DESTROYS_REGISTERS,
-        PRESERVES_REGISTERS
+        DESTROYS_ALL_CALLER_SAVE_REGISTERS,
+        COMPUTES_REGISTERS_KILLED
     }
 
     /**
@@ -118,6 +118,8 @@
 
     void setCompiledStub(Stub stub);
 
+    RegisterEffect getEffect();
+
     /**
      * Determines if this is a call to a compiled {@linkplain Stub stub}.
      */
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkageImpl.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkageImpl.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -25,7 +25,7 @@
 package org.graalvm.compiler.hotspot;
 
 import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
-import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.DESTROYS_REGISTERS;
+import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.DESTROYS_ALL_CALLER_SAVE_REGISTERS;
 
 import jdk.internal.vm.compiler.collections.EconomicSet;
 import org.graalvm.compiler.core.common.spi.ForeignCallDescriptor;
@@ -184,6 +184,11 @@
     }
 
     @Override
+    public RegisterEffect getEffect() {
+        return effect;
+    }
+
+    @Override
     public LocationIdentity[] getKilledLocations() {
         return killedLocations;
     }
@@ -268,7 +273,7 @@
 
     @Override
     public boolean destroysRegisters() {
-        return effect == DESTROYS_REGISTERS;
+        return effect == DESTROYS_ALL_CALLER_SAVE_REGISTERS;
     }
 
     @Override
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompiler.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompiler.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalJVMCIServiceLocator.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalJVMCIServiceLocator.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalOptionValues.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalOptionValues.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -113,6 +113,11 @@
     private final String runtimeName;
     private final String compilerConfigurationName;
     private final HotSpotBackend hostBackend;
+
+    public GlobalMetrics getMetricValues() {
+        return metricValues;
+    }
+
     private final GlobalMetrics metricValues = new GlobalMetrics();
     private final List<SnippetCounter.Group> snippetCounterGroups;
     private final HotSpotGC garbageCollector;
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalServices.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalServices.java	Wed Sep 25 22:40:41 2019 +0200
@@ -25,6 +25,8 @@
 package org.graalvm.compiler.hotspot;
 
 import jdk.vm.ci.hotspot.HotSpotMetaData;
+import jdk.vm.ci.hotspot.HotSpotSpeculationLog;
+import jdk.vm.ci.meta.SpeculationLog;
 
 /**
  * JDK 13 version of {@code HotSpotGraalServices}.
@@ -51,4 +53,8 @@
     public static void exit(int status) {
         System.exit(status);
     }
+
+    public static SpeculationLog newHotSpotSpeculationLog(long cachedFailedSpeculationsAddress) {
+        return new HotSpotSpeculationLog(cachedFailedSpeculationsAddress);
+    }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -30,21 +30,28 @@
 
 import java.util.Collections;
 
+import org.graalvm.compiler.core.common.CompilationIdentifier;
 import org.graalvm.compiler.core.common.NumUtil;
+import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig;
 import org.graalvm.compiler.core.common.spi.ForeignCallDescriptor;
+import org.graalvm.compiler.core.gen.LIRGenerationProvider;
 import org.graalvm.compiler.debug.DebugHandlersFactory;
 import org.graalvm.compiler.hotspot.meta.HotSpotHostForeignCallsProvider;
 import org.graalvm.compiler.hotspot.meta.HotSpotLoweringProvider;
 import org.graalvm.compiler.hotspot.meta.HotSpotProviders;
 import org.graalvm.compiler.hotspot.stubs.Stub;
+import org.graalvm.compiler.lir.LIR;
 import org.graalvm.compiler.lir.asm.CompilationResultBuilder;
+import org.graalvm.compiler.lir.framemap.FrameMapBuilder;
 import org.graalvm.compiler.lir.framemap.ReferenceMapBuilder;
+import org.graalvm.compiler.lir.gen.LIRGenerationResult;
 import org.graalvm.compiler.nodes.StructuredGraph;
 import org.graalvm.compiler.options.OptionValues;
 import org.graalvm.compiler.printer.GraalDebugHandlersFactory;
 import org.graalvm.compiler.word.Word;
 
 import jdk.vm.ci.code.CallingConvention;
+import jdk.vm.ci.code.RegisterConfig;
 import jdk.vm.ci.common.InitTimer;
 import jdk.vm.ci.hotspot.HotSpotCallingConventionType;
 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
@@ -55,7 +62,7 @@
 /**
  * Common functionality of HotSpot host backends.
  */
-public abstract class HotSpotHostBackend extends HotSpotBackend {
+public abstract class HotSpotHostBackend extends HotSpotBackend implements LIRGenerationProvider {
 
     /**
      * Descriptor for {@code SharedRuntime::deopt_blob()->unpack()}.
@@ -155,4 +162,12 @@
         return new HotSpotReferenceMapBuilder(totalFrameSize, config.maxOopMapStackOffset, uncompressedReferenceSize);
     }
 
+    @Override
+    public LIRGenerationResult newLIRGenerationResult(CompilationIdentifier compilationId, LIR lir, RegisterAllocationConfig registerAllocationConfig, StructuredGraph graph, Object stub) {
+        return new HotSpotLIRGenerationResult(compilationId, lir, newFrameMapBuilder(registerAllocationConfig.getRegisterConfig()), registerAllocationConfig, makeCallingConvention(graph, (Stub) stub),
+                        stub,
+                        config.requiresReservedStackCheck(graph.getMethods()));
+    }
+
+    protected abstract FrameMapBuilder newFrameMapBuilder(RegisterConfig registerConfig);
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerationResult.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerationResult.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -27,6 +27,7 @@
 import jdk.internal.vm.compiler.collections.EconomicMap;
 import jdk.internal.vm.compiler.collections.Equivalence;
 import org.graalvm.compiler.core.common.CompilationIdentifier;
+import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig;
 import org.graalvm.compiler.hotspot.stubs.Stub;
 import org.graalvm.compiler.lir.LIR;
 import org.graalvm.compiler.lir.LIRFrameState;
@@ -56,9 +57,9 @@
      */
     private EconomicMap<LIRFrameState, SaveRegistersOp> calleeSaveInfo = EconomicMap.create(Equivalence.IDENTITY_WITH_SYSTEM_HASHCODE);
 
-    public HotSpotLIRGenerationResult(CompilationIdentifier compilationId, LIR lir, FrameMapBuilder frameMapBuilder, CallingConvention callingConvention, Object stub,
-                    boolean requiresReservedStackAccessCheck) {
-        super(compilationId, lir, frameMapBuilder, callingConvention);
+    public HotSpotLIRGenerationResult(CompilationIdentifier compilationId, LIR lir, FrameMapBuilder frameMapBuilder, RegisterAllocationConfig registerAllocationConfig,
+                    CallingConvention callingConvention, Object stub, boolean requiresReservedStackAccessCheck) {
+        super(compilationId, lir, frameMapBuilder, registerAllocationConfig, callingConvention);
         this.stub = stub;
         this.requiresReservedStackAccessCheck = requiresReservedStackAccessCheck;
     }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReplacementsImpl.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReplacementsImpl.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotTTYStreamProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotTTYStreamProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -53,7 +53,8 @@
 
         // @formatter:off
         @Option(help = "File to which logging is sent.  A %p in the name will be replaced with a string identifying " +
-                       "the process, usually the process id and %t will be replaced by System.currentTimeMillis().", type = OptionType.Expert)
+                       "the process, usually the process id and %t will be replaced by System.currentTimeMillis().  " +
+                       "Using %o as filename sends logging to System.out whereas %e sends logging to System.err.", type = OptionType.Expert)
         public static final LogStreamOptionKey LogFile = new LogStreamOptionKey();
         // @formatter:on
     }
@@ -77,7 +78,8 @@
         /**
          * @return {@code nameTemplate} with all instances of %p replaced by
          *         {@link GraalServices#getExecutionID()} and %t by
-         *         {@link System#currentTimeMillis()}
+         *         {@link System#currentTimeMillis()}. Checks %o and %e are not combined with any
+         *         other characters.
          */
         private static String makeFilename(String nameTemplate) {
             String name = nameTemplate;
@@ -87,6 +89,13 @@
             if (name.contains("%t")) {
                 name = name.replaceAll("%t", String.valueOf(System.currentTimeMillis()));
             }
+
+            for (String subst : new String[]{"%o", "%e"}) {
+                if (name.contains(subst) && !name.equals(subst)) {
+                    throw new IllegalArgumentException("LogFile substitution " + subst + " cannot be combined with any other characters");
+                }
+            }
+
             return name;
         }
 
@@ -106,19 +115,29 @@
                             String nameTemplate = LogStreamOptionKey.this.getValue(defaultOptions());
                             if (nameTemplate != null) {
                                 String name = makeFilename(nameTemplate);
-                                try {
-                                    final boolean enableAutoflush = true;
-                                    FileOutputStream result = new FileOutputStream(name);
-                                    if (!Services.IS_IN_NATIVE_IMAGE) {
-                                        printVMConfig(enableAutoflush, result);
-                                    } else {
-                                        // There are no VM arguments for the libgraal library.
-                                    }
-                                    lazy = result;
-                                    return lazy;
-                                } catch (FileNotFoundException e) {
-                                    throw new RuntimeException("couldn't open file: " + name, e);
+                                switch (name) {
+                                    case "%o":
+                                        lazy = System.out;
+                                        break;
+                                    case "%e":
+                                        lazy = System.err;
+                                        break;
+                                    default:
+                                        try {
+                                            final boolean enableAutoflush = true;
+                                            FileOutputStream result = new FileOutputStream(name);
+                                            if (!Services.IS_IN_NATIVE_IMAGE) {
+                                                printVMConfig(enableAutoflush, result);
+                                            } else {
+                                                // There are no VM arguments for the libgraal
+                                                // library.
+                                            }
+                                            lazy = result;
+                                        } catch (FileNotFoundException e) {
+                                            throw new RuntimeException("couldn't open file: " + name, e);
+                                        }
                                 }
+                                return lazy;
                             }
 
                             lazy = HotSpotJVMCIRuntime.runtime().getLogStream();
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/SymbolicSnippetEncoder.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/SymbolicSnippetEncoder.java	Wed Sep 25 22:40:41 2019 +0200
@@ -345,7 +345,7 @@
                         IntrinsicContext.CompilationContext context, EncodedGraph encodedGraph) {
             super(providers.getCodeCache().getTarget().arch, result, providers, null,
                             replacements.getGraphBuilderPlugins().getInvocationPlugins(), new InlineInvokePlugin[0], parameterPlugin,
-                            null, null, null);
+                            null, null, null, null);
             this.method = method;
             this.encodedGraph = encodedGraph;
             intrinsic = new IntrinsicContext(method, null, replacements.getDefaultReplacementBytecodeProvider(), context, false);
@@ -790,7 +790,11 @@
         @Override
         public JavaConstant readFieldValue(ResolvedJavaField field, JavaConstant receiver) {
             JavaConstant javaConstant = constantReflection.readFieldValue(field, receiver);
-            if (!safeConstants.contains(receiver) && !field.getDeclaringClass().getName().contains("graalvm") && !field.getDeclaringClass().getName().contains("jdk/vm/ci/") &&
+            if (!safeConstants.contains(receiver) &&
+                            !field.getDeclaringClass().getName().contains("graalvm") &&
+                            !field.getDeclaringClass().getName().contains("jdk/vm/ci/") &&
+                            !field.getDeclaringClass().getName().contains("jdk/internal/vm/compiler") &&
+
                             !field.getName().equals("TYPE")) {
                 // Only permit constant reflection on compiler classes. This is necessary primarily
                 // because of the boxing snippets which are compiled as snippets but are really just
@@ -1045,7 +1049,7 @@
         public boolean canDeferPlugin(GeneratedInvocationPlugin plugin) {
             // Fold is always deferred but NodeIntrinsics may have to wait if all their arguments
             // aren't constant yet.
-            return plugin.getSource().equals(Fold.class) || plugin.getSource().equals(Node.NodeIntrinsic.class);
+            return plugin.isGeneratedFromFoldOrNodeIntrinsic();
         }
 
         @Override
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/debug/BenchmarkCounters.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/debug/BenchmarkCounters.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/lir/HotSpotZapRegistersPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/lir/HotSpotZapRegistersPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -28,23 +28,28 @@
 
 import java.util.ArrayList;
 
+import jdk.internal.vm.compiler.collections.EconomicSet;
+import jdk.internal.vm.compiler.collections.Equivalence;
 import org.graalvm.compiler.core.common.cfg.AbstractBlockBase;
 import org.graalvm.compiler.debug.DebugContext;
 import org.graalvm.compiler.debug.Indent;
 import org.graalvm.compiler.hotspot.HotSpotLIRGenerationResult;
 import org.graalvm.compiler.hotspot.stubs.Stub;
 import org.graalvm.compiler.lir.LIR;
-import org.graalvm.compiler.lir.LIRFrameState;
 import org.graalvm.compiler.lir.LIRInsertionBuffer;
 import org.graalvm.compiler.lir.LIRInstruction;
-import org.graalvm.compiler.lir.StandardOp.SaveRegistersOp;
+import org.graalvm.compiler.lir.StandardOp.ZapRegistersOp;
+import org.graalvm.compiler.lir.ValueConsumer;
 import org.graalvm.compiler.lir.gen.DiagnosticLIRGeneratorTool;
 import org.graalvm.compiler.lir.gen.DiagnosticLIRGeneratorTool.ZapRegistersAfterInstruction;
 import org.graalvm.compiler.lir.gen.DiagnosticLIRGeneratorTool.ZapStackArgumentSpaceBeforeInstruction;
 import org.graalvm.compiler.lir.gen.LIRGenerationResult;
 import org.graalvm.compiler.lir.phases.PostAllocationOptimizationPhase;
 
+import jdk.vm.ci.code.CallingConvention;
+import jdk.vm.ci.code.Register;
 import jdk.vm.ci.code.TargetDescription;
+import jdk.vm.ci.code.ValueUtil;
 import jdk.vm.ci.meta.AllocatableValue;
 
 /**
@@ -58,9 +63,10 @@
     @Override
     protected void run(TargetDescription target, LIRGenerationResult lirGenRes, PostAllocationOptimizationContext context) {
         Stub stub = ((HotSpotLIRGenerationResult) lirGenRes).getStub();
-        boolean zapRegisters = stub != null && !stub.preservesRegisters();
+        boolean zapRegisters = stub == null;
         boolean zapStack = false;
-        for (AllocatableValue arg : lirGenRes.getCallingConvention().getArguments()) {
+        CallingConvention callingConvention = lirGenRes.getCallingConvention();
+        for (AllocatableValue arg : callingConvention.getArguments()) {
             if (isStackSlot(arg)) {
                 zapStack = true;
                 break;
@@ -68,21 +74,25 @@
         }
         if (zapRegisters || zapStack) {
             LIR lir = lirGenRes.getLIR();
-            processLIR(context.diagnosticLirGenTool, (HotSpotLIRGenerationResult) lirGenRes, lir, zapRegisters, zapStack);
+            EconomicSet<Register> allocatableRegisters = EconomicSet.create(Equivalence.IDENTITY);
+            for (Register r : lirGenRes.getFrameMap().getRegisterConfig().getAllocatableRegisters()) {
+                allocatableRegisters.add(r);
+            }
+            processLIR(context.diagnosticLirGenTool, lir, allocatableRegisters, zapRegisters, zapStack);
         }
     }
 
-    private static void processLIR(DiagnosticLIRGeneratorTool diagnosticLirGenTool, HotSpotLIRGenerationResult res, LIR lir, boolean zapRegisters, boolean zapStack) {
+    private static void processLIR(DiagnosticLIRGeneratorTool diagnosticLirGenTool, LIR lir, EconomicSet<Register> allocatableRegisters, boolean zapRegisters, boolean zapStack) {
         LIRInsertionBuffer buffer = new LIRInsertionBuffer();
         for (AbstractBlockBase<?> block : lir.codeEmittingOrder()) {
             if (block != null) {
-                processBlock(diagnosticLirGenTool, res, lir, buffer, block, zapRegisters, zapStack);
+                processBlock(diagnosticLirGenTool, lir, allocatableRegisters, buffer, block, zapRegisters, zapStack);
             }
         }
     }
 
     @SuppressWarnings("try")
-    private static void processBlock(DiagnosticLIRGeneratorTool diagnosticLirGenTool, HotSpotLIRGenerationResult res, LIR lir, LIRInsertionBuffer buffer, AbstractBlockBase<?> block,
+    private static void processBlock(DiagnosticLIRGeneratorTool diagnosticLirGenTool, LIR lir, EconomicSet<Register> allocatableRegisters, LIRInsertionBuffer buffer, AbstractBlockBase<?> block,
                     boolean zapRegisters, boolean zapStack) {
         DebugContext debug = lir.getDebug();
         try (Indent indent = debug.logAndIndent("Process block %s", block)) {
@@ -97,31 +107,30 @@
                     }
                 }
                 if (zapRegisters && inst instanceof ZapRegistersAfterInstruction) {
-                    LIRFrameState state = getLIRState(inst);
-                    if (state != null) {
-                        SaveRegistersOp zap = diagnosticLirGenTool.createZapRegisters();
-                        SaveRegistersOp old = res.getCalleeSaveInfo().put(state, zap);
-                        assert old == null : "Already another SaveRegisterOp registered! " + old;
-                        buffer.append(index + 1, (LIRInstruction) zap);
-                        debug.log("Insert ZapRegister after %s", inst);
-                    }
+                    final EconomicSet<Register> destroyedRegisters = EconomicSet.create(Equivalence.IDENTITY);
+                    ValueConsumer tempConsumer = (value, mode, flags) -> {
+                        if (ValueUtil.isRegister(value)) {
+                            final Register reg = ValueUtil.asRegister(value);
+                            if (allocatableRegisters.contains(reg)) {
+                                destroyedRegisters.add(reg);
+                            }
+                        }
+                    };
+                    ValueConsumer defConsumer = (value, mode, flags) -> {
+                        if (ValueUtil.isRegister(value)) {
+                            final Register reg = ValueUtil.asRegister(value);
+                            destroyedRegisters.remove(reg);
+                        }
+                    };
+                    inst.visitEachTemp(tempConsumer);
+                    inst.visitEachOutput(defConsumer);
+
+                    ZapRegistersOp zap = diagnosticLirGenTool.createZapRegisters(destroyedRegisters.toArray(new Register[destroyedRegisters.size()]));
+                    buffer.append(index + 1, (LIRInstruction) zap);
+                    debug.log("Insert ZapRegister after %s", inst);
                 }
             }
             buffer.finish();
         }
     }
-
-    /**
-     * Returns the {@link LIRFrameState} of an instruction.
-     */
-    private static LIRFrameState getLIRState(LIRInstruction inst) {
-        final LIRFrameState[] lirState = {null};
-        inst.forEachState(state -> {
-            assert lirState[0] == null : "Multiple states: " + inst;
-            lirState[0] = state;
-        });
-        assert lirState[0] != null : "No state: " + inst;
-        return lirState[0];
-    }
-
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/AddressLoweringHotSpotSuitesProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/AddressLoweringHotSpotSuitesProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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.
  * Copyright (c) 2017, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -63,6 +63,7 @@
 import org.graalvm.compiler.hotspot.nodes.HotSpotCompressionNode;
 import org.graalvm.compiler.hotspot.nodes.HotSpotDirectCallTargetNode;
 import org.graalvm.compiler.hotspot.nodes.HotSpotIndirectCallTargetNode;
+import org.graalvm.compiler.hotspot.nodes.KlassBeingInitializedCheckNode;
 import org.graalvm.compiler.hotspot.nodes.aot.InitializeKlassNode;
 import org.graalvm.compiler.hotspot.nodes.aot.ResolveConstantNode;
 import org.graalvm.compiler.hotspot.nodes.aot.ResolveDynamicConstantNode;
@@ -405,6 +406,8 @@
                 }
             } else if (n instanceof ProfileNode) {
                 profileSnippets.lower((ProfileNode) n, tool);
+            } else if (n instanceof KlassBeingInitializedCheckNode) {
+                newObjectSnippets.lower((KlassBeingInitializedCheckNode) n, registers, tool);
             } else {
                 super.lower(n, tool);
             }
@@ -713,6 +716,7 @@
 
         StructuredGraph graph = node.graph();
         ForeignCallNode foreignCallNode = graph.add(new ForeignCallNode(foreignCalls, descriptor, node.stamp(NodeView.DEFAULT), node.getArguments()));
+        foreignCallNode.setStateAfter(node.stateAfter());
         graph.replaceFixedWithFixed(node, foreignCallNode);
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotAOTClassInitializationPlugin.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,96 @@
+/*
+ * 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.
+ */
+
+
+package org.graalvm.compiler.hotspot.meta;
+
+import java.util.function.Supplier;
+
+import org.graalvm.compiler.core.common.type.ObjectStamp;
+import org.graalvm.compiler.core.common.type.Stamp;
+import org.graalvm.compiler.core.common.type.StampFactory;
+import org.graalvm.compiler.hotspot.nodes.aot.InitializeKlassNode;
+import org.graalvm.compiler.hotspot.nodes.aot.ResolveConstantNode;
+import org.graalvm.compiler.nodes.ConstantNode;
+import org.graalvm.compiler.nodes.DeoptimizingFixedWithNextNode;
+import org.graalvm.compiler.nodes.FrameState;
+import org.graalvm.compiler.nodes.ValueNode;
+import org.graalvm.compiler.nodes.graphbuilderconf.ClassInitializationPlugin;
+import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext;
+
+import jdk.vm.ci.hotspot.HotSpotConstantPool;
+import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
+import jdk.vm.ci.meta.ConstantPool;
+import jdk.vm.ci.meta.ResolvedJavaMethod;
+import jdk.vm.ci.meta.ResolvedJavaType;
+
+public final class HotSpotAOTClassInitializationPlugin implements ClassInitializationPlugin {
+    private static boolean shouldApply(GraphBuilderContext builder, ResolvedJavaType type) {
+        if (!builder.parsingIntrinsic()) {
+            if (!type.isArray()) {
+                ResolvedJavaMethod method = builder.getGraph().method();
+                ResolvedJavaType methodHolder = method.getDeclaringClass();
+                // We can elide initialization nodes if type >=: methodHolder.
+                // The type is already initialized by either "new" or "invokestatic".
+
+                // Emit initialization node if type is an interface since:
+                // JLS 12.4: Before a class is initialized, its direct superclass must be
+                // initialized, but interfaces implemented by the class are not
+                // initialized and a class or interface type T will be initialized
+                // immediately before the first occurrence of accesses listed
+                // in JLS 12.4.1.
+
+                return !type.isAssignableFrom(methodHolder) || type.isInterface();
+            } else if (!type.getComponentType().isPrimitive()) {
+                // Always apply to object array types
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public boolean apply(GraphBuilderContext builder, ResolvedJavaType type, Supplier<FrameState> frameState, ValueNode[] classInit) {
+        if (shouldApply(builder, type)) {
+            Stamp hubStamp = builder.getStampProvider().createHubStamp((ObjectStamp) StampFactory.objectNonNull());
+            ConstantNode hub = builder.append(ConstantNode.forConstant(hubStamp, ((HotSpotResolvedObjectType) type).klass(), builder.getMetaAccess(), builder.getGraph()));
+            DeoptimizingFixedWithNextNode result = builder.append(type.isArray() ? new ResolveConstantNode(hub) : new InitializeKlassNode(hub));
+            result.setStateBefore(frameState.get());
+            if (classInit != null) {
+                classInit[0] = result;
+            }
+            return true;
+        }
+        return false;
+    }
+
+    @Override
+    public boolean supportsLazyInitialization(ConstantPool cp) {
+        return true;
+    }
+
+    @Override
+    public void loadReferencedType(GraphBuilderContext builder, ConstantPool cp, int cpi, int opcode) {
+        ((HotSpotConstantPool) cp).loadReferencedType(cpi, opcode, false);
+    }
+}
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotClassInitializationPlugin.java	Mon Sep 23 09:16:05 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package org.graalvm.compiler.hotspot.meta;
-
-import java.util.function.Supplier;
-
-import org.graalvm.compiler.core.common.type.ObjectStamp;
-import org.graalvm.compiler.core.common.type.Stamp;
-import org.graalvm.compiler.core.common.type.StampFactory;
-import org.graalvm.compiler.hotspot.nodes.aot.InitializeKlassNode;
-import org.graalvm.compiler.hotspot.nodes.aot.ResolveConstantNode;
-import org.graalvm.compiler.nodes.ConstantNode;
-import org.graalvm.compiler.nodes.DeoptimizingFixedWithNextNode;
-import org.graalvm.compiler.nodes.FrameState;
-import org.graalvm.compiler.nodes.ValueNode;
-import org.graalvm.compiler.nodes.graphbuilderconf.ClassInitializationPlugin;
-import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext;
-
-import jdk.vm.ci.hotspot.HotSpotConstantPool;
-import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
-import jdk.vm.ci.meta.ConstantPool;
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-import jdk.vm.ci.meta.ResolvedJavaType;
-
-public final class HotSpotClassInitializationPlugin implements ClassInitializationPlugin {
-    private static boolean shouldApply(GraphBuilderContext builder, ResolvedJavaType type) {
-        if (!builder.parsingIntrinsic()) {
-            if (!type.isArray()) {
-                ResolvedJavaMethod method = builder.getGraph().method();
-                ResolvedJavaType methodHolder = method.getDeclaringClass();
-                // We can elide initialization nodes if type >=: methodHolder.
-                // The type is already initialized by either "new" or "invokestatic".
-
-                // Emit initialization node if type is an interface since:
-                // JLS 12.4: Before a class is initialized, its direct superclass must be
-                // initialized, but interfaces implemented by the class are not
-                // initialized and a class or interface type T will be initialized
-                // immediately before the first occurrence of accesses listed
-                // in JLS 12.4.1.
-
-                return !type.isAssignableFrom(methodHolder) || type.isInterface();
-            } else if (!type.getComponentType().isPrimitive()) {
-                // Always apply to object array types
-                return true;
-            }
-        }
-        return false;
-    }
-
-    @Override
-    public boolean apply(GraphBuilderContext builder, ResolvedJavaType type, Supplier<FrameState> frameState, ValueNode[] classInit) {
-        if (shouldApply(builder, type)) {
-            Stamp hubStamp = builder.getStampProvider().createHubStamp((ObjectStamp) StampFactory.objectNonNull());
-            ConstantNode hub = builder.append(ConstantNode.forConstant(hubStamp, ((HotSpotResolvedObjectType) type).klass(), builder.getMetaAccess(), builder.getGraph()));
-            DeoptimizingFixedWithNextNode result = builder.append(type.isArray() ? new ResolveConstantNode(hub) : new InitializeKlassNode(hub));
-            result.setStateBefore(frameState.get());
-            if (classInit != null) {
-                classInit[0] = result;
-            }
-            return true;
-        }
-        return false;
-    }
-
-    @Override
-    public boolean supportsLazyInitialization(ConstantPool cp) {
-        // jdk.vm.ci.hotspot.HotSpotConstantPool is final, so we can
-        // directly compare Classes.
-        return (cp instanceof HotSpotConstantPool);
-    }
-
-    @Override
-    public void loadReferencedType(GraphBuilderContext builder, ConstantPool cp, int cpi, int opcode) {
-        if (cp instanceof HotSpotConstantPool) {
-            ((HotSpotConstantPool) cp).loadReferencedType(cpi, opcode, false);
-        } else {
-            cp.loadReferencedType(cpi, opcode);
-        }
-    }
-
-}
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProviderImpl.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProviderImpl.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -26,7 +26,7 @@
 
 import static jdk.vm.ci.hotspot.HotSpotCallingConventionType.JavaCall;
 import static jdk.vm.ci.hotspot.HotSpotCallingConventionType.JavaCallee;
-import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.PRESERVES_REGISTERS;
+import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.DESTROYS_ALL_CALLER_SAVE_REGISTERS;
 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition.SAFEPOINT;
 
 import java.util.ArrayList;
@@ -114,13 +114,14 @@
                     ForeignCallDescriptor descriptor,
                     Transition transition,
                     Reexecutability reexecutability,
+                    RegisterEffect effect,
                     LocationIdentity... killedLocations) {
         return register(HotSpotForeignCallLinkageImpl.create(metaAccess,
                         codeCache,
                         wordTypes,
                         this,
                         descriptor,
-                        0L, PRESERVES_REGISTERS,
+                        0L, effect,
                         JavaCall,
                         JavaCallee,
                         transition,
@@ -129,13 +130,13 @@
     }
 
     /**
-     * Creates and registers the linkage for a foreign call.
+     * Creates and registers the linkage for a foreign call. All foreign calls are assumed to have
+     * the effect {@link RegisterEffect#DESTROYS_ALL_CALLER_SAVE_REGISTERS} since they are outside
+     * of Graal's knowledge.
      *
      * @param descriptor the signature of the foreign call
      * @param address the address of the code to call (must be non-zero)
      * @param outgoingCcType outgoing (caller) calling convention type
-     * @param effect specifies if the call destroys or preserves all registers (apart from
-     *            temporaries which are always destroyed)
      * @param transition specifies if this is a {@linkplain Transition#LEAF leaf} call
      * @param reexecutability specifies if the foreign call can be re-executed without (meaningful)
      *            side effects. Deoptimization will not return to a point before a foreign call that
@@ -146,7 +147,6 @@
                     ForeignCallDescriptor descriptor,
                     long address,
                     CallingConvention.Type outgoingCcType,
-                    RegisterEffect effect,
                     Transition transition,
                     Reexecutability reexecutability,
                     LocationIdentity... killedLocations) {
@@ -159,7 +159,7 @@
                         this,
                         descriptor,
                         address,
-                        effect,
+                        DESTROYS_ALL_CALLER_SAVE_REGISTERS,
                         outgoingCcType,
                         null, // incomingCcType
                         transition,
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraalConstantFieldProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraalConstantFieldProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java	Wed Sep 25 22:40:41 2019 +0200
@@ -46,6 +46,7 @@
 import org.graalvm.compiler.core.common.type.TypeReference;
 import org.graalvm.compiler.debug.GraalError;
 import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig;
+import org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider;
 import org.graalvm.compiler.hotspot.nodes.CurrentJavaThreadNode;
 import org.graalvm.compiler.hotspot.replacements.AESCryptSubstitutions;
 import org.graalvm.compiler.hotspot.replacements.ArraysSupportSubstitutions;
@@ -128,10 +129,17 @@
      * @param foreignCalls
      * @param options
      */
-    public static Plugins create(CompilerConfiguration compilerConfiguration, GraalHotSpotVMConfig config, HotSpotWordTypes wordTypes, MetaAccessProvider metaAccess,
-                    ConstantReflectionProvider constantReflection, SnippetReflectionProvider snippetReflection, ForeignCallsProvider foreignCalls, ReplacementsImpl replacements,
+    public static Plugins create(HotSpotGraalRuntimeProvider graalRuntime,
+                    CompilerConfiguration compilerConfiguration,
+                    GraalHotSpotVMConfig config,
+                    HotSpotWordTypes wordTypes,
+                    MetaAccessProvider metaAccess,
+                    ConstantReflectionProvider constantReflection,
+                    SnippetReflectionProvider snippetReflection,
+                    ForeignCallsProvider foreignCalls,
+                    ReplacementsImpl replacements,
                     OptionValues options) {
-        InvocationPlugins invocationPlugins = new HotSpotInvocationPlugins(config, compilerConfiguration);
+        InvocationPlugins invocationPlugins = new HotSpotInvocationPlugins(graalRuntime, config, compilerConfiguration);
 
         Plugins plugins = new Plugins(invocationPlugins);
         NodeIntrinsificationProvider nodeIntrinsificationProvider = new NodeIntrinsificationProvider(metaAccess, snippetReflection, foreignCalls, wordTypes);
@@ -149,10 +157,14 @@
         }
 
         if (GeneratePIC.getValue(options)) {
-            plugins.setClassInitializationPlugin(new HotSpotClassInitializationPlugin());
+            plugins.setClassInitializationPlugin(new HotSpotAOTClassInitializationPlugin());
             if (TieredAOT.getValue(options)) {
                 plugins.setProfilingPlugin(new HotSpotAOTProfilingPlugin());
             }
+        } else {
+            if (config.instanceKlassInitThreadOffset != -1) {
+                plugins.setClassInitializationPlugin(new HotSpotJITClassInitializationPlugin());
+            }
         }
 
         invocationPlugins.defer(new Runnable() {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotHostForeignCallsProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotHostForeignCallsProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -69,8 +69,7 @@
 import static org.graalvm.compiler.hotspot.HotSpotBackend.WRONG_METHOD_HANDLER;
 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Reexecutability.NOT_REEXECUTABLE;
 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Reexecutability.REEXECUTABLE;
-import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.DESTROYS_REGISTERS;
-import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.PRESERVES_REGISTERS;
+import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.DESTROYS_ALL_CALLER_SAVE_REGISTERS;
 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition.LEAF;
 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition.LEAF_NO_VZERO;
 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition.SAFEPOINT;
@@ -216,7 +215,7 @@
         String name = kind + (aligned ? "Aligned" : "") + (disjoint ? "Disjoint" : "") + (uninit ? "Uninit" : "") + "Arraycopy" + (killAny ? "KillAny" : "");
         ForeignCallDescriptor desc = new ForeignCallDescriptor(name, void.class, Word.class, Word.class, Word.class);
         LocationIdentity killed = killAny ? LocationIdentity.any() : NamedLocationIdentity.getArrayLocation(kind);
-        registerForeignCall(desc, routine, NativeCall, DESTROYS_REGISTERS, LEAF_NO_VZERO, NOT_REEXECUTABLE, killed);
+        registerForeignCall(desc, routine, NativeCall, LEAF_NO_VZERO, NOT_REEXECUTABLE, killed);
         return desc;
     }
 
@@ -231,7 +230,7 @@
         // return: 0 = success, n = number of copied elements xor'd with -1.
         ForeignCallDescriptor desc = new ForeignCallDescriptor(name, int.class, Word.class, Word.class, Word.class, Word.class, Word.class);
         LocationIdentity killed = NamedLocationIdentity.any();
-        registerForeignCall(desc, routine, NativeCall, DESTROYS_REGISTERS, LEAF_NO_VZERO, NOT_REEXECUTABLE, killed);
+        registerForeignCall(desc, routine, NativeCall, LEAF_NO_VZERO, NOT_REEXECUTABLE, killed);
         checkcastArraycopyDescriptors[uninit ? 1 : 0] = desc;
     }
 
@@ -271,28 +270,28 @@
 
     public void initialize(HotSpotProviders providers, OptionValues options) {
         GraalHotSpotVMConfig c = runtime.getVMConfig();
-        registerForeignCall(DEOPTIMIZATION_HANDLER, c.handleDeoptStub, NativeCall, PRESERVES_REGISTERS, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS);
-        registerForeignCall(UNCOMMON_TRAP_HANDLER, c.uncommonTrapStub, NativeCall, PRESERVES_REGISTERS, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS);
-        registerForeignCall(IC_MISS_HANDLER, c.inlineCacheMissStub, NativeCall, PRESERVES_REGISTERS, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS);
+        registerForeignCall(DEOPTIMIZATION_HANDLER, c.handleDeoptStub, NativeCall, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS);
+        registerForeignCall(UNCOMMON_TRAP_HANDLER, c.uncommonTrapStub, NativeCall, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS);
+        registerForeignCall(IC_MISS_HANDLER, c.inlineCacheMissStub, NativeCall, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS);
 
         if (c.enableStackReservedZoneAddress != 0) {
             assert c.throwDelayedStackOverflowErrorEntry != 0 : "both must exist";
-            registerForeignCall(ENABLE_STACK_RESERVED_ZONE, c.enableStackReservedZoneAddress, NativeCall, DESTROYS_REGISTERS, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS);
-            registerForeignCall(THROW_DELAYED_STACKOVERFLOW_ERROR, c.throwDelayedStackOverflowErrorEntry, NativeCall, DESTROYS_REGISTERS, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS);
+            registerForeignCall(ENABLE_STACK_RESERVED_ZONE, c.enableStackReservedZoneAddress, NativeCall, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS);
+            registerForeignCall(THROW_DELAYED_STACKOVERFLOW_ERROR, c.throwDelayedStackOverflowErrorEntry, NativeCall, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS);
         }
 
-        registerForeignCall(JAVA_TIME_MILLIS, c.javaTimeMillisAddress, NativeCall, DESTROYS_REGISTERS, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS);
-        registerForeignCall(JAVA_TIME_NANOS, c.javaTimeNanosAddress, NativeCall, DESTROYS_REGISTERS, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS);
+        registerForeignCall(JAVA_TIME_MILLIS, c.javaTimeMillisAddress, NativeCall, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS);
+        registerForeignCall(JAVA_TIME_NANOS, c.javaTimeNanosAddress, NativeCall, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS);
 
         registerMathStubs(c, providers, options);
 
-        registerForeignCall(ARITHMETIC_FREM, c.fremAddress, NativeCall, DESTROYS_REGISTERS, LEAF, REEXECUTABLE, NO_LOCATIONS);
-        registerForeignCall(ARITHMETIC_DREM, c.dremAddress, NativeCall, DESTROYS_REGISTERS, LEAF, REEXECUTABLE, NO_LOCATIONS);
+        registerForeignCall(ARITHMETIC_FREM, c.fremAddress, NativeCall, LEAF, REEXECUTABLE, NO_LOCATIONS);
+        registerForeignCall(ARITHMETIC_DREM, c.dremAddress, NativeCall, LEAF, REEXECUTABLE, NO_LOCATIONS);
 
-        registerForeignCall(LOAD_AND_CLEAR_EXCEPTION, c.loadAndClearExceptionAddress, NativeCall, DESTROYS_REGISTERS, LEAF_NO_VZERO, NOT_REEXECUTABLE, any());
+        registerForeignCall(LOAD_AND_CLEAR_EXCEPTION, c.loadAndClearExceptionAddress, NativeCall, LEAF_NO_VZERO, NOT_REEXECUTABLE, any());
 
-        registerForeignCall(EXCEPTION_HANDLER_FOR_PC, c.exceptionHandlerForPcAddress, NativeCall, DESTROYS_REGISTERS, SAFEPOINT, REEXECUTABLE, any());
-        registerForeignCall(EXCEPTION_HANDLER_FOR_RETURN_ADDRESS, c.exceptionHandlerForReturnAddressAddress, NativeCall, DESTROYS_REGISTERS, SAFEPOINT, REEXECUTABLE, any());
+        registerForeignCall(EXCEPTION_HANDLER_FOR_PC, c.exceptionHandlerForPcAddress, NativeCall, SAFEPOINT, REEXECUTABLE, any());
+        registerForeignCall(EXCEPTION_HANDLER_FOR_RETURN_ADDRESS, c.exceptionHandlerForReturnAddressAddress, NativeCall, SAFEPOINT, REEXECUTABLE, any());
 
         CreateExceptionStub.registerForeignCalls(c, this);
 
@@ -300,8 +299,8 @@
          * This message call is registered twice, where the second one must only be used for calls
          * that do not return, i.e., that exit the VM.
          */
-        registerForeignCall(VM_MESSAGE_C, c.vmMessageAddress, NativeCall, DESTROYS_REGISTERS, SAFEPOINT, REEXECUTABLE, NO_LOCATIONS);
-        registerForeignCall(ASSERTION_VM_MESSAGE_C, c.vmMessageAddress, NativeCall, PRESERVES_REGISTERS, LEAF, REEXECUTABLE, NO_LOCATIONS);
+        registerForeignCall(VM_MESSAGE_C, c.vmMessageAddress, NativeCall, SAFEPOINT, REEXECUTABLE, NO_LOCATIONS);
+        registerForeignCall(ASSERTION_VM_MESSAGE_C, c.vmMessageAddress, NativeCall, LEAF, REEXECUTABLE, NO_LOCATIONS);
 
         linkForeignCall(options, providers, NEW_INSTANCE, c.newInstanceAddress, PREPEND_THREAD, SAFEPOINT, REEXECUTABLE, TLAB_TOP_LOCATION, TLAB_END_LOCATION);
         linkForeignCall(options, providers, NEW_ARRAY, c.newArrayAddress, PREPEND_THREAD, SAFEPOINT, REEXECUTABLE, TLAB_TOP_LOCATION, TLAB_END_LOCATION);
@@ -316,17 +315,25 @@
         }
 
         link(new ExceptionHandlerStub(options, providers, foreignCalls.get(EXCEPTION_HANDLER)));
-        link(new UnwindExceptionToCallerStub(options, providers, registerStubCall(UNWIND_EXCEPTION_TO_CALLER, SAFEPOINT, NOT_REEXECUTABLE, any())));
-        link(new VerifyOopStub(options, providers, registerStubCall(VERIFY_OOP, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS)));
+        link(new UnwindExceptionToCallerStub(options, providers,
+                        registerStubCall(UNWIND_EXCEPTION_TO_CALLER, SAFEPOINT, NOT_REEXECUTABLE, DESTROYS_ALL_CALLER_SAVE_REGISTERS, any())));
+        link(new VerifyOopStub(options, providers, registerStubCall(VERIFY_OOP, LEAF_NO_VZERO, REEXECUTABLE, DESTROYS_ALL_CALLER_SAVE_REGISTERS, NO_LOCATIONS)));
 
         EnumMap<BytecodeExceptionKind, ForeignCallDescriptor> exceptionRuntimeCalls = DefaultHotSpotLoweringProvider.RuntimeCalls.runtimeCalls;
-        link(new ArrayStoreExceptionStub(options, providers, registerStubCall(exceptionRuntimeCalls.get(BytecodeExceptionKind.ARRAY_STORE), SAFEPOINT, REEXECUTABLE, any())));
-        link(new ClassCastExceptionStub(options, providers, registerStubCall(exceptionRuntimeCalls.get(BytecodeExceptionKind.CLASS_CAST), SAFEPOINT, REEXECUTABLE, any())));
-        link(new NullPointerExceptionStub(options, providers, registerStubCall(exceptionRuntimeCalls.get(BytecodeExceptionKind.NULL_POINTER), SAFEPOINT, REEXECUTABLE, any())));
-        link(new OutOfBoundsExceptionStub(options, providers, registerStubCall(exceptionRuntimeCalls.get(BytecodeExceptionKind.OUT_OF_BOUNDS), SAFEPOINT, REEXECUTABLE, any())));
-        link(new DivisionByZeroExceptionStub(options, providers, registerStubCall(exceptionRuntimeCalls.get(BytecodeExceptionKind.DIVISION_BY_ZERO), SAFEPOINT, REEXECUTABLE, any())));
-        link(new IntegerExactOverflowExceptionStub(options, providers, registerStubCall(exceptionRuntimeCalls.get(BytecodeExceptionKind.INTEGER_EXACT_OVERFLOW), SAFEPOINT, REEXECUTABLE, any())));
-        link(new LongExactOverflowExceptionStub(options, providers, registerStubCall(exceptionRuntimeCalls.get(BytecodeExceptionKind.LONG_EXACT_OVERFLOW), SAFEPOINT, REEXECUTABLE, any())));
+        link(new ArrayStoreExceptionStub(options, providers,
+                        registerStubCall(exceptionRuntimeCalls.get(BytecodeExceptionKind.ARRAY_STORE), SAFEPOINT, NOT_REEXECUTABLE, DESTROYS_ALL_CALLER_SAVE_REGISTERS, any())));
+        link(new ClassCastExceptionStub(options, providers,
+                        registerStubCall(exceptionRuntimeCalls.get(BytecodeExceptionKind.CLASS_CAST), SAFEPOINT, NOT_REEXECUTABLE, DESTROYS_ALL_CALLER_SAVE_REGISTERS, any())));
+        link(new NullPointerExceptionStub(options, providers,
+                        registerStubCall(exceptionRuntimeCalls.get(BytecodeExceptionKind.NULL_POINTER), SAFEPOINT, NOT_REEXECUTABLE, DESTROYS_ALL_CALLER_SAVE_REGISTERS, any())));
+        link(new OutOfBoundsExceptionStub(options, providers,
+                        registerStubCall(exceptionRuntimeCalls.get(BytecodeExceptionKind.OUT_OF_BOUNDS), SAFEPOINT, NOT_REEXECUTABLE, DESTROYS_ALL_CALLER_SAVE_REGISTERS, any())));
+        link(new DivisionByZeroExceptionStub(options, providers,
+                        registerStubCall(exceptionRuntimeCalls.get(BytecodeExceptionKind.DIVISION_BY_ZERO), SAFEPOINT, NOT_REEXECUTABLE, DESTROYS_ALL_CALLER_SAVE_REGISTERS, any())));
+        link(new IntegerExactOverflowExceptionStub(options, providers,
+                        registerStubCall(exceptionRuntimeCalls.get(BytecodeExceptionKind.INTEGER_EXACT_OVERFLOW), SAFEPOINT, NOT_REEXECUTABLE, DESTROYS_ALL_CALLER_SAVE_REGISTERS, any())));
+        link(new LongExactOverflowExceptionStub(options, providers,
+                        registerStubCall(exceptionRuntimeCalls.get(BytecodeExceptionKind.LONG_EXACT_OVERFLOW), SAFEPOINT, NOT_REEXECUTABLE, DESTROYS_ALL_CALLER_SAVE_REGISTERS, any())));
 
         linkForeignCall(options, providers, IDENTITY_HASHCODE, c.identityHashCodeAddress, PREPEND_THREAD, SAFEPOINT, NOT_REEXECUTABLE, MARK_WORD_LOCATION);
         linkForeignCall(options, providers, REGISTER_FINALIZER, c.registerFinalizerAddress, PREPEND_THREAD, SAFEPOINT, NOT_REEXECUTABLE, any());
@@ -344,7 +351,7 @@
         linkForeignCall(options, providers, VALIDATE_OBJECT, c.validateObject, PREPEND_THREAD, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS);
 
         if (GeneratePIC.getValue(options)) {
-            registerForeignCall(WRONG_METHOD_HANDLER, c.handleWrongMethodStub, NativeCall, PRESERVES_REGISTERS, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS);
+            registerForeignCall(WRONG_METHOD_HANDLER, c.handleWrongMethodStub, NativeCall, LEAF_NO_VZERO, REEXECUTABLE, NO_LOCATIONS);
             CompilerRuntimeHotSpotVMConfig cr = new CompilerRuntimeHotSpotVMConfig(HotSpotJVMCIRuntime.runtime().getConfigStore());
             linkForeignCall(options, providers, RESOLVE_STRING_BY_SYMBOL, cr.resolveStringBySymbol, PREPEND_THREAD, SAFEPOINT, REEXECUTABLE, TLAB_TOP_LOCATION, TLAB_END_LOCATION);
             linkForeignCall(options, providers, RESOLVE_DYNAMIC_INVOKE, cr.resolveDynamicInvoke, PREPEND_THREAD, SAFEPOINT, REEXECUTABLE, any());
@@ -371,45 +378,45 @@
         registerCheckcastArraycopyDescriptor(true, c.checkcastArraycopyUninit);
         registerCheckcastArraycopyDescriptor(false, c.checkcastArraycopy);
 
-        registerForeignCall(GENERIC_ARRAYCOPY, c.genericArraycopy, NativeCall, DESTROYS_REGISTERS, LEAF_NO_VZERO, NOT_REEXECUTABLE, NamedLocationIdentity.any());
-        registerForeignCall(UNSAFE_ARRAYCOPY, c.unsafeArraycopy, NativeCall, DESTROYS_REGISTERS, LEAF_NO_VZERO, NOT_REEXECUTABLE, NamedLocationIdentity.any());
+        registerForeignCall(GENERIC_ARRAYCOPY, c.genericArraycopy, NativeCall, LEAF_NO_VZERO, NOT_REEXECUTABLE, NamedLocationIdentity.any());
+        registerForeignCall(UNSAFE_ARRAYCOPY, c.unsafeArraycopy, NativeCall, LEAF_NO_VZERO, NOT_REEXECUTABLE, NamedLocationIdentity.any());
 
         if (c.useMultiplyToLenIntrinsic()) {
-            registerForeignCall(MULTIPLY_TO_LEN, c.multiplyToLen, NativeCall, DESTROYS_REGISTERS, LEAF_NO_VZERO, NOT_REEXECUTABLE,
+            registerForeignCall(MULTIPLY_TO_LEN, c.multiplyToLen, NativeCall, LEAF_NO_VZERO, NOT_REEXECUTABLE,
                             NamedLocationIdentity.getArrayLocation(JavaKind.Int));
         }
 
         if (c.useSHA1Intrinsics()) {
-            registerForeignCall(SHA_IMPL_COMPRESS, c.sha1ImplCompress, NativeCall, DESTROYS_REGISTERS, LEAF, NOT_REEXECUTABLE, NamedLocationIdentity.any());
-            registerForeignCall(SHA_IMPL_COMPRESS_MB, c.sha1ImplCompressMultiBlock, NativeCall, DESTROYS_REGISTERS, LEAF, NOT_REEXECUTABLE, NamedLocationIdentity.any());
+            registerForeignCall(SHA_IMPL_COMPRESS, c.sha1ImplCompress, NativeCall, LEAF, NOT_REEXECUTABLE, NamedLocationIdentity.any());
+            registerForeignCall(SHA_IMPL_COMPRESS_MB, c.sha1ImplCompressMultiBlock, NativeCall, LEAF, NOT_REEXECUTABLE, NamedLocationIdentity.any());
         }
         if (c.useSHA256Intrinsics()) {
-            registerForeignCall(SHA2_IMPL_COMPRESS, c.sha256ImplCompress, NativeCall, DESTROYS_REGISTERS, LEAF, NOT_REEXECUTABLE, NamedLocationIdentity.any());
-            registerForeignCall(SHA2_IMPL_COMPRESS_MB, c.sha256ImplCompressMultiBlock, NativeCall, DESTROYS_REGISTERS, LEAF, NOT_REEXECUTABLE, NamedLocationIdentity.any());
+            registerForeignCall(SHA2_IMPL_COMPRESS, c.sha256ImplCompress, NativeCall, LEAF, NOT_REEXECUTABLE, NamedLocationIdentity.any());
+            registerForeignCall(SHA2_IMPL_COMPRESS_MB, c.sha256ImplCompressMultiBlock, NativeCall, LEAF, NOT_REEXECUTABLE, NamedLocationIdentity.any());
         }
         if (c.useSHA512Intrinsics()) {
-            registerForeignCall(SHA5_IMPL_COMPRESS, c.sha512ImplCompress, NativeCall, DESTROYS_REGISTERS, LEAF, NOT_REEXECUTABLE, NamedLocationIdentity.any());
-            registerForeignCall(SHA5_IMPL_COMPRESS_MB, c.sha512ImplCompressMultiBlock, NativeCall, DESTROYS_REGISTERS, LEAF, NOT_REEXECUTABLE, NamedLocationIdentity.any());
+            registerForeignCall(SHA5_IMPL_COMPRESS, c.sha512ImplCompress, NativeCall, LEAF, NOT_REEXECUTABLE, NamedLocationIdentity.any());
+            registerForeignCall(SHA5_IMPL_COMPRESS_MB, c.sha512ImplCompressMultiBlock, NativeCall, LEAF, NOT_REEXECUTABLE, NamedLocationIdentity.any());
         }
         if (c.useGHASHIntrinsics()) {
-            registerForeignCall(GHASH_PROCESS_BLOCKS, c.ghashProcessBlocks, NativeCall, DESTROYS_REGISTERS, LEAF, NOT_REEXECUTABLE, NamedLocationIdentity.any());
+            registerForeignCall(GHASH_PROCESS_BLOCKS, c.ghashProcessBlocks, NativeCall, LEAF, NOT_REEXECUTABLE, NamedLocationIdentity.any());
         }
         if (c.useBase64Intrinsics()) {
-            registerForeignCall(BASE64_ENCODE_BLOCK, c.base64EncodeBlock, NativeCall, DESTROYS_REGISTERS, LEAF, NOT_REEXECUTABLE, NamedLocationIdentity.any());
+            registerForeignCall(BASE64_ENCODE_BLOCK, c.base64EncodeBlock, NativeCall, LEAF, NOT_REEXECUTABLE, NamedLocationIdentity.any());
         }
         if (c.useMulAddIntrinsic()) {
-            registerForeignCall(MUL_ADD, c.mulAdd, NativeCall, DESTROYS_REGISTERS, LEAF_NO_VZERO, NOT_REEXECUTABLE, NamedLocationIdentity.getArrayLocation(JavaKind.Int));
+            registerForeignCall(MUL_ADD, c.mulAdd, NativeCall, LEAF_NO_VZERO, NOT_REEXECUTABLE, NamedLocationIdentity.getArrayLocation(JavaKind.Int));
         }
         if (c.useMontgomeryMultiplyIntrinsic()) {
-            registerForeignCall(MONTGOMERY_MULTIPLY, c.montgomeryMultiply, NativeCall, DESTROYS_REGISTERS, LEAF_NO_VZERO, NOT_REEXECUTABLE,
+            registerForeignCall(MONTGOMERY_MULTIPLY, c.montgomeryMultiply, NativeCall, LEAF_NO_VZERO, NOT_REEXECUTABLE,
                             NamedLocationIdentity.getArrayLocation(JavaKind.Int));
         }
         if (c.useMontgomerySquareIntrinsic()) {
-            registerForeignCall(MONTGOMERY_SQUARE, c.montgomerySquare, NativeCall, DESTROYS_REGISTERS, LEAF_NO_VZERO, NOT_REEXECUTABLE,
+            registerForeignCall(MONTGOMERY_SQUARE, c.montgomerySquare, NativeCall, LEAF_NO_VZERO, NOT_REEXECUTABLE,
                             NamedLocationIdentity.getArrayLocation(JavaKind.Int));
         }
         if (c.useSquareToLenIntrinsic()) {
-            registerForeignCall(SQUARE_TO_LEN, c.squareToLen, NativeCall, DESTROYS_REGISTERS, LEAF_NO_VZERO, NOT_REEXECUTABLE, NamedLocationIdentity.getArrayLocation(JavaKind.Int));
+            registerForeignCall(SQUARE_TO_LEN, c.squareToLen, NativeCall, LEAF_NO_VZERO, NOT_REEXECUTABLE, NamedLocationIdentity.getArrayLocation(JavaKind.Int));
         }
 
         if (c.useAESIntrinsics) {
@@ -420,11 +427,11 @@
              */
             try {
                 // These stubs do callee saving
-                registerForeignCall(ENCRYPT_BLOCK, c.aescryptEncryptBlockStub, NativeCall, PRESERVES_REGISTERS, LEAF, NOT_REEXECUTABLE,
+                registerForeignCall(ENCRYPT_BLOCK, c.aescryptEncryptBlockStub, NativeCall, LEAF, NOT_REEXECUTABLE,
                                 NamedLocationIdentity.getArrayLocation(JavaKind.Byte));
-                registerForeignCall(DECRYPT_BLOCK, c.aescryptDecryptBlockStub, NativeCall, PRESERVES_REGISTERS, LEAF, NOT_REEXECUTABLE,
+                registerForeignCall(DECRYPT_BLOCK, c.aescryptDecryptBlockStub, NativeCall, LEAF, NOT_REEXECUTABLE,
                                 NamedLocationIdentity.getArrayLocation(JavaKind.Byte));
-                registerForeignCall(DECRYPT_BLOCK_WITH_ORIGINAL_KEY, c.aescryptDecryptBlockStub, NativeCall, PRESERVES_REGISTERS, LEAF, NOT_REEXECUTABLE,
+                registerForeignCall(DECRYPT_BLOCK_WITH_ORIGINAL_KEY, c.aescryptDecryptBlockStub, NativeCall, LEAF, NOT_REEXECUTABLE,
                                 NamedLocationIdentity.getArrayLocation(JavaKind.Byte));
             } catch (GraalError e) {
                 if (!(e.getCause() instanceof ClassNotFoundException)) {
@@ -433,11 +440,11 @@
             }
             try {
                 // These stubs do callee saving
-                registerForeignCall(ENCRYPT, c.cipherBlockChainingEncryptAESCryptStub, NativeCall, PRESERVES_REGISTERS, LEAF, NOT_REEXECUTABLE,
+                registerForeignCall(ENCRYPT, c.cipherBlockChainingEncryptAESCryptStub, NativeCall, LEAF, NOT_REEXECUTABLE,
                                 NamedLocationIdentity.getArrayLocation(JavaKind.Byte));
-                registerForeignCall(DECRYPT, c.cipherBlockChainingDecryptAESCryptStub, NativeCall, PRESERVES_REGISTERS, LEAF, NOT_REEXECUTABLE,
+                registerForeignCall(DECRYPT, c.cipherBlockChainingDecryptAESCryptStub, NativeCall, LEAF, NOT_REEXECUTABLE,
                                 NamedLocationIdentity.getArrayLocation(JavaKind.Byte));
-                registerForeignCall(DECRYPT_WITH_ORIGINAL_KEY, c.cipherBlockChainingDecryptAESCryptStub, NativeCall, PRESERVES_REGISTERS, LEAF, NOT_REEXECUTABLE,
+                registerForeignCall(DECRYPT_WITH_ORIGINAL_KEY, c.cipherBlockChainingDecryptAESCryptStub, NativeCall, LEAF, NOT_REEXECUTABLE,
                                 NamedLocationIdentity.getArrayLocation(JavaKind.Byte));
             } catch (GraalError e) {
                 if (!(e.getCause() instanceof ClassNotFoundException)) {
@@ -448,13 +455,13 @@
 
         if (c.useAESCTRIntrinsics) {
             assert (c.counterModeAESCrypt != 0L);
-            registerForeignCall(COUNTERMODE_IMPL_CRYPT, c.counterModeAESCrypt, NativeCall, PRESERVES_REGISTERS, LEAF, NOT_REEXECUTABLE,
+            registerForeignCall(COUNTERMODE_IMPL_CRYPT, c.counterModeAESCrypt, NativeCall, LEAF, NOT_REEXECUTABLE,
                             NamedLocationIdentity.any());
         }
 
         if (c.useVectorizedMismatchIntrinsic) {
             assert (c.vectorizedMismatch != 0L);
-            registerForeignCall(VECTORIZED_MISMATCHED, c.vectorizedMismatch, NativeCall, PRESERVES_REGISTERS, LEAF, NOT_REEXECUTABLE,
+            registerForeignCall(VECTORIZED_MISMATCHED, c.vectorizedMismatch, NativeCall, LEAF, NOT_REEXECUTABLE,
                             NamedLocationIdentity.any());
 
         }
@@ -467,12 +474,12 @@
 
     @SuppressWarnings("unused")
     protected void registerMathStubs(GraalHotSpotVMConfig hotSpotVMConfig, HotSpotProviders providers, OptionValues options) {
-        registerForeignCall(SIN.foreignCallDescriptor, hotSpotVMConfig.arithmeticSinAddress, NativeCall, DESTROYS_REGISTERS, LEAF, REEXECUTABLE, NO_LOCATIONS);
-        registerForeignCall(COS.foreignCallDescriptor, hotSpotVMConfig.arithmeticCosAddress, NativeCall, DESTROYS_REGISTERS, LEAF, REEXECUTABLE, NO_LOCATIONS);
-        registerForeignCall(TAN.foreignCallDescriptor, hotSpotVMConfig.arithmeticTanAddress, NativeCall, DESTROYS_REGISTERS, LEAF, REEXECUTABLE, NO_LOCATIONS);
-        registerForeignCall(EXP.foreignCallDescriptor, hotSpotVMConfig.arithmeticExpAddress, NativeCall, DESTROYS_REGISTERS, LEAF, REEXECUTABLE, NO_LOCATIONS);
-        registerForeignCall(LOG.foreignCallDescriptor, hotSpotVMConfig.arithmeticLogAddress, NativeCall, DESTROYS_REGISTERS, LEAF, REEXECUTABLE, NO_LOCATIONS);
-        registerForeignCall(LOG10.foreignCallDescriptor, hotSpotVMConfig.arithmeticLog10Address, NativeCall, DESTROYS_REGISTERS, LEAF, REEXECUTABLE, NO_LOCATIONS);
-        registerForeignCall(POW.foreignCallDescriptor, hotSpotVMConfig.arithmeticPowAddress, NativeCall, DESTROYS_REGISTERS, LEAF, REEXECUTABLE, NO_LOCATIONS);
+        registerForeignCall(SIN.foreignCallDescriptor, hotSpotVMConfig.arithmeticSinAddress, NativeCall, LEAF, REEXECUTABLE, NO_LOCATIONS);
+        registerForeignCall(COS.foreignCallDescriptor, hotSpotVMConfig.arithmeticCosAddress, NativeCall, LEAF, REEXECUTABLE, NO_LOCATIONS);
+        registerForeignCall(TAN.foreignCallDescriptor, hotSpotVMConfig.arithmeticTanAddress, NativeCall, LEAF, REEXECUTABLE, NO_LOCATIONS);
+        registerForeignCall(EXP.foreignCallDescriptor, hotSpotVMConfig.arithmeticExpAddress, NativeCall, LEAF, REEXECUTABLE, NO_LOCATIONS);
+        registerForeignCall(LOG.foreignCallDescriptor, hotSpotVMConfig.arithmeticLogAddress, NativeCall, LEAF, REEXECUTABLE, NO_LOCATIONS);
+        registerForeignCall(LOG10.foreignCallDescriptor, hotSpotVMConfig.arithmeticLog10Address, NativeCall, LEAF, REEXECUTABLE, NO_LOCATIONS);
+        registerForeignCall(POW.foreignCallDescriptor, hotSpotVMConfig.arithmeticPowAddress, NativeCall, LEAF, REEXECUTABLE, NO_LOCATIONS);
     }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotInvocationPlugins.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotInvocationPlugins.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -30,9 +30,11 @@
 import java.util.function.Predicate;
 
 import org.graalvm.compiler.core.common.GraalOptions;
+import org.graalvm.compiler.debug.GraalError;
 import org.graalvm.compiler.graph.Node;
 import org.graalvm.compiler.graph.iterators.NodeIterable;
 import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig;
+import org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider;
 import org.graalvm.compiler.hotspot.phases.AheadOfTimeVerificationPhase;
 import org.graalvm.compiler.nodes.ConstantNode;
 import org.graalvm.compiler.nodes.FrameState;
@@ -50,10 +52,12 @@
  * Extension of {@link InvocationPlugins} that disables plugins based on runtime configuration.
  */
 final class HotSpotInvocationPlugins extends InvocationPlugins {
+    private final HotSpotGraalRuntimeProvider graalRuntime;
     private final GraalHotSpotVMConfig config;
     private final Predicate<ResolvedJavaType> intrinsificationPredicate;
 
-    HotSpotInvocationPlugins(GraalHotSpotVMConfig config, CompilerConfiguration compilerConfiguration) {
+    HotSpotInvocationPlugins(HotSpotGraalRuntimeProvider graalRuntime, GraalHotSpotVMConfig config, CompilerConfiguration compilerConfiguration) {
+        this.graalRuntime = graalRuntime;
         this.config = config;
         this.intrinsificationPredicate = runtime().getIntrinsificationTrustPredicate(compilerConfiguration.getClass());
     }
@@ -106,6 +110,13 @@
 
     @Override
     public boolean canBeIntrinsified(ResolvedJavaType declaringClass) {
-        return intrinsificationPredicate.test(declaringClass);
+        if (!intrinsificationPredicate.test(declaringClass)) {
+            if (graalRuntime.isBootstrapping()) {
+                throw GraalError.shouldNotReachHere("Class declaring a method for which a Graal intrinsic is available should be trusted for intrinsification: " + declaringClass.toJavaName());
+            }
+            return false;
+        }
+        return true;
+
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotJITClassInitializationPlugin.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,76 @@
+/*
+ * 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 org.graalvm.compiler.hotspot.meta;
+
+import static org.graalvm.compiler.bytecode.Bytecodes.GETSTATIC;
+import static org.graalvm.compiler.bytecode.Bytecodes.INVOKESTATIC;
+import static org.graalvm.compiler.bytecode.Bytecodes.NEW;
+import static org.graalvm.compiler.bytecode.Bytecodes.PUTSTATIC;
+
+import java.util.function.Supplier;
+
+import org.graalvm.compiler.hotspot.nodes.KlassBeingInitializedCheckNode;
+import org.graalvm.compiler.hotspot.nodes.type.KlassPointerStamp;
+import org.graalvm.compiler.nodes.ConstantNode;
+import org.graalvm.compiler.nodes.FrameState;
+import org.graalvm.compiler.nodes.ValueNode;
+import org.graalvm.compiler.nodes.graphbuilderconf.ClassInitializationPlugin;
+import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext;
+
+import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
+import jdk.vm.ci.meta.ConstantPool;
+import jdk.vm.ci.meta.ResolvedJavaType;
+
+public final class HotSpotJITClassInitializationPlugin implements ClassInitializationPlugin {
+    @Override
+    public boolean apply(GraphBuilderContext builder, ResolvedJavaType type, Supplier<FrameState> frameState, ValueNode[] classInit) {
+        if (!type.isInitialized() && (type.isInstanceClass() || type.isInterface())) {
+            int code = builder.getCode().getCode()[builder.bci()] & 0xff;
+            switch (code) {
+                case INVOKESTATIC:
+                case GETSTATIC:
+                case PUTSTATIC:
+                case NEW:
+                    ValueNode typeConstant = ConstantNode.forConstant(KlassPointerStamp.klass(), ((HotSpotResolvedObjectType) type).klass(), builder.getMetaAccess());
+                    builder.add(new KlassBeingInitializedCheckNode(typeConstant));
+                    return true;
+                default:
+
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public boolean supportsLazyInitialization(ConstantPool cp) {
+        return false;
+    }
+
+    @Override
+    public void loadReferencedType(GraphBuilderContext builder, ConstantPool cp, int cpi, int opcode) {
+        cp.loadReferencedType(cpi, opcode);
+    }
+
+}
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProviders.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProviders.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotStampProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotStampProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -24,8 +24,8 @@
 
 package org.graalvm.compiler.hotspot.meta;
 
+import org.graalvm.compiler.core.common.type.AbstractPointerStamp;
 import org.graalvm.compiler.core.common.type.ObjectStamp;
-import org.graalvm.compiler.core.common.type.Stamp;
 import org.graalvm.compiler.hotspot.nodes.type.KlassPointerStamp;
 import org.graalvm.compiler.hotspot.nodes.type.MethodPointerStamp;
 import org.graalvm.compiler.nodes.spi.StampProvider;
@@ -33,12 +33,12 @@
 public class HotSpotStampProvider implements StampProvider {
 
     @Override
-    public Stamp createHubStamp(ObjectStamp object) {
+    public AbstractPointerStamp createHubStamp(ObjectStamp object) {
         return KlassPointerStamp.klassNonNull();
     }
 
     @Override
-    public Stamp createMethodStamp() {
+    public AbstractPointerStamp createMethodStamp() {
         return MethodPointerStamp.methodNonNull();
     }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSuitesProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSuitesProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotUnsafeSubstitutions.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotUnsafeSubstitutions.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotWordOperationPlugin.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotWordOperationPlugin.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AllocaNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AllocaNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DimensionsNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DimensionsNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/KlassBeingInitializedCheckNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,62 @@
+/*
+ * 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 org.graalvm.compiler.hotspot.nodes;
+
+import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_4;
+import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_16;
+
+import org.graalvm.compiler.core.common.type.StampFactory;
+import org.graalvm.compiler.graph.NodeClass;
+import org.graalvm.compiler.nodeinfo.NodeInfo;
+import org.graalvm.compiler.nodes.DeoptimizingFixedWithNextNode;
+import org.graalvm.compiler.nodes.ValueNode;
+import org.graalvm.compiler.nodes.spi.Lowerable;
+import org.graalvm.compiler.nodes.spi.LoweringTool;
+
+@NodeInfo(cycles = CYCLES_4, size = SIZE_16)
+public class KlassBeingInitializedCheckNode extends DeoptimizingFixedWithNextNode implements Lowerable {
+    public static final NodeClass<KlassBeingInitializedCheckNode> TYPE = NodeClass.create(KlassBeingInitializedCheckNode.class);
+
+    @Input protected ValueNode klass;
+
+    public KlassBeingInitializedCheckNode(ValueNode klass) {
+        super(TYPE, StampFactory.forVoid());
+        this.klass = klass;
+    }
+
+    public ValueNode getKlass() {
+        return klass;
+    }
+
+    @Override
+    public boolean canDeoptimize() {
+        return true;
+    }
+
+    @Override
+    public void lower(LoweringTool tool) {
+        tool.getLowerer().lower(this, tool);
+    }
+}
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/MonitorCounterNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/MonitorCounterNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/KlassPointerStamp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/KlassPointerStamp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/AheadOfTimeVerificationPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/AheadOfTimeVerificationPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/LoadJavaMirrorWithKlassPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/LoadJavaMirrorWithKlassPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/AOTInliningPolicy.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/AOTInliningPolicy.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/EliminateRedundantInitializationPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/EliminateRedundantInitializationPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/ReplaceConstantNodesPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/ReplaceConstantNodesPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -32,6 +32,7 @@
 import java.util.List;
 
 import jdk.internal.vm.compiler.collections.EconomicMap;
+import jdk.internal.vm.compiler.collections.Equivalence;
 import org.graalvm.compiler.core.common.cfg.BlockMap;
 import org.graalvm.compiler.core.common.type.ObjectStamp;
 import org.graalvm.compiler.core.common.type.Stamp;
@@ -318,7 +319,7 @@
         NodeMap<Block> nodeToBlock = schedule.getNodeToBlockMap();
         BlockMap<List<Node>> blockToNodes = schedule.getBlockToNodesMap();
 
-        EconomicMap<Block, Node> blockToExisting = EconomicMap.create();
+        EconomicMap<Block, Node> blockToExisting = EconomicMap.create(Equivalence.IDENTITY);
         for (Node n : node.usages().filter(n -> isReplacementNode(n))) {
             blockToExisting.put(nodeToBlock.get(n), n);
         }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/profiling/FinalizeProfileNodesPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/profiling/FinalizeProfileNodesPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AssertionSnippets.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AssertionSnippets.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -24,6 +24,8 @@
 
 package org.graalvm.compiler.hotspot.replacements;
 
+import static org.graalvm.compiler.api.directives.GraalDirectives.SLOWPATH_PROBABILITY;
+import static org.graalvm.compiler.api.directives.GraalDirectives.injectBranchProbability;
 import static org.graalvm.compiler.replacements.SnippetTemplate.DEFAULT_REPLACER;
 import static org.graalvm.compiler.replacements.nodes.CStringConstant.cstring;
 
@@ -58,14 +60,14 @@
 
     @Snippet
     public static void assertion(boolean condition, @ConstantParameter String message) {
-        if (!condition) {
+        if (injectBranchProbability(SLOWPATH_PROBABILITY, !condition)) {
             vmMessageC(ASSERTION_VM_MESSAGE_C, true, cstring(message), 0L, 0L, 0L);
         }
     }
 
     @Snippet
     public static void stubAssertion(boolean condition, @ConstantParameter String message) {
-        if (!condition) {
+        if (injectBranchProbability(SLOWPATH_PROBABILITY, !condition)) {
             vmMessageC(ASSERTION_VM_MESSAGE_C, true, cstring(message), 0L, 0L, 0L);
         }
     }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotClassSubstitutions.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotClassSubstitutions.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java	Wed Sep 25 22:40:41 2019 +0200
@@ -51,6 +51,7 @@
 import org.graalvm.compiler.nodes.ValueNode;
 import org.graalvm.compiler.nodes.extended.ForeignCallNode;
 import org.graalvm.compiler.nodes.extended.LoadHubNode;
+import org.graalvm.compiler.nodes.extended.LoadHubOrNullNode;
 import org.graalvm.compiler.nodes.extended.RawLoadNode;
 import org.graalvm.compiler.nodes.extended.StoreHubNode;
 import org.graalvm.compiler.nodes.graphbuilderconf.IntrinsicContext;
@@ -777,29 +778,50 @@
     @NodeIntrinsic(value = LoadHubNode.class)
     public static native KlassPointer loadHubIntrinsic(Object object);
 
-    public static final LocationIdentity CLASS_STATE_LOCATION = NamedLocationIdentity.mutable("ClassState");
+    @NodeIntrinsic(value = LoadHubOrNullNode.class)
+    public static native KlassPointer loadHubOrNullIntrinsic(Object object);
+
+    static final LocationIdentity CLASS_INIT_STATE_LOCATION = NamedLocationIdentity.mutable("ClassInitState");
+
+    static final LocationIdentity CLASS_INIT_THREAD_LOCATION = NamedLocationIdentity.mutable("ClassInitThread");
 
     @Fold
-    public static int instanceKlassInitStateOffset(@InjectedParameter GraalHotSpotVMConfig config) {
+    static int instanceKlassInitStateOffset(@InjectedParameter GraalHotSpotVMConfig config) {
         return config.instanceKlassInitStateOffset;
     }
 
     @Fold
+    static int instanceKlassInitThreadOffset(@InjectedParameter GraalHotSpotVMConfig config) {
+        assert config.instanceKlassInitThreadOffset != -1;
+        return config.instanceKlassInitThreadOffset;
+    }
+
+    @Fold
     public static int instanceKlassStateFullyInitialized(@InjectedParameter GraalHotSpotVMConfig config) {
         return config.instanceKlassStateFullyInitialized;
     }
 
+    @Fold
+    public static int instanceKlassStateBeingInitialized(@InjectedParameter GraalHotSpotVMConfig config) {
+        assert config.instanceKlassStateBeingInitialized != -1;
+        return config.instanceKlassStateBeingInitialized;
+    }
+
     /**
      *
      * @param hub the hub of an InstanceKlass
      * @return true is the InstanceKlass represented by hub is fully initialized
      */
     public static boolean isInstanceKlassFullyInitialized(KlassPointer hub) {
-        return readInstanceKlassState(hub) == instanceKlassStateFullyInitialized(INJECTED_VMCONFIG);
+        return readInstanceKlassInitState(hub) == instanceKlassStateFullyInitialized(INJECTED_VMCONFIG);
     }
 
-    private static byte readInstanceKlassState(KlassPointer hub) {
-        return hub.readByte(instanceKlassInitStateOffset(INJECTED_VMCONFIG), CLASS_STATE_LOCATION);
+    static byte readInstanceKlassInitState(KlassPointer hub) {
+        return hub.readByte(instanceKlassInitStateOffset(INJECTED_VMCONFIG), CLASS_INIT_STATE_LOCATION);
+    }
+
+    static Word readInstanceKlassInitThread(KlassPointer hub) {
+        return hub.readWord(instanceKlassInitThreadOffset(INJECTED_VMCONFIG), CLASS_INIT_THREAD_LOCATION);
     }
 
     public static final LocationIdentity KLASS_MODIFIER_FLAGS_LOCATION = NamedLocationIdentity.immutable("Klass::_modifier_flags");
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/InstanceOfSnippets.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/InstanceOfSnippets.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -30,6 +30,7 @@
 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.PRIMARY_SUPERS_LOCATION;
 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.SECONDARY_SUPER_CACHE_LOCATION;
 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.loadHubIntrinsic;
+import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.loadHubOrNullIntrinsic;
 import static org.graalvm.compiler.hotspot.replacements.HotspotSnippetsOptions.TypeCheckMaxHints;
 import static org.graalvm.compiler.hotspot.replacements.HotspotSnippetsOptions.TypeCheckMinProfileHitProbability;
 import static org.graalvm.compiler.hotspot.replacements.TypeCheckSnippetUtils.checkSecondarySubType;
@@ -136,12 +137,7 @@
      */
     @Snippet
     public static Object instanceofExact(Object object, KlassPointer exactHub, Object trueValue, Object falseValue, @ConstantParameter Counters counters) {
-        if (probability(NOT_FREQUENT_PROBABILITY, object == null)) {
-            counters.isNull.inc();
-            return falseValue;
-        }
-        GuardingNode anchorNode = SnippetAnchorNode.anchor();
-        KlassPointer objectHub = loadHubIntrinsic(PiNode.piCastNonNull(object, anchorNode));
+        KlassPointer objectHub = loadHubOrNullIntrinsic(object);
         if (probability(LIKELY_PROBABILITY, objectHub.notEqual(exactHub))) {
             counters.exactMiss.inc();
             return falseValue;
@@ -224,7 +220,7 @@
 
     @Snippet
     public static Object isAssignableFrom(@NonNullParameter Class<?> thisClassNonNull, Class<?> otherClass, Object trueValue, Object falseValue, @ConstantParameter Counters counters) {
-        if (otherClass == null) {
+        if (BranchProbabilityNode.probability(BranchProbabilityNode.DEOPT_PROBABILITY, otherClass == null)) {
             DeoptimizeNode.deopt(DeoptimizationAction.InvalidateReprofile, DeoptimizationReason.NullCheckException);
             return false;
         }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/MonitorSnippets.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/MonitorSnippets.java	Wed Sep 25 22:40:41 2019 +0200
@@ -113,6 +113,7 @@
 import org.graalvm.compiler.nodes.StructuredGraph;
 import org.graalvm.compiler.nodes.ValueNode;
 import org.graalvm.compiler.nodes.debug.DynamicCounterNode;
+import org.graalvm.compiler.nodes.extended.BranchProbabilityNode;
 import org.graalvm.compiler.nodes.extended.ForeignCallNode;
 import org.graalvm.compiler.nodes.extended.MembarNode;
 import org.graalvm.compiler.nodes.java.MethodCallTargetNode;
@@ -474,7 +475,7 @@
     public static void monitorenterStub(Object object, @ConstantParameter int lockDepth, @ConstantParameter boolean trace) {
         verifyOop(object);
         incCounter();
-        if (object == null) {
+        if (BranchProbabilityNode.probability(BranchProbabilityNode.DEOPT_PROBABILITY, object == null)) {
             DeoptimizeNode.deopt(DeoptimizationAction.InvalidateReprofile, DeoptimizationReason.NullCheckException);
         }
         // BeginLockScope nodes do not read from object so a use of object
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/NewObjectSnippets.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/NewObjectSnippets.java	Wed Sep 25 22:40:41 2019 +0200
@@ -24,6 +24,7 @@
 
 package org.graalvm.compiler.hotspot.replacements;
 
+import static jdk.vm.ci.meta.DeoptimizationAction.InvalidateRecompile;
 import static jdk.vm.ci.meta.DeoptimizationAction.None;
 import static jdk.vm.ci.meta.DeoptimizationReason.RuntimeConstraint;
 import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC;
@@ -38,7 +39,7 @@
 import static org.graalvm.compiler.hotspot.HotSpotBackend.NEW_MULTI_ARRAY;
 import static org.graalvm.compiler.hotspot.HotSpotBackend.NEW_MULTI_ARRAY_OR_NULL;
 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.CLASS_ARRAY_KLASS_LOCATION;
-import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.CLASS_STATE_LOCATION;
+import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.CLASS_INIT_STATE_LOCATION;
 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.HUB_WRITE_LOCATION;
 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.MARK_WORD_LOCATION;
 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.PROTOTYPE_MARK_WORD_LOCATION;
@@ -54,6 +55,7 @@
 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.arrayLengthOffset;
 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.initializeObjectHeader;
 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.instanceHeaderSize;
+import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.instanceKlassStateBeingInitialized;
 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.isInstanceKlassFullyInitialized;
 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.layoutHelperHeaderSizeMask;
 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.layoutHelperHeaderSizeShift;
@@ -61,6 +63,8 @@
 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.layoutHelperLog2ElementSizeShift;
 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.loadKlassFromObject;
 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.prototypeMarkWordOffset;
+import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.readInstanceKlassInitState;
+import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.readInstanceKlassInitThread;
 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.readLayoutHelper;
 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.readTlabEnd;
 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.readTlabTop;
@@ -73,9 +77,11 @@
 import static org.graalvm.compiler.hotspot.replacements.HotspotSnippetsOptions.ProfileAllocationsContext;
 import static org.graalvm.compiler.nodes.PiArrayNode.piArrayCastToSnippetReplaceeStamp;
 import static org.graalvm.compiler.nodes.PiNode.piCastToSnippetReplaceeStamp;
+import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.DEOPT_PROBABILITY;
 import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.FAST_PATH_PROBABILITY;
 import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.FREQUENT_PROBABILITY;
 import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.SLOW_PATH_PROBABILITY;
+import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.VERY_FAST_PATH_PROBABILITY;
 import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.probability;
 import static org.graalvm.compiler.replacements.ReplacementsUtil.REPLACEMENTS_ASSERTIONS_ENABLED;
 import static org.graalvm.compiler.replacements.ReplacementsUtil.runtimeAssert;
@@ -99,6 +105,7 @@
 import org.graalvm.compiler.hotspot.meta.HotSpotProviders;
 import org.graalvm.compiler.hotspot.meta.HotSpotRegistersProvider;
 import org.graalvm.compiler.hotspot.nodes.DimensionsNode;
+import org.graalvm.compiler.hotspot.nodes.KlassBeingInitializedCheckNode;
 import org.graalvm.compiler.hotspot.nodes.aot.LoadConstantIndirectlyFixedNode;
 import org.graalvm.compiler.hotspot.nodes.aot.LoadConstantIndirectlyNode;
 import org.graalvm.compiler.hotspot.nodes.type.KlassPointerStamp;
@@ -112,6 +119,7 @@
 import org.graalvm.compiler.nodes.ValueNode;
 import org.graalvm.compiler.nodes.debug.DynamicCounterNode;
 import org.graalvm.compiler.nodes.debug.VerifyHeapNode;
+import org.graalvm.compiler.nodes.extended.BranchProbabilityNode;
 import org.graalvm.compiler.nodes.extended.ForeignCallNode;
 import org.graalvm.compiler.nodes.extended.MembarNode;
 import org.graalvm.compiler.nodes.java.DynamicNewArrayNode;
@@ -290,12 +298,12 @@
                     @ConstantParameter boolean emitMemoryBarrier,
                     @ConstantParameter Register threadRegister,
                     @ConstantParameter Counters counters) {
-        if (probability(SLOW_PATH_PROBABILITY, type == null)) {
+        if (probability(DEOPT_PROBABILITY, type == null)) {
             DeoptimizeNode.deopt(None, RuntimeConstraint);
         }
         Class<?> nonNullType = PiNode.piCastNonNullClass(type, SnippetAnchorNode.anchor());
 
-        if (probability(SLOW_PATH_PROBABILITY, DynamicNewInstanceNode.throwsInstantiationException(type, classClass))) {
+        if (probability(DEOPT_PROBABILITY, DynamicNewInstanceNode.throwsInstantiationException(type, classClass))) {
             DeoptimizeNode.deopt(None, RuntimeConstraint);
         }
 
@@ -312,7 +320,7 @@
         if (probability(FAST_PATH_PROBABILITY, !hub.isNull())) {
             KlassPointer nonNullHub = ClassGetHubNode.piCastNonNull(hub, SnippetAnchorNode.anchor());
 
-            if (probability(FAST_PATH_PROBABILITY, isInstanceKlassFullyInitialized(nonNullHub))) {
+            if (probability(VERY_FAST_PATH_PROBABILITY, isInstanceKlassFullyInitialized(nonNullHub))) {
                 int layoutHelper = readLayoutHelper(nonNullHub);
                 /*
                  * src/share/vm/oops/klass.hpp: For instances, layout helper is a positive number,
@@ -351,12 +359,12 @@
                     @ConstantParameter Register threadRegister,
                     @ConstantParameter boolean maybeUnroll,
                     @ConstantParameter String typeContext,
-                    @ConstantParameter boolean useBulkZeroing,
+                    @ConstantParameter int bulkZeroingStride,
                     @ConstantParameter Counters counters) {
         // Primitive array types are eagerly pre-resolved. We can use a floating load.
         KlassPointer picHub = LoadConstantIndirectlyNode.loadKlass(hub);
         return allocateArrayImpl(picHub, length, prototypeMarkWord, headerSize, log2ElementSize, fillContents,
-                        emitMemoryBarrier, threadRegister, maybeUnroll, typeContext, useBulkZeroing, counters);
+                        emitMemoryBarrier, threadRegister, maybeUnroll, typeContext, bulkZeroingStride, counters);
     }
 
     @Snippet
@@ -370,12 +378,12 @@
                     @ConstantParameter Register threadRegister,
                     @ConstantParameter boolean maybeUnroll,
                     @ConstantParameter String typeContext,
-                    @ConstantParameter boolean useBulkZeroing,
+                    @ConstantParameter int bulkZeroingStride,
                     @ConstantParameter Counters counters) {
         // Array type would be resolved by dominating resolution.
         KlassPointer picHub = LoadConstantIndirectlyFixedNode.loadKlass(hub);
         return allocateArrayImpl(picHub, length, prototypeMarkWord, headerSize, log2ElementSize, fillContents,
-                        emitMemoryBarrier, threadRegister, maybeUnroll, typeContext, useBulkZeroing, counters);
+                        emitMemoryBarrier, threadRegister, maybeUnroll, typeContext, bulkZeroingStride, counters);
     }
 
     @Snippet
@@ -389,7 +397,7 @@
                     @ConstantParameter Register threadRegister,
                     @ConstantParameter boolean maybeUnroll,
                     @ConstantParameter String typeContext,
-                    @ConstantParameter boolean useBulkZeroing,
+                    @ConstantParameter int bulkZeroingStride,
                     @ConstantParameter Counters counters) {
         Object result = allocateArrayImpl(hub,
                         length,
@@ -400,7 +408,7 @@
                         emitMemoryBarrier, threadRegister,
                         maybeUnroll,
                         typeContext,
-                        useBulkZeroing,
+                        bulkZeroingStride,
                         counters);
         return piArrayCastToSnippetReplaceeStamp(verifyOop(result), length);
     }
@@ -424,7 +432,7 @@
                     Register threadRegister,
                     boolean maybeUnroll,
                     String typeContext,
-                    boolean useBulkZeroing,
+                    int bulkZeroingStride,
                     Counters counters) {
         Object result;
         long allocationSize = arrayAllocationSize(length, headerSize, log2ElementSize);
@@ -440,7 +448,7 @@
             if (theCounters != null && theCounters.arrayLoopInit != null) {
                 theCounters.arrayLoopInit.inc();
             }
-            result = formatArray(hub, allocationSize, length, headerSize, top, prototypeMarkWord, fillContents, emitMemoryBarrier, maybeUnroll, useBulkZeroing, counters);
+            result = formatArray(hub, allocationSize, length, headerSize, top, prototypeMarkWord, fillContents, emitMemoryBarrier, maybeUnroll, bulkZeroingStride, counters);
         } else {
             result = newArrayStub(hub, length);
         }
@@ -484,7 +492,7 @@
      * Deoptimizes if {@code obj == null} otherwise returns {@code obj}.
      */
     private static Object nonNullOrDeopt(Object obj) {
-        if (obj == null) {
+        if (BranchProbabilityNode.probability(BranchProbabilityNode.DEOPT_PROBABILITY, obj == null)) {
             DeoptimizeNode.deopt(None, RuntimeConstraint);
         }
         return obj;
@@ -505,11 +513,11 @@
                     @ConstantParameter Register threadRegister,
                     @ConstantParameter JavaKind knownElementKind,
                     @ConstantParameter int knownLayoutHelper,
-                    @ConstantParameter boolean useBulkZeroing,
+                    @ConstantParameter int bulkZeroingStride,
                     Word prototypeMarkWord,
                     @ConstantParameter Counters counters) {
         Object result = allocateArrayDynamicImpl(elementType, voidClass, length, fillContents, emitMemoryBarrier, threadRegister, knownElementKind,
-                        knownLayoutHelper, useBulkZeroing, prototypeMarkWord, counters);
+                        knownLayoutHelper, bulkZeroingStride, prototypeMarkWord, counters);
         return result;
     }
 
@@ -521,7 +529,7 @@
                     Register threadRegister,
                     JavaKind knownElementKind,
                     int knownLayoutHelper,
-                    boolean useBulkZeroing,
+                    int bulkZeroingStride,
                     Word prototypeMarkWord,
                     Counters counters) {
         /*
@@ -534,12 +542,12 @@
         }
 
         KlassPointer klass = loadKlassFromObject(elementType, arrayKlassOffset(INJECTED_VMCONFIG), CLASS_ARRAY_KLASS_LOCATION);
-        if (klass.isNull()) {
+        if (probability(DEOPT_PROBABILITY, klass.isNull())) {
             DeoptimizeNode.deopt(None, RuntimeConstraint);
         }
         KlassPointer nonNullKlass = ClassGetHubNode.piCastNonNull(klass, SnippetAnchorNode.anchor());
 
-        if (length < 0) {
+        if (probability(DEOPT_PROBABILITY, length < 0)) {
             DeoptimizeNode.deopt(None, RuntimeConstraint);
         }
         int layoutHelper;
@@ -566,7 +574,7 @@
         int log2ElementSize = (layoutHelper >> layoutHelperLog2ElementSizeShift(INJECTED_VMCONFIG)) & layoutHelperLog2ElementSizeMask(INJECTED_VMCONFIG);
 
         Object result = allocateArrayImpl(nonNullKlass, length, prototypeMarkWord, headerSize, log2ElementSize, fillContents,
-                        emitMemoryBarrier, threadRegister, false, "dynamic type", useBulkZeroing, counters);
+                        emitMemoryBarrier, threadRegister, false, "dynamic type", bulkZeroingStride, counters);
         return piArrayCastToSnippetReplaceeStamp(verifyOop(result), length);
     }
 
@@ -614,21 +622,21 @@
      * Zero uninitialized memory in a newly allocated object, unrolling as necessary and ensuring
      * that stores are aligned.
      *
-     * @param size number of bytes to zero
      * @param memory beginning of object which is being zeroed
-     * @param constantSize is {@code size} known to be constant in the snippet
-     * @param startOffset offset to begin zeroing. May not be word aligned.
+     * @param startOffset offset to begin zeroing (inclusive). May not be word aligned.
+     * @param endOffset offset to stop zeroing (exclusive). May not be word aligned.
+     * @param isEndOffsetConstant is {@code endOffset} known to be constant in the snippet
      * @param manualUnroll maximally unroll zeroing
-     * @param useBulkZeroing apply bulk zeroing
+     * @param bulkZeroingStride stride of bulk zeroing supported by the backend
      */
-    private static void zeroMemory(long size, Word memory, boolean constantSize, int startOffset, boolean manualUnroll,
-                    boolean useBulkZeroing, Counters counters) {
-        fillMemory(0, size, memory, constantSize, startOffset, manualUnroll, useBulkZeroing, counters);
+    private static void zeroMemory(Word memory, int startOffset, long endOffset, boolean isEndOffsetConstant, boolean manualUnroll,
+                    int bulkZeroingStride, Counters counters) {
+        fillMemory(0, memory, startOffset, endOffset, isEndOffsetConstant, manualUnroll, bulkZeroingStride, counters);
     }
 
-    private static void fillMemory(long value, long size, Word memory, boolean constantSize, int startOffset, boolean manualUnroll,
-                    boolean useBulkZeroing, Counters counters) {
-        ReplacementsUtil.runtimeAssert((size & 0x7) == 0, "unaligned object size");
+    private static void fillMemory(long value, Word memory, int startOffset, long offsetLimit, boolean constantOffsetLimit, boolean manualUnroll,
+                    int bulkZeroingStride, Counters counters) {
+        ReplacementsUtil.runtimeAssert((offsetLimit & 0x7) == 0, "unaligned object size");
         int offset = startOffset;
         if ((offset & 0x7) != 0) {
             memory.writeInt(offset, (int) value, LocationIdentity.init());
@@ -636,8 +644,8 @@
         }
         ReplacementsUtil.runtimeAssert((offset & 0x7) == 0, "unaligned offset");
         Counters theCounters = counters;
-        if (manualUnroll && ((size - offset) / 8) <= MAX_UNROLLED_OBJECT_ZEROING_STORES) {
-            ReplacementsUtil.staticAssert(!constantSize, "size shouldn't be constant at instantiation time");
+        if (manualUnroll && ((offsetLimit - offset) / 8) <= MAX_UNROLLED_OBJECT_ZEROING_STORES) {
+            ReplacementsUtil.staticAssert(!constantOffsetLimit, "size shouldn't be constant at instantiation time");
             // This case handles arrays of constant length. Instead of having a snippet variant for
             // each length, generate a chain of stores of maximum length. Once it's inlined the
             // break statement will trim excess stores.
@@ -647,7 +655,7 @@
 
             explodeLoop();
             for (int i = 0; i < MAX_UNROLLED_OBJECT_ZEROING_STORES; i++, offset += 8) {
-                if (offset == size) {
+                if (offset == offsetLimit) {
                     break;
                 }
                 memory.initializeLong(offset, value, LocationIdentity.init());
@@ -655,13 +663,13 @@
         } else {
             // Use Word instead of int to avoid extension to long in generated code
             Word off = WordFactory.signed(offset);
-            if (useBulkZeroing && value == 0 && probability(SLOW_PATH_PROBABILITY, (size - offset) >= getMinimalBulkZeroingSize(INJECTED_OPTIONVALUES))) {
+            if (bulkZeroingStride > 0 && value == 0 && probability(SLOW_PATH_PROBABILITY, (offsetLimit - offset) >= getMinimalBulkZeroingSize(INJECTED_OPTIONVALUES))) {
                 if (theCounters != null && theCounters.instanceBulkInit != null) {
                     theCounters.instanceBulkInit.inc();
                 }
-                ZeroMemoryNode.zero(memory.add(off), size - offset, LocationIdentity.init());
+                ZeroMemoryNode.zero(memory.add(off), offsetLimit - offset, LocationIdentity.init());
             } else {
-                if (constantSize && ((size - offset) / 8) <= MAX_UNROLLED_OBJECT_ZEROING_STORES) {
+                if (constantOffsetLimit && ((offsetLimit - offset) / 8) <= MAX_UNROLLED_OBJECT_ZEROING_STORES) {
                     if (theCounters != null && theCounters.instanceSeqInit != null) {
                         theCounters.instanceSeqInit.inc();
                     }
@@ -671,7 +679,7 @@
                         theCounters.instanceLoopInit.inc();
                     }
                 }
-                for (; off.rawValue() < size; off = off.add(8)) {
+                for (; off.rawValue() < offsetLimit; off = off.add(8)) {
                     memory.initializeLong(off, value, LocationIdentity.init());
                 }
             }
@@ -687,14 +695,15 @@
      * Fill uninitialized memory with garbage value in a newly allocated object, unrolling as
      * necessary and ensuring that stores are aligned.
      *
-     * @param size number of bytes to zero
      * @param memory beginning of object which is being zeroed
-     * @param constantSize is {@code  size} known to be constant in the snippet
-     * @param startOffset offset to begin zeroing. May not be word aligned.
+     * @param startOffset offset to begin filling garbage value (inclusive). May not be word
+     *            aligned.
+     * @param endOffset offset to stop filling garbage value (exclusive). May not be word aligned.
+     * @param isEndOffsetConstant is {@code  endOffset} known to be constant in the snippet
      * @param manualUnroll maximally unroll zeroing
      */
-    private static void fillWithGarbage(long size, Word memory, boolean constantSize, int startOffset, boolean manualUnroll, Counters counters) {
-        fillMemory(0xfefefefefefefefeL, size, memory, constantSize, startOffset, manualUnroll, false, counters);
+    private static void fillWithGarbage(Word memory, int startOffset, long endOffset, boolean isEndOffsetConstant, boolean manualUnroll, Counters counters) {
+        fillMemory(0xfefefefefefefefeL, memory, startOffset, endOffset, isEndOffsetConstant, manualUnroll, 0, counters);
     }
 
     /**
@@ -711,9 +720,9 @@
         Word prototypeMarkWord = useBiasedLocking(INJECTED_VMCONFIG) ? hub.readWord(prototypeMarkWordOffset(INJECTED_VMCONFIG), PROTOTYPE_MARK_WORD_LOCATION) : compileTimePrototypeMarkWord;
         initializeObjectHeader(memory, prototypeMarkWord, hub);
         if (fillContents) {
-            zeroMemory(size, memory, constantSize, instanceHeaderSize(INJECTED_VMCONFIG), false, false, counters);
+            zeroMemory(memory, instanceHeaderSize(INJECTED_VMCONFIG), size, constantSize, false, 0, counters);
         } else if (REPLACEMENTS_ASSERTIONS_ENABLED) {
-            fillWithGarbage(size, memory, constantSize, instanceHeaderSize(INJECTED_VMCONFIG), false, counters);
+            fillWithGarbage(memory, instanceHeaderSize(INJECTED_VMCONFIG), size, constantSize, false, counters);
         }
         if (emitMemoryBarrier) {
             MembarNode.memoryBarrier(MemoryBarriers.STORE_STORE, LocationIdentity.init());
@@ -733,6 +742,19 @@
         }
     }
 
+    @Snippet
+    private static void threadBeingInitializedCheck(@ConstantParameter Register threadRegister, KlassPointer klass) {
+        int state = readInstanceKlassInitState(klass);
+        if (state != instanceKlassStateBeingInitialized(INJECTED_VMCONFIG)) {
+            // The klass is no longer being initialized so force recompilation
+            DeoptimizeNode.deopt(InvalidateRecompile, RuntimeConstraint);
+        } else if (registerAsWord(threadRegister) != readInstanceKlassInitThread(klass)) {
+            // The klass is being initialized but this isn't the initializing thread so
+            // so deopt and allow execution to resume in the interpreter where it should block.
+            DeoptimizeNode.deopt(None, RuntimeConstraint);
+        }
+    }
+
     /**
      * Formats some allocated memory with an object header and zeroes out the rest.
      */
@@ -745,7 +767,7 @@
                     boolean fillContents,
                     boolean emitMemoryBarrier,
                     boolean maybeUnroll,
-                    boolean useBulkZeroing,
+                    int bulkZeroingStride,
                     Counters counters) {
         memory.writeInt(arrayLengthOffset(INJECTED_VMCONFIG), length, LocationIdentity.init());
         /*
@@ -754,9 +776,9 @@
          */
         initializeObjectHeader(memory, prototypeMarkWord, hub);
         if (fillContents) {
-            zeroMemory(allocationSize, memory, false, headerSize, maybeUnroll, useBulkZeroing, counters);
+            zeroMemory(memory, headerSize, allocationSize, false, maybeUnroll, bulkZeroingStride, counters);
         } else if (REPLACEMENTS_ASSERTIONS_ENABLED) {
-            fillWithGarbage(allocationSize, memory, false, headerSize, maybeUnroll, counters);
+            fillWithGarbage(memory, headerSize, allocationSize, false, maybeUnroll, counters);
         }
         if (emitMemoryBarrier) {
             MembarNode.memoryBarrier(MemoryBarriers.STORE_STORE, LocationIdentity.init());
@@ -795,10 +817,11 @@
         private final SnippetInfo allocateArrayDynamic = snippet(NewObjectSnippets.class, "allocateArrayDynamic", MARK_WORD_LOCATION, HUB_WRITE_LOCATION, TLAB_TOP_LOCATION,
                         TLAB_END_LOCATION);
         private final SnippetInfo allocateInstanceDynamic = snippet(NewObjectSnippets.class, "allocateInstanceDynamic", MARK_WORD_LOCATION, HUB_WRITE_LOCATION, TLAB_TOP_LOCATION,
-                        TLAB_END_LOCATION, PROTOTYPE_MARK_WORD_LOCATION, CLASS_STATE_LOCATION);
+                        TLAB_END_LOCATION, PROTOTYPE_MARK_WORD_LOCATION, CLASS_INIT_STATE_LOCATION);
         private final SnippetInfo newmultiarray = snippet(NewObjectSnippets.class, "newmultiarray", TLAB_TOP_LOCATION, TLAB_END_LOCATION);
         private final SnippetInfo newmultiarrayPIC = snippet(NewObjectSnippets.class, "newmultiarrayPIC", TLAB_TOP_LOCATION, TLAB_END_LOCATION);
         private final SnippetInfo verifyHeap = snippet(NewObjectSnippets.class, "verifyHeap");
+        private final SnippetInfo threadBeingInitializedCheck = snippet(NewObjectSnippets.class, "threadBeingInitializedCheck");
         private final GraalHotSpotVMConfig config;
         private final Counters counters;
 
@@ -874,7 +897,7 @@
             args.addConst("threadRegister", registers.getThreadRegister());
             args.addConst("maybeUnroll", length.isConstant());
             args.addConst("typeContext", ProfileAllocations.getValue(localOptions) ? arrayType.toJavaName(false) : "");
-            args.addConst("useBulkZeroing", tool.getLowerer().supportBulkZeroing());
+            args.addConst("bulkZeroingStride", tool.getLowerer().bulkZeroingStride());
             args.addConst("counters", counters);
             SnippetTemplate template = template(newArrayNode, args);
             graph.getDebug().log("Lowering allocateArray in %s: node=%s, template=%s, arguments=%s", graph, newArrayNode, template, args);
@@ -918,7 +941,7 @@
             } else {
                 args.addConst("knownLayoutHelper", 0);
             }
-            args.addConst("useBulkZeroing", tool.getLowerer().supportBulkZeroing());
+            args.addConst("bulkZeroingStride", tool.getLowerer().bulkZeroingStride());
             args.add("prototypeMarkWord", lookupArrayClass(tool, JavaKind.Object).prototypeMarkWord());
             args.addConst("counters", counters);
             SnippetTemplate template = template(newArrayNode, args);
@@ -965,5 +988,14 @@
                 GraphUtil.removeFixedWithUnusedInputs(verifyHeapNode);
             }
         }
+
+        public void lower(KlassBeingInitializedCheckNode verifyHeapNode, HotSpotRegistersProvider registers, LoweringTool tool) {
+            Arguments args = new Arguments(threadBeingInitializedCheck, verifyHeapNode.graph().getGuardsStage(), tool.getLoweringStage());
+            args.addConst("threadRegister", registers.getThreadRegister());
+            args.add("klass", verifyHeapNode.getKlass());
+
+            SnippetTemplate template = template(verifyHeapNode, args);
+            template.instantiate(providers.getMetaAccess(), verifyHeapNode, DEFAULT_REPLACER, args);
+        }
     }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA2Substitutions.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA2Substitutions.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA5Substitutions.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA5Substitutions.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHASubstitutions.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHASubstitutions.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/StringUTF16Substitutions.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/StringUTF16Substitutions.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ThreadSubstitutions.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ThreadSubstitutions.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeLoadSnippets.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeLoadSnippets.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/CreateExceptionStub.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/CreateExceptionStub.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -26,7 +26,6 @@
 
 import static jdk.vm.ci.hotspot.HotSpotCallingConventionType.NativeCall;
 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Reexecutability.REEXECUTABLE;
-import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.DESTROYS_REGISTERS;
 import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition.SAFEPOINT;
 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.clearPendingException;
 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.registerAsWord;
@@ -106,8 +105,8 @@
     private static native void throwClassCastException(@ConstantNodeParameter ForeignCallDescriptor d, Word thread, Word type, KlassPointer objKlass, KlassPointer targetKlass);
 
     public static void registerForeignCalls(GraalHotSpotVMConfig c, HotSpotForeignCallsProviderImpl foreignCalls) {
-        foreignCalls.registerForeignCall(THROW_AND_POST_JVMTI_EXCEPTION, c.throwAndPostJvmtiExceptionAddress, NativeCall, DESTROYS_REGISTERS, SAFEPOINT, REEXECUTABLE, any());
-        foreignCalls.registerForeignCall(THROW_KLASS_EXTERNAL_NAME_EXCEPTION, c.throwKlassExternalNameExceptionAddress, NativeCall, DESTROYS_REGISTERS, SAFEPOINT, REEXECUTABLE, any());
-        foreignCalls.registerForeignCall(THROW_CLASS_CAST_EXCEPTION, c.throwClassCastExceptionAddress, NativeCall, DESTROYS_REGISTERS, SAFEPOINT, REEXECUTABLE, any());
+        foreignCalls.registerForeignCall(THROW_AND_POST_JVMTI_EXCEPTION, c.throwAndPostJvmtiExceptionAddress, NativeCall, SAFEPOINT, REEXECUTABLE, any());
+        foreignCalls.registerForeignCall(THROW_KLASS_EXTERNAL_NAME_EXCEPTION, c.throwKlassExternalNameExceptionAddress, NativeCall, SAFEPOINT, REEXECUTABLE, any());
+        foreignCalls.registerForeignCall(THROW_CLASS_CAST_EXCEPTION, c.throwClassCastExceptionAddress, NativeCall, SAFEPOINT, REEXECUTABLE, any());
     }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ExceptionHandlerStub.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ExceptionHandlerStub.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -71,16 +71,6 @@
         super("exceptionHandler", options, providers, linkage);
     }
 
-    /**
-     * This stub is called when returning to a method to handle an exception thrown by a callee. It
-     * is not used for routing implicit exceptions. Therefore, it does not need to save any
-     * registers as HotSpot uses a caller save convention.
-     */
-    @Override
-    public boolean preservesRegisters() {
-        return false;
-    }
-
     @Override
     protected Object getConstantParameterValue(int index, String name) {
         if (index == 2) {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ForeignCallStub.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ForeignCallStub.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -28,8 +28,8 @@
 import static jdk.vm.ci.hotspot.HotSpotCallingConventionType.JavaCall;
 import static jdk.vm.ci.hotspot.HotSpotCallingConventionType.JavaCallee;
 import static jdk.vm.ci.hotspot.HotSpotCallingConventionType.NativeCall;
-import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.DESTROYS_REGISTERS;
-import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.PRESERVES_REGISTERS;
+import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.COMPUTES_REGISTERS_KILLED;
+import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.DESTROYS_ALL_CALLER_SAVE_REGISTERS;
 import static org.graalvm.compiler.nodes.CallTargetNode.InvokeKind.Static;
 import static org.graalvm.compiler.nodes.ConstantNode.forBoolean;
 
@@ -112,14 +112,14 @@
     public ForeignCallStub(OptionValues options, HotSpotJVMCIRuntime runtime, HotSpotProviders providers, long address, ForeignCallDescriptor descriptor, boolean prependThread,
                     Transition transition, Reexecutability reexecutability, LocationIdentity... killedLocations) {
         super(options, providers, HotSpotForeignCallLinkageImpl.create(providers.getMetaAccess(), providers.getCodeCache(), providers.getWordTypes(), providers.getForeignCalls(), descriptor, 0L,
-                        PRESERVES_REGISTERS, JavaCall, JavaCallee, transition, reexecutability, killedLocations));
+                        COMPUTES_REGISTERS_KILLED, JavaCall, JavaCallee, transition, reexecutability, killedLocations));
         this.jvmciRuntime = runtime;
         this.prependThread = prependThread;
         MetaAccessProvider metaAccess = providers.getMetaAccess();
         Class<?>[] targetParameterTypes = createTargetParameters(descriptor);
         ForeignCallDescriptor targetSig = new ForeignCallDescriptor(descriptor.getName() + ":C", descriptor.getResultType(), targetParameterTypes);
         target = HotSpotForeignCallLinkageImpl.create(metaAccess, providers.getCodeCache(), providers.getWordTypes(), providers.getForeignCalls(), targetSig, address,
-                        DESTROYS_REGISTERS, NativeCall, NativeCall, transition, reexecutability, killedLocations);
+                        DESTROYS_ALL_CALLER_SAVE_REGISTERS, NativeCall, NativeCall, transition, reexecutability, killedLocations);
     }
 
     /**
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/OutOfBoundsExceptionStub.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/OutOfBoundsExceptionStub.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/SnippetStub.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/SnippetStub.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -121,12 +121,8 @@
         return destroyedCallerRegisters;
     }
 
-    /**
-     * Determines if this stub preserves all registers apart from those it
-     * {@linkplain #getDestroyedCallerRegisters() destroys}.
-     */
-    public boolean preservesRegisters() {
-        return true;
+    public boolean shouldSaveRegistersAroundCalls() {
+        return linkage.getEffect() == HotSpotForeignCallLinkage.RegisterEffect.COMPUTES_REGISTERS_KILLED;
     }
 
     protected final OptionValues options;
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubUtil.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubUtil.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/UnwindExceptionToCallerStub.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/UnwindExceptionToCallerStub.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -64,15 +64,6 @@
         super("unwindExceptionToCaller", options, providers, linkage);
     }
 
-    /**
-     * The current frame is unwound by this stub. Therefore, it does not need to save any registers
-     * as HotSpot uses a caller save convention.
-     */
-    @Override
-    public boolean preservesRegisters() {
-        return false;
-    }
-
     @Override
     protected Object getConstantParameterValue(int index, String name) {
         if (index == 2) {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BciBlockMapping.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BciBlockMapping.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParser.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParser.java	Wed Sep 25 22:40:41 2019 +0200
@@ -271,6 +271,7 @@
 import jdk.internal.vm.compiler.collections.Equivalence;
 import jdk.internal.vm.compiler.collections.UnmodifiableEconomicMap;
 import org.graalvm.compiler.api.replacements.Fold;
+import org.graalvm.compiler.api.replacements.MethodSubstitution;
 import org.graalvm.compiler.api.replacements.Snippet;
 import org.graalvm.compiler.bytecode.Bytecode;
 import org.graalvm.compiler.bytecode.BytecodeDisassembler;
@@ -363,12 +364,13 @@
 import org.graalvm.compiler.nodes.calc.IntegerBelowNode;
 import org.graalvm.compiler.nodes.calc.IntegerEqualsNode;
 import org.graalvm.compiler.nodes.calc.IntegerLessThanNode;
+import org.graalvm.compiler.nodes.calc.IntegerNormalizeCompareNode;
 import org.graalvm.compiler.nodes.calc.IsNullNode;
 import org.graalvm.compiler.nodes.calc.LeftShiftNode;
 import org.graalvm.compiler.nodes.calc.MulNode;
 import org.graalvm.compiler.nodes.calc.NarrowNode;
 import org.graalvm.compiler.nodes.calc.NegateNode;
-import org.graalvm.compiler.nodes.calc.NormalizeCompareNode;
+import org.graalvm.compiler.nodes.calc.FloatNormalizeCompareNode;
 import org.graalvm.compiler.nodes.calc.ObjectEqualsNode;
 import org.graalvm.compiler.nodes.calc.OrNode;
 import org.graalvm.compiler.nodes.calc.RemNode;
@@ -810,8 +812,9 @@
         this.parent = parent;
 
         ClassInitializationPlugin classInitializationPlugin = graphBuilderConfig.getPlugins().getClassInitializationPlugin();
-        if (classInitializationPlugin != null && graphBuilderConfig.eagerResolving()) {
-            uninitializedIsError = eagerInitializing = !classInitializationPlugin.supportsLazyInitialization(constantPool);
+        if (classInitializationPlugin != null && graphBuilderConfig.eagerResolving() && classInitializationPlugin.supportsLazyInitialization(constantPool)) {
+            eagerInitializing = false;
+            uninitializedIsError = false;
         } else {
             eagerInitializing = graphBuilderConfig.eagerResolving();
             uninitializedIsError = graphBuilderConfig.unresolvedIsError();
@@ -1331,7 +1334,11 @@
     }
 
     protected ValueNode genNormalizeCompare(ValueNode x, ValueNode y, boolean isUnorderedLess) {
-        return NormalizeCompareNode.create(x, y, isUnorderedLess, JavaKind.Int, getConstantReflection());
+        return FloatNormalizeCompareNode.create(x, y, isUnorderedLess, JavaKind.Int, getConstantReflection());
+    }
+
+    protected ValueNode genIntegerNormalizeCompare(ValueNode x, ValueNode y) {
+        return IntegerNormalizeCompareNode.create(x, y, false, JavaKind.Int, getConstantReflection());
     }
 
     protected ValueNode genFloatConvert(FloatConvert op, ValueNode input) {
@@ -2482,7 +2489,8 @@
                         : (calleeIntrinsicContext != null ? new IntrinsicScope(this, targetMethod, args)
                                         : new InliningScope(this, targetMethod, args))) {
             BytecodeParser parser = graphBuilderInstance.createBytecodeParser(graph, this, targetMethod, INVOCATION_ENTRY_BCI, calleeIntrinsicContext);
-            FrameStateBuilder startFrameState = new FrameStateBuilder(parser, parser.code, graph, graphBuilderConfig.retainLocalVariables());
+            boolean targetIsSubstitution = targetMethod.isAnnotationPresent(MethodSubstitution.class);
+            FrameStateBuilder startFrameState = new FrameStateBuilder(parser, parser.code, graph, graphBuilderConfig.retainLocalVariables() && !targetIsSubstitution);
             if (!targetMethod.isStatic()) {
                 args[0] = nullCheckedValue(args[0]);
             }
@@ -2945,7 +2953,17 @@
                  * placeholder that later can be replaced with a MergeNode when we see this block
                  * again.
                  */
-                if (canReuseInstruction && (block.getPredecessorCount() == 1 || !controlFlowSplit) && !block.isLoopHeader() && (currentBlock.loops & ~block.loops) == 0) {
+                if (canReuseInstruction && (block.getPredecessorCount() == 1 || !controlFlowSplit) && !block.isLoopHeader() && (currentBlock.loops & ~block.loops) == 0 &&
+                                currentBlock.getJsrScope() == block.getJsrScope()) {
+                    /*
+                     * If we know that no BeginNode is necessary, then we can avoid allocating and
+                     * later removing that node. This is strictly a performance optimization:
+                     * unnecessary BeginNode are allowed and will be removed later on. We need to be
+                     * careful though because the predecessor information is not always enough: when
+                     * the loop level changes, we always need a BeginNode. Also, JSR scope changes
+                     * required a BeginNode because the predecessors coming from RET bytecodes are
+                     * not reflected in the predecessor count.
+                     */
                     setFirstInstruction(block, lastInstr);
                     lastInstr = null;
                 } else {
@@ -4005,12 +4023,18 @@
         frameState.push(kind, append(v));
     }
 
-    private void genCompareOp(JavaKind kind, boolean isUnorderedLess) {
+    private void genFloatCompareOp(JavaKind kind, boolean isUnorderedLess) {
         ValueNode y = frameState.pop(kind);
         ValueNode x = frameState.pop(kind);
         frameState.push(JavaKind.Int, append(genNormalizeCompare(x, y, isUnorderedLess)));
     }
 
+    private void genIntegerCompareOp(JavaKind kind) {
+        ValueNode y = frameState.pop(kind);
+        ValueNode x = frameState.pop(kind);
+        frameState.push(JavaKind.Int, append(genIntegerNormalizeCompare(x, y)));
+    }
+
     private void genFloatConvert(FloatConvert op, JavaKind from, JavaKind to) {
         ValueNode input = frameState.pop(from);
         frameState.push(to, append(genFloatConvert(op, input)));
@@ -5085,11 +5109,11 @@
             case I2B            : genSignExtend(JavaKind.Byte, JavaKind.Int); break;
             case I2S            : genSignExtend(JavaKind.Short, JavaKind.Int); break;
             case I2C            : genZeroExtend(JavaKind.Char, JavaKind.Int); break;
-            case LCMP           : genCompareOp(JavaKind.Long, false); break;
-            case FCMPL          : genCompareOp(JavaKind.Float, true); break;
-            case FCMPG          : genCompareOp(JavaKind.Float, false); break;
-            case DCMPL          : genCompareOp(JavaKind.Double, true); break;
-            case DCMPG          : genCompareOp(JavaKind.Double, false); break;
+            case LCMP           : genIntegerCompareOp(JavaKind.Long); break;
+            case FCMPL          : genFloatCompareOp(JavaKind.Float, true); break;
+            case FCMPG          : genFloatCompareOp(JavaKind.Float, false); break;
+            case DCMPL          : genFloatCompareOp(JavaKind.Double, true); break;
+            case DCMPG          : genFloatCompareOp(JavaKind.Double, false); break;
             case IFEQ           : genIfZero(Condition.EQ); break;
             case IFNE           : genIfZero(Condition.NE); break;
             case IFLT           : genIfZero(Condition.LT); break;
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/FrameStateBuilder.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/FrameStateBuilder.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/GraphBuilderPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/GraphBuilderPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrScope.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrScope.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -24,46 +24,110 @@
 
 package org.graalvm.compiler.java;
 
-public class JsrScope {
+import org.graalvm.compiler.bytecode.Bytecodes;
 
+/**
+ * Represents a subroutine entered via {@link Bytecodes#JSR} and exited via {@link Bytecodes#RET}.
+ */
+public final class JsrScope {
+
+    /**
+     * The scope outside of any JSR/RET subroutine.
+     */
     public static final JsrScope EMPTY_SCOPE = new JsrScope();
 
-    private final long scope;
+    private final char returnAddress;
+
+    private final JsrScope parent;
 
-    private JsrScope(long scope) {
-        this.scope = scope;
+    private JsrScope(int returnBci, JsrScope parent) {
+        this.returnAddress = (char) returnBci;
+        this.parent = parent;
     }
 
-    public JsrScope() {
-        this.scope = 0;
+    private JsrScope() {
+        this.returnAddress = 0;
+        this.parent = null;
     }
 
     public int nextReturnAddress() {
-        return (int) (scope & 0xffff);
+        return returnAddress;
     }
 
-    public JsrScope push(int jsrReturnBci) {
-        if ((scope & 0xffff000000000000L) != 0) {
-            throw new JsrNotSupportedBailout("only four jsr nesting levels are supported");
+    /**
+     * Enters a new subroutine from the current scope represented by this object.
+     *
+     * @param returnBci the bytecode address returned to when leaving the new scope
+     * @return an object representing the newly entered scope
+     */
+    public JsrScope push(int returnBci) {
+        if (returnBci == 0) {
+            throw new IllegalArgumentException("A bytecode subroutine cannot have a return address of 0");
         }
-        return new JsrScope((scope << 16) | jsrReturnBci);
+        if (returnBci < 1 || returnBci > 0xFFFF) {
+            throw new IllegalArgumentException("Bytecode subroutine return address cannot be encoded as a char: " + returnBci);
+        }
+        return new JsrScope(returnBci, this);
+    }
+
+    /**
+     * Determines if this is the scope outside of any JSR/RET subroutine.
+     */
+    public boolean isEmpty() {
+        return returnAddress == 0;
     }
 
-    public boolean isEmpty() {
-        return scope == 0;
+    /**
+     * Gets the ancestry of this scope starting with the {@link #returnAddress} of this scope's most
+     * distant ancestor and ending with the {@link #returnAddress} of this object.
+     *
+     * @return a String where each character is a 16-bit BCI. This value can be converted to an
+     *         {@code int[]} with {@code value.chars().toArray()}.
+     */
+    public String getAncestry() {
+        StringBuilder sb = new StringBuilder();
+        for (JsrScope s = this; s != null; s = s.parent) {
+            if (!s.isEmpty()) {
+                sb.append(s.returnAddress);
+            }
+        }
+        return sb.reverse().toString();
     }
 
+    /**
+     * Determines if the {@linkplain #getAncestry() ancestry} of this scope is a prefix of the
+     * ancestry of {@code other}.
+     */
     public boolean isPrefixOf(JsrScope other) {
-        return (scope & other.scope) == scope;
+        if (isEmpty()) {
+            return true;
+        }
+        String ancestry = getAncestry();
+        String otherAncestry = other.getAncestry();
+        return otherAncestry.startsWith(ancestry);
     }
 
+    /**
+     * Gets this scope's parent.
+     *
+     * @return this scope's parent or {@link #EMPTY_SCOPE} if this is the {@link #EMPTY_SCOPE}
+     */
     public JsrScope pop() {
-        return new JsrScope(scope >>> 16);
+        if (isEmpty()) {
+            return this;
+        }
+        return parent;
     }
 
     @Override
     public int hashCode() {
-        return (int) (scope ^ (scope >>> 32));
+        int hc = returnAddress;
+        JsrScope ancestor = parent;
+        while (ancestor != null) {
+            hc = hc ^ ancestor.returnAddress;
+            ancestor = ancestor.parent;
+        }
+        return hc;
     }
 
     @Override
@@ -71,19 +135,38 @@
         if (this == obj) {
             return true;
         }
-        return obj != null && getClass() == obj.getClass() && scope == ((JsrScope) obj).scope;
+        if (obj != null && getClass() == obj.getClass()) {
+            JsrScope ancestor = this;
+            JsrScope otherAncestor = (JsrScope) obj;
+            while (ancestor != null) {
+                if (otherAncestor == null) {
+                    return false;
+                }
+                if (otherAncestor.returnAddress != ancestor.returnAddress) {
+                    return false;
+                }
+                ancestor = ancestor.parent;
+                otherAncestor = otherAncestor.parent;
+            }
+            if (otherAncestor == null) {
+                return true;
+            }
+        }
+        return false;
     }
 
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
-        long tmp = scope;
-        sb.append(" [");
-        while (tmp != 0) {
-            sb.append(", ").append(tmp & 0xffff);
-            tmp = tmp >>> 16;
+
+        for (JsrScope ancestor = this; ancestor != null; ancestor = ancestor.parent) {
+            if (!ancestor.isEmpty()) {
+                if (sb.length() != 0) {
+                    sb.append(", ");
+                }
+                sb.append((int) ancestor.returnAddress);
+            }
         }
-        sb.append(']');
-        return sb.toString();
+        return "[" + sb + "]";
     }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis02.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis02.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime02.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime02.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log10.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log10.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/UnaryMath.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/UnaryMath.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/IfNodeCanonicalizationsTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/IfNodeCanonicalizationsTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NestedLoop_EA.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NestedLoop_EA.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/SynchronizedLoopExit01.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/SynchronizedLoopExit01.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticLIRGeneratorTool.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticLIRGeneratorTool.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Call.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Call.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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.
  * Copyright (c) 2018, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Compare.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Compare.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ControlFlow.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ControlFlow.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -45,6 +45,7 @@
 import org.graalvm.compiler.core.common.calc.Condition;
 import org.graalvm.compiler.debug.GraalError;
 import org.graalvm.compiler.lir.ConstantValue;
+import org.graalvm.compiler.lir.LIRInstruction;
 import org.graalvm.compiler.lir.LIRInstructionClass;
 import org.graalvm.compiler.lir.LabelRef;
 import org.graalvm.compiler.lir.Opcode;
@@ -148,10 +149,25 @@
             assert kind.isInteger();
             int size = kind.getSizeInBytes() * Byte.SIZE;
 
-            if (negate) {
-                masm.cbnz(size, asRegister(this.value), target.label());
+            Label label = target.label();
+            boolean isFarBranch = isFarBranch(this, 21, crb, masm, label);
+            boolean useCbnz;
+            if (isFarBranch) {
+                useCbnz = !negate;
+                label = new Label();
             } else {
-                masm.cbz(size, asRegister(this.value), target.label());
+                useCbnz = negate;
+            }
+
+            if (useCbnz) {
+                masm.cbnz(size, asRegister(this.value), label);
+            } else {
+                masm.cbz(size, asRegister(this.value), label);
+            }
+
+            if (isFarBranch) {
+                masm.jmp(target.label());
+                masm.bind(label);
             }
         }
     }
@@ -172,20 +188,7 @@
         protected void emitBranch(CompilationResultBuilder crb, AArch64MacroAssembler masm, LabelRef target, boolean negate) {
             ConditionFlag cond = negate ? ConditionFlag.NE : ConditionFlag.EQ;
             Label label = target.label();
-            boolean isFarBranch;
-
-            if (label.isBound()) {
-                // The label.position() is a byte based index. The TBZ instruction has 14 bits for
-                // the offset and AArch64 instruction is 4 bytes aligned. So TBZ can encode 16 bits
-                // signed offset.
-                isFarBranch = !NumUtil.isSignedNbit(16, masm.position() - label.position());
-            } else {
-                // Max range of tbz is +-2^13 instructions. We estimate that each LIR instruction
-                // emits 2 AArch64 instructions on average. Thus we test for maximum 2^12 LIR
-                // instruction offset.
-                int maxLIRDistance = (1 << 12);
-                isFarBranch = !crb.labelWithinRange(this, label, maxLIRDistance);
-            }
+            boolean isFarBranch = isFarBranch(this, 14, crb, masm, label);
 
             if (isFarBranch) {
                 cond = cond.negate();
@@ -392,4 +395,20 @@
         }
     }
 
+    private static boolean isFarBranch(LIRInstruction instruction, int offsetBits, CompilationResultBuilder crb, AArch64MacroAssembler masm, Label label) {
+        boolean isFarBranch;
+        if (label.isBound()) {
+            // The label.position() is a byte based index. The instruction instruction has
+            // offsetBits bits for the offset and AArch64 instruction is 4 bytes aligned. So
+            // instruction can encode offsetBits+2 bits signed offset.
+            isFarBranch = !NumUtil.isSignedNbit(offsetBits + 2, masm.position() - label.position());
+        } else {
+            // Max range of instruction is 2^offsetBits instructions. We estimate that each LIR
+            // instruction emits 2 AArch64 instructions on average. Thus we test for maximum
+            // 2^(offsetBits-2) LIR instruction offset.
+            int maxLIRDistance = (1 << (offsetBits - 2));
+            isFarBranch = !crb.labelWithinRange(instruction, label, maxLIRDistance);
+        }
+        return isFarBranch;
+    }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Move.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Move.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -549,7 +549,7 @@
         try (ScratchRegister addrReg = masm.getScratchRegister()) {
             StackSlot slot = (StackSlot) result;
             AArch64Address resultAddress = loadStackSlotAddress(crb, masm, slot, addrReg.getRegister());
-            if (constant.isDefaultForKind() || constant.isNull()) {
+            if (constant.isNull() && !crb.mustReplaceWithUncompressedNullRegister(constant)) {
                 emitStore(crb, masm, (AArch64Kind) result.getPlatformKind(), resultAddress, zr.asValue(LIRKind.combine(result)));
             } else {
                 try (ScratchRegister sc = masm.getScratchRegister()) {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64RestoreRegistersOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64RestoreRegistersOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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.
  * Copyright (c) 2018, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -25,9 +25,9 @@
 
 package org.graalvm.compiler.lir.aarch64;
 
-import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.STACK;
 import static jdk.vm.ci.code.ValueUtil.asStackSlot;
 import static jdk.vm.ci.code.ValueUtil.isStackSlot;
+import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.STACK;
 
 import java.util.Arrays;
 
@@ -35,6 +35,7 @@
 import org.graalvm.compiler.lir.LIRInstructionClass;
 import org.graalvm.compiler.lir.LIRValueUtil;
 import org.graalvm.compiler.lir.Opcode;
+import org.graalvm.compiler.lir.StandardOp;
 import org.graalvm.compiler.lir.asm.CompilationResultBuilder;
 
 import jdk.vm.ci.code.Register;
@@ -45,7 +46,7 @@
  * Restores registers from stack slots.
  */
 @Opcode("RESTORE_REGISTER")
-public class AArch64RestoreRegistersOp extends AArch64LIRInstruction {
+public class AArch64RestoreRegistersOp extends AArch64LIRInstruction implements StandardOp.RestoreRegistersOp {
     public static final LIRInstructionClass<AArch64RestoreRegistersOp> TYPE = LIRInstructionClass.create(AArch64RestoreRegistersOp.class);
 
     /**
@@ -70,7 +71,7 @@
     }
 
     protected Register[] getSavedRegisters() {
-        return save.savedRegisters;
+        return save.getSavedRegisters();
     }
 
     protected void restoreRegister(CompilationResultBuilder crb, AArch64MacroAssembler masm, Register result, StackSlot input) {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64SaveRegistersOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64SaveRegistersOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -26,21 +26,15 @@
 
 import static jdk.vm.ci.code.ValueUtil.asStackSlot;
 import static jdk.vm.ci.code.ValueUtil.isStackSlot;
-import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.STACK;
-
-import java.util.Arrays;
 
 import jdk.internal.vm.compiler.collections.EconomicSet;
 import org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler;
 import org.graalvm.compiler.lir.LIRInstructionClass;
-import org.graalvm.compiler.lir.LIRValueUtil;
 import org.graalvm.compiler.lir.Opcode;
 import org.graalvm.compiler.lir.StandardOp.SaveRegistersOp;
 import org.graalvm.compiler.lir.asm.CompilationResultBuilder;
-import org.graalvm.compiler.lir.framemap.FrameMap;
 
 import jdk.vm.ci.code.Register;
-import jdk.vm.ci.code.RegisterSaveLayout;
 import jdk.vm.ci.code.StackSlot;
 import jdk.vm.ci.meta.AllocatableValue;
 
@@ -48,41 +42,17 @@
  * Saves registers to stack slots.
  */
 @Opcode("SAVE_REGISTER")
-public class AArch64SaveRegistersOp extends AArch64LIRInstruction implements SaveRegistersOp {
+public class AArch64SaveRegistersOp extends SaveRegistersOp {
     public static final LIRInstructionClass<AArch64SaveRegistersOp> TYPE = LIRInstructionClass.create(AArch64SaveRegistersOp.class);
 
     /**
-     * The registers (potentially) saved by this operation.
-     */
-    protected final Register[] savedRegisters;
-
-    /**
-     * The slots to which the registers are saved.
-     */
-    @Def(STACK) protected final AllocatableValue[] slots;
-
-    /**
-     * Specifies if {@link #remove(EconomicSet)} should have an effect.
-     */
-    protected final boolean supportsRemove;
-
-    /**
      *
      * @param savedRegisters the registers saved by this operation which may be subject to
      *            {@linkplain #remove(EconomicSet) pruning}
      * @param savedRegisterLocations the slots to which the registers are saved
-     * @param supportsRemove determines if registers can be {@linkplain #remove(EconomicSet) pruned}
      */
-    public AArch64SaveRegistersOp(Register[] savedRegisters, AllocatableValue[] savedRegisterLocations, boolean supportsRemove) {
-        this(TYPE, savedRegisters, savedRegisterLocations, supportsRemove);
-    }
-
-    public AArch64SaveRegistersOp(LIRInstructionClass<? extends AArch64SaveRegistersOp> c, Register[] savedRegisters, AllocatableValue[] savedRegisterLocations, boolean supportsRemove) {
-        super(c);
-        assert Arrays.asList(savedRegisterLocations).stream().allMatch(LIRValueUtil::isVirtualStackSlot);
-        this.savedRegisters = savedRegisters;
-        this.slots = savedRegisterLocations;
-        this.supportsRemove = supportsRemove;
+    public AArch64SaveRegistersOp(Register[] savedRegisters, AllocatableValue[] savedRegisterLocations) {
+        super(TYPE, savedRegisters, savedRegisterLocations);
     }
 
     protected void saveRegister(CompilationResultBuilder crb, AArch64MacroAssembler masm, StackSlot result, Register input) {
@@ -90,7 +60,8 @@
     }
 
     @Override
-    public void emitCode(CompilationResultBuilder crb, AArch64MacroAssembler masm) {
+    public void emitCode(CompilationResultBuilder crb) {
+        AArch64MacroAssembler masm = (AArch64MacroAssembler) crb.asm;
         for (int i = 0; i < savedRegisters.length; i++) {
             if (savedRegisters[i] != null) {
                 assert isStackSlot(slots[i]) : "not a StackSlot: " + slots[i];
@@ -98,73 +69,4 @@
             }
         }
     }
-
-    public AllocatableValue[] getSlots() {
-        return slots;
-    }
-
-    @Override
-    public boolean supportsRemove() {
-        return supportsRemove;
-    }
-
-    @Override
-    public int remove(EconomicSet<Register> doNotSave) {
-        if (!supportsRemove) {
-            throw new UnsupportedOperationException();
-        }
-        return prune(doNotSave, savedRegisters);
-    }
-
-    static int prune(EconomicSet<Register> toRemove, Register[] registers) {
-        int pruned = 0;
-        for (int i = 0; i < registers.length; i++) {
-            if (registers[i] != null) {
-                if (toRemove.contains(registers[i])) {
-                    registers[i] = null;
-                    pruned++;
-                }
-            }
-        }
-        return pruned;
-    }
-
-    @Override
-    public RegisterSaveLayout getMap(FrameMap frameMap) {
-        int total = 0;
-        for (int i = 0; i < savedRegisters.length; i++) {
-            if (savedRegisters[i] != null) {
-                total++;
-            }
-        }
-        Register[] keys = new Register[total];
-        int[] values = new int[total];
-        if (total != 0) {
-            int mapIndex = 0;
-            for (int i = 0; i < savedRegisters.length; i++) {
-                if (savedRegisters[i] != null) {
-                    keys[mapIndex] = savedRegisters[i];
-                    assert isStackSlot(slots[i]) : "not a StackSlot: " + slots[i];
-                    StackSlot slot = asStackSlot(slots[i]);
-                    values[mapIndex] = indexForStackSlot(frameMap, slot);
-                    mapIndex++;
-                }
-            }
-            assert mapIndex == total;
-        }
-        return new RegisterSaveLayout(keys, values);
-    }
-
-    /**
-     * Computes the index of a stack slot relative to slot 0. This is also the bit index of stack
-     * slots in the reference map.
-     *
-     * @param slot a stack slot
-     * @return the index of the stack slot
-     */
-    private static int indexForStackSlot(FrameMap frameMap, StackSlot slot) {
-        assert frameMap.offsetForStackSlot(slot) % frameMap.getTarget().wordSize == 0;
-        int value = frameMap.offsetForStackSlot(slot) / frameMap.getTarget().wordSize;
-        return value;
-    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ZeroMemoryOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, Arm Limited and affiliates. All rights reserved.
+ * 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 org.graalvm.compiler.lir.aarch64;
+
+import static jdk.vm.ci.aarch64.AArch64.zr;
+import static jdk.vm.ci.code.ValueUtil.asRegister;
+import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG;
+
+import org.graalvm.compiler.asm.Label;
+import org.graalvm.compiler.asm.aarch64.AArch64Address;
+import org.graalvm.compiler.asm.aarch64.AArch64Assembler;
+import org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler;
+import org.graalvm.compiler.lir.LIRInstructionClass;
+import org.graalvm.compiler.lir.Opcode;
+import org.graalvm.compiler.lir.asm.CompilationResultBuilder;
+
+import jdk.vm.ci.code.CodeUtil;
+import jdk.vm.ci.code.Register;
+import jdk.vm.ci.meta.AllocatableValue;
+
+/**
+ * Zero a chunk of memory on AArch64.
+ */
+@Opcode("ZERO_MEMORY")
+public final class AArch64ZeroMemoryOp extends AArch64LIRInstruction {
+    public static final LIRInstructionClass<AArch64ZeroMemoryOp> TYPE = LIRInstructionClass.create(AArch64ZeroMemoryOp.class);
+
+    @Use({REG}) protected AllocatableValue addressValue;
+    @Use({REG}) protected AllocatableValue lengthValue;
+
+    private final boolean useDcZva;
+    private final int zvaLength;
+
+    /**
+     * Constructor of AArch64ZeroMemoryOp.
+     *
+     * @param address allocatable 8-byte aligned base address of the memory chunk.
+     * @param length allocatable length of the memory chunk, the value must be multiple of 8.
+     * @param useDcZva is DC ZVA instruction is able to use.
+     * @param zvaLength the ZVA length info of current AArch64 CPU, negative value indicates length
+     *            is unknown at compile time.
+     */
+    public AArch64ZeroMemoryOp(AllocatableValue address, AllocatableValue length, boolean useDcZva, int zvaLength) {
+        super(TYPE);
+        this.addressValue = address;
+        this.lengthValue = length;
+        this.useDcZva = useDcZva;
+        this.zvaLength = zvaLength;
+    }
+
+    @Override
+    protected void emitCode(CompilationResultBuilder crb, AArch64MacroAssembler masm) {
+        Register base = asRegister(addressValue);
+        Register size = asRegister(lengthValue);
+        if (useDcZva && zvaLength > 0) {
+            // From ARMv8-A architecture reference manual D12.2.35 Data Cache Zero ID register:
+            // A valid ZVA length should be a power-of-2 value in [4, 2048]
+            assert (CodeUtil.isPowerOf2(zvaLength) && 4 <= zvaLength && zvaLength <= 2048);
+            emitZeroMemoryWithDc(masm, base, size, zvaLength);
+        } else {
+            // Use store pair instructions (STP) to zero memory as a fallback.
+            emitZeroMemoryWithStp(masm, base, size);
+        }
+    }
+
+    /**
+     * Zero a chunk of memory with DC ZVA instructions.
+     *
+     * @param masm the AArch64 macro assembler.
+     * @param base base an 8-byte aligned address of the memory chunk to be zeroed.
+     * @param size size of the memory chunk to be zeroed, in bytes, must be multiple of 8.
+     * @param zvaLength the ZVA length info of current AArch64 CPU.
+     */
+    private static void emitZeroMemoryWithDc(AArch64MacroAssembler masm, Register base, Register size, int zvaLength) {
+        Label preLoop = new Label();
+        Label zvaLoop = new Label();
+        Label postLoop = new Label();
+        Label tail = new Label();
+        Label done = new Label();
+
+        try (AArch64MacroAssembler.ScratchRegister sc1 = masm.getScratchRegister()) {
+            Register rscratch1 = sc1.getRegister();
+
+            // Count number of bytes to be pre-zeroed to align base address with ZVA length.
+            masm.neg(64, rscratch1, base);
+            masm.and(64, rscratch1, rscratch1, zvaLength - 1);
+
+            // Is size less than number of bytes to be pre-zeroed? Jump to POST_LOOP if so.
+            masm.cmp(64, size, rscratch1);
+            masm.branchConditionally(AArch64Assembler.ConditionFlag.LE, postLoop);
+            masm.sub(64, size, size, rscratch1);
+
+            // Pre-ZVA loop.
+            masm.bind(preLoop);
+            masm.subs(64, rscratch1, rscratch1, 8);
+            masm.branchConditionally(AArch64Assembler.ConditionFlag.LT, zvaLoop);
+            masm.str(64, zr, AArch64Address.createPostIndexedImmediateAddress(base, 8));
+            masm.jmp(preLoop);
+
+            // ZVA loop.
+            masm.bind(zvaLoop);
+            masm.subs(64, size, size, zvaLength);
+            masm.branchConditionally(AArch64Assembler.ConditionFlag.LT, tail);
+            masm.dc(AArch64Assembler.DataCacheOperationType.ZVA, base);
+            masm.add(64, base, base, zvaLength);
+            masm.jmp(zvaLoop);
+
+            // Handle bytes after ZVA loop.
+            masm.bind(tail);
+            masm.add(64, size, size, zvaLength);
+
+            // Post-ZVA loop.
+            masm.bind(postLoop);
+            masm.subs(64, size, size, 8);
+            masm.branchConditionally(AArch64Assembler.ConditionFlag.LT, done);
+            masm.str(64, zr, AArch64Address.createPostIndexedImmediateAddress(base, 8));
+            masm.jmp(postLoop);
+
+            // Done.
+            masm.bind(done);
+        }
+    }
+
+    /**
+     * Zero a chunk of memory with STP instructions.
+     *
+     * @param masm the AArch64 macro assembler.
+     * @param base base an 8-byte aligned address of the memory chunk to be zeroed.
+     * @param size size of the memory chunk to be zeroed, in bytes, must be multiple of 8.
+     */
+    private static void emitZeroMemoryWithStp(AArch64MacroAssembler masm, Register base, Register size) {
+        Label loop = new Label();
+        Label tail = new Label();
+        Label done = new Label();
+
+        // Jump to DONE if size is zero.
+        masm.cbz(64, size, done);
+
+        // Is base address already 16-byte aligned? Jump to LDP loop if so.
+        masm.tbz(base, 3, loop);
+        masm.sub(64, size, size, 8);
+        masm.str(64, zr, AArch64Address.createPostIndexedImmediateAddress(base, 8));
+
+        // The STP loop that zeros 16 bytes in each iteration.
+        masm.bind(loop);
+        masm.subs(64, size, size, 16);
+        masm.branchConditionally(AArch64Assembler.ConditionFlag.LT, tail);
+        masm.stp(64, zr, zr, AArch64Address.createPostIndexedImmediateAddress(base, 2));
+        masm.jmp(loop);
+
+        // We may need to zero the tail 8 bytes of the memory chunk.
+        masm.bind(tail);
+        masm.adds(64, size, size, 16);
+        masm.branchConditionally(AArch64Assembler.ConditionFlag.EQ, done);
+        masm.str(64, zr, AArch64Address.createPostIndexedImmediateAddress(base, 8));
+
+        // Done.
+        masm.bind(done);
+    }
+}
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayCompareToOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayCompareToOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -155,7 +155,7 @@
         AMD64Address.Scale scale2 = null;
 
         // if (ae != StrIntrinsicNode::LL) {
-        if (kind1 == JavaKind.Byte && kind2 == JavaKind.Byte) {
+        if (!(kind1 == JavaKind.Byte && kind2 == JavaKind.Byte)) {
             stride2x2 = 0x20;
         }
 
@@ -531,7 +531,7 @@
             masm.notq(cnt1);
             masm.bsfq(cnt2, cnt1);
             // if (ae != StrIntrinsicNode::LL) {
-            if (kind1 != JavaKind.Byte && kind2 != JavaKind.Byte) {
+            if (!(kind1 == JavaKind.Byte && kind2 == JavaKind.Byte)) {
                 // Divide diff by 2 to get number of chars
                 masm.sarl(cnt2, 1);
             }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayEqualsOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayEqualsOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -24,13 +24,14 @@
 
 package org.graalvm.compiler.lir.amd64;
 
-import jdk.vm.ci.amd64.AMD64;
-import jdk.vm.ci.amd64.AMD64.CPUFeature;
-import jdk.vm.ci.amd64.AMD64Kind;
-import jdk.vm.ci.code.Register;
-import jdk.vm.ci.code.TargetDescription;
-import jdk.vm.ci.meta.JavaKind;
-import jdk.vm.ci.meta.Value;
+import static jdk.vm.ci.code.ValueUtil.asRegister;
+import static org.graalvm.compiler.asm.amd64.AMD64Assembler.AMD64BinaryArithmetic.XOR;
+import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.CONST;
+import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.ILLEGAL;
+import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG;
+
+import java.util.Objects;
+
 import org.graalvm.compiler.asm.Label;
 import org.graalvm.compiler.asm.amd64.AMD64Address;
 import org.graalvm.compiler.asm.amd64.AMD64Address.Scale;
@@ -43,16 +44,18 @@
 import org.graalvm.compiler.core.common.LIRKind;
 import org.graalvm.compiler.debug.GraalError;
 import org.graalvm.compiler.lir.LIRInstructionClass;
+import org.graalvm.compiler.lir.LIRValueUtil;
 import org.graalvm.compiler.lir.Opcode;
 import org.graalvm.compiler.lir.asm.CompilationResultBuilder;
 import org.graalvm.compiler.lir.gen.LIRGeneratorTool;
 
-import static jdk.vm.ci.code.ValueUtil.asRegister;
-import static org.graalvm.compiler.asm.amd64.AMD64Assembler.AMD64BinaryArithmetic.XOR;
-import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.ILLEGAL;
-import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG;
-
-import java.util.Objects;
+import jdk.vm.ci.amd64.AMD64;
+import jdk.vm.ci.amd64.AMD64.CPUFeature;
+import jdk.vm.ci.amd64.AMD64Kind;
+import jdk.vm.ci.code.Register;
+import jdk.vm.ci.code.TargetDescription;
+import jdk.vm.ci.meta.JavaKind;
+import jdk.vm.ci.meta.Value;
 
 /**
  * Emits code which compares two arrays of the same length. If the CPU supports any vector
@@ -73,13 +76,12 @@
     private final Scale arrayIndexScale1;
     private final Scale arrayIndexScale2;
     private final AVXKind.AVXSize vectorSize;
-    private final int constantLength;
     private final boolean signExtend;
 
     @Def({REG}) private Value resultValue;
     @Alive({REG}) private Value array1Value;
     @Alive({REG}) private Value array2Value;
-    @Alive({REG}) private Value lengthValue;
+    @Alive({REG, CONST}) private Value lengthValue;
     @Temp({REG, ILLEGAL}) private Value temp1;
     @Temp({REG, ILLEGAL}) private Value temp2;
     @Temp({REG}) private Value temp3;
@@ -94,7 +96,7 @@
     @Temp({REG, ILLEGAL}) private Value vectorTemp4;
 
     public AMD64ArrayEqualsOp(LIRGeneratorTool tool, JavaKind kind1, JavaKind kind2, Value result, Value array1, Value array2, Value length,
-                    int constantLength, boolean directPointers, int maxVectorSize) {
+                    boolean directPointers, int maxVectorSize) {
         super(TYPE);
         this.kind1 = kind1;
         this.kind2 = kind2;
@@ -107,7 +109,6 @@
         this.arrayIndexScale1 = Objects.requireNonNull(Scale.fromInt(tool.getProviders().getMetaAccess().getArrayIndexScale(kind1)));
         this.arrayIndexScale2 = Objects.requireNonNull(Scale.fromInt(tool.getProviders().getMetaAccess().getArrayIndexScale(kind2)));
         this.vectorSize = ((AMD64) tool.target().arch).getFeatures().contains(CPUFeature.AVX2) && (maxVectorSize < 0 || maxVectorSize >= 32) ? AVXKind.AVXSize.YMM : AVXKind.AVXSize.XMM;
-        this.constantLength = constantLength;
 
         this.resultValue = result;
         this.array1Value = array1;
@@ -162,7 +163,11 @@
     }
 
     private boolean canGenerateConstantLengthCompare(TargetDescription target) {
-        return constantLength >= 0 && kind1.isNumericInteger() && (kind1 == kind2 || getElementsPerVector(AVXKind.AVXSize.XMM) <= constantLength) && supportsSSE41(target);
+        return LIRValueUtil.isJavaConstant(lengthValue) && kind1.isNumericInteger() && (kind1 == kind2 || getElementsPerVector(AVXKind.AVXSize.XMM) <= constantLength()) && supportsSSE41(target);
+    }
+
+    private int constantLength() {
+        return LIRValueUtil.asJavaConstant(lengthValue).asInt();
     }
 
     @Override
@@ -183,7 +188,11 @@
             masm.leaq(array2, new AMD64Address(asRegister(array2Value), arrayBaseOffset2));
             Register length = asRegister(temp3);
             // Get array length.
-            masm.movl(length, asRegister(lengthValue));
+            if (LIRValueUtil.isJavaConstant(lengthValue)) {
+                masm.movl(length, constantLength());
+            } else {
+                masm.movl(length, asRegister(lengthValue));
+            }
             // copy
             masm.movl(result, length);
             emitArrayCompare(crb, masm, result, array1, array2, length, trueLabel, falseLabel);
@@ -716,10 +725,10 @@
 
     private boolean constantLengthCompareNeedsTmpArrayPointers() {
         AVXKind.AVXSize vSize = vectorSize;
-        if (constantLength < getElementsPerVector(vectorSize)) {
+        if (constantLength() < getElementsPerVector(vectorSize)) {
             vSize = AVXKind.AVXSize.XMM;
         }
-        int vectorCount = constantLength & ~(2 * getElementsPerVector(vSize) - 1);
+        int vectorCount = constantLength() & ~(2 * getElementsPerVector(vSize) - 1);
         return vectorCount > 0;
     }
 
@@ -733,7 +742,7 @@
                     AMD64MacroAssembler asm,
                     Register[] tmpVectors,
                     Label noMatch) {
-        if (constantLength == 0) {
+        if (constantLength() == 0) {
             // do nothing
             return;
         }
@@ -741,13 +750,13 @@
         Register arrayPtr2 = asRegister(array2Value);
         Register tmp = asRegister(temp3);
         AVXKind.AVXSize vSize = vectorSize;
-        if (constantLength < getElementsPerVector(vectorSize)) {
+        if (constantLength() < getElementsPerVector(vectorSize)) {
             vSize = AVXKind.AVXSize.XMM;
         }
         int elementsPerVector = getElementsPerVector(vSize);
-        if (elementsPerVector > constantLength) {
+        if (elementsPerVector > constantLength()) {
             assert kind1 == kind2;
-            int byteLength = constantLength << arrayIndexScale1.log2;
+            int byteLength = constantLength() << arrayIndexScale1.log2;
             // array is shorter than any vector register, use regular XOR instructions
             int movSize = (byteLength < 2) ? 1 : ((byteLength < 4) ? 2 : ((byteLength < 8) ? 4 : 8));
             emitMovBytes(asm, tmp, new AMD64Address(arrayPtr1, arrayBaseOffset1), movSize);
@@ -760,8 +769,8 @@
             }
         } else {
             int elementsPerVectorLoop = 2 * elementsPerVector;
-            int tailCount = constantLength & (elementsPerVectorLoop - 1);
-            int vectorCount = constantLength & ~(elementsPerVectorLoop - 1);
+            int tailCount = constantLength() & (elementsPerVectorLoop - 1);
+            int vectorCount = constantLength() & ~(elementsPerVectorLoop - 1);
             int bytesPerVector = vSize.getBytes();
             if (vectorCount > 0) {
                 Label loopBegin = new Label();
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayIndexOfOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayIndexOfOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -564,7 +564,7 @@
     private void emitArrayLoad(AMD64MacroAssembler asm, AVXKind.AVXSize vectorSize, Register vecDst, Register arrayPtr, Register index, int offset, boolean alignedLoad) {
         AMD64Address src = new AMD64Address(arrayPtr, index, arrayIndexScale, offset);
         if (asm.supports(CPUFeature.AVX)) {
-            VexMoveOp loadOp = alignedLoad ? VexMoveOp.VMOVDQA : VexMoveOp.VMOVDQU;
+            VexMoveOp loadOp = alignedLoad ? VexMoveOp.VMOVDQA32 : VexMoveOp.VMOVDQU32;
             loadOp.emit(asm, vectorSize, vecDst, src);
         } else {
             // SSE
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Binary.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Binary.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BinaryConsumer.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BinaryConsumer.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathCosOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathCosOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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.
  * Copyright (c) 2016, Intel Corporation. All rights reserved.
  * Intel Math Library (LIBM) Source Code
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathExpOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathExpOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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.
  * Copyright (c) 2016, Intel Corporation. All rights reserved.
  * Intel Math Library (LIBM) Source Code
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicBinaryOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicBinaryOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicUnaryOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicUnaryOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathLog10Op.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathLog10Op.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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.
  * Copyright (c) 2016, Intel Corporation. All rights reserved.
  * Intel Math Library (LIBM) Source Code
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathLogOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathLogOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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.
  * Copyright (c) 2016, Intel Corporation. All rights reserved.
  * Intel Math Library (LIBM) Source Code
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathPowOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathPowOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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.
  * Copyright (c) 2016, Intel Corporation. All rights reserved.
  * Intel Math Library (LIBM) Source Code
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathSinOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathSinOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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.
  * Copyright (c) 2016, Intel Corporation. All rights reserved.
  * Intel Math Library (LIBM) Source Code
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathTanOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathTanOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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.
  * Copyright (c) 2016, Intel Corporation. All rights reserved.
  * Intel Math Library (LIBM) Source Code
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Move.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Move.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64RestoreRegistersOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64RestoreRegistersOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -24,9 +24,9 @@
 
 package org.graalvm.compiler.lir.amd64;
 
-import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.STACK;
 import static jdk.vm.ci.code.ValueUtil.asStackSlot;
 import static jdk.vm.ci.code.ValueUtil.isStackSlot;
+import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.STACK;
 
 import java.util.Arrays;
 
@@ -34,6 +34,7 @@
 import org.graalvm.compiler.lir.LIRInstructionClass;
 import org.graalvm.compiler.lir.LIRValueUtil;
 import org.graalvm.compiler.lir.Opcode;
+import org.graalvm.compiler.lir.StandardOp;
 import org.graalvm.compiler.lir.asm.CompilationResultBuilder;
 
 import jdk.vm.ci.amd64.AMD64Kind;
@@ -45,7 +46,7 @@
  * Restores registers from stack slots.
  */
 @Opcode("RESTORE_REGISTER")
-public class AMD64RestoreRegistersOp extends AMD64LIRInstruction {
+public class AMD64RestoreRegistersOp extends AMD64LIRInstruction implements StandardOp.RestoreRegistersOp {
     public static final LIRInstructionClass<AMD64RestoreRegistersOp> TYPE = LIRInstructionClass.create(AMD64RestoreRegistersOp.class);
 
     /**
@@ -70,7 +71,7 @@
     }
 
     protected Register[] getSavedRegisters() {
-        return save.savedRegisters;
+        return save.getSavedRegisters();
     }
 
     protected void restoreRegister(CompilationResultBuilder crb, AMD64MacroAssembler masm, Register result, StackSlot input) {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SaveRegistersOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SaveRegistersOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -26,22 +26,17 @@
 
 import static jdk.vm.ci.code.ValueUtil.asStackSlot;
 import static jdk.vm.ci.code.ValueUtil.isStackSlot;
-import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.STACK;
-
-import java.util.Arrays;
 
 import jdk.internal.vm.compiler.collections.EconomicSet;
 import org.graalvm.compiler.asm.amd64.AMD64MacroAssembler;
 import org.graalvm.compiler.lir.LIRInstructionClass;
-import org.graalvm.compiler.lir.LIRValueUtil;
 import org.graalvm.compiler.lir.Opcode;
 import org.graalvm.compiler.lir.StandardOp.SaveRegistersOp;
+import org.graalvm.compiler.lir.amd64.vector.AMD64VectorMove;
 import org.graalvm.compiler.lir.asm.CompilationResultBuilder;
-import org.graalvm.compiler.lir.framemap.FrameMap;
 
 import jdk.vm.ci.amd64.AMD64Kind;
 import jdk.vm.ci.code.Register;
-import jdk.vm.ci.code.RegisterSaveLayout;
 import jdk.vm.ci.code.StackSlot;
 import jdk.vm.ci.meta.AllocatableValue;
 
@@ -49,41 +44,21 @@
  * Saves registers to stack slots.
  */
 @Opcode("SAVE_REGISTER")
-public class AMD64SaveRegistersOp extends AMD64LIRInstruction implements SaveRegistersOp {
+public class AMD64SaveRegistersOp extends SaveRegistersOp {
     public static final LIRInstructionClass<AMD64SaveRegistersOp> TYPE = LIRInstructionClass.create(AMD64SaveRegistersOp.class);
 
     /**
-     * The registers (potentially) saved by this operation.
-     */
-    protected final Register[] savedRegisters;
-
-    /**
-     * The slots to which the registers are saved.
-     */
-    @Def(STACK) protected final AllocatableValue[] slots;
-
-    /**
-     * Specifies if {@link #remove(EconomicSet)} should have an effect.
-     */
-    protected final boolean supportsRemove;
-
-    /**
      *
      * @param savedRegisters the registers saved by this operation which may be subject to
      *            {@linkplain #remove(EconomicSet) pruning}
      * @param savedRegisterLocations the slots to which the registers are saved
-     * @param supportsRemove determines if registers can be {@linkplain #remove(EconomicSet) pruned}
      */
-    public AMD64SaveRegistersOp(Register[] savedRegisters, AllocatableValue[] savedRegisterLocations, boolean supportsRemove) {
-        this(TYPE, savedRegisters, savedRegisterLocations, supportsRemove);
+    public AMD64SaveRegistersOp(Register[] savedRegisters, AllocatableValue[] savedRegisterLocations) {
+        super(TYPE, savedRegisters, savedRegisterLocations);
     }
 
-    public AMD64SaveRegistersOp(LIRInstructionClass<? extends AMD64SaveRegistersOp> c, Register[] savedRegisters, AllocatableValue[] savedRegisterLocations, boolean supportsRemove) {
-        super(c);
-        assert Arrays.asList(savedRegisterLocations).stream().allMatch(LIRValueUtil::isVirtualStackSlot);
-        this.savedRegisters = savedRegisters;
-        this.slots = savedRegisterLocations;
-        this.supportsRemove = supportsRemove;
+    protected AMD64SaveRegistersOp(LIRInstructionClass<AMD64VectorMove.SaveRegistersOp> type, Register[] savedRegisters, AllocatableValue[] slots) {
+        super(type, savedRegisters, slots);
     }
 
     protected void saveRegister(CompilationResultBuilder crb, AMD64MacroAssembler masm, StackSlot result, Register input) {
@@ -91,7 +66,8 @@
     }
 
     @Override
-    public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
+    public void emitCode(CompilationResultBuilder crb) {
+        AMD64MacroAssembler masm = (AMD64MacroAssembler) crb.asm;
         for (int i = 0; i < savedRegisters.length; i++) {
             if (savedRegisters[i] != null) {
                 assert isStackSlot(slots[i]) : "not a StackSlot: " + slots[i];
@@ -99,73 +75,4 @@
             }
         }
     }
-
-    public AllocatableValue[] getSlots() {
-        return slots;
-    }
-
-    @Override
-    public boolean supportsRemove() {
-        return supportsRemove;
-    }
-
-    @Override
-    public int remove(EconomicSet<Register> doNotSave) {
-        if (!supportsRemove) {
-            throw new UnsupportedOperationException();
-        }
-        return prune(doNotSave, savedRegisters);
-    }
-
-    static int prune(EconomicSet<Register> toRemove, Register[] registers) {
-        int pruned = 0;
-        for (int i = 0; i < registers.length; i++) {
-            if (registers[i] != null) {
-                if (toRemove.contains(registers[i])) {
-                    registers[i] = null;
-                    pruned++;
-                }
-            }
-        }
-        return pruned;
-    }
-
-    @Override
-    public RegisterSaveLayout getMap(FrameMap frameMap) {
-        int total = 0;
-        for (int i = 0; i < savedRegisters.length; i++) {
-            if (savedRegisters[i] != null) {
-                total++;
-            }
-        }
-        Register[] keys = new Register[total];
-        int[] values = new int[total];
-        if (total != 0) {
-            int mapIndex = 0;
-            for (int i = 0; i < savedRegisters.length; i++) {
-                if (savedRegisters[i] != null) {
-                    keys[mapIndex] = savedRegisters[i];
-                    assert isStackSlot(slots[i]) : "not a StackSlot: " + slots[i];
-                    StackSlot slot = asStackSlot(slots[i]);
-                    values[mapIndex] = indexForStackSlot(frameMap, slot);
-                    mapIndex++;
-                }
-            }
-            assert mapIndex == total;
-        }
-        return new RegisterSaveLayout(keys, values);
-    }
-
-    /**
-     * Computes the index of a stack slot relative to slot 0. This is also the bit index of stack
-     * slots in the reference map.
-     *
-     * @param slot a stack slot
-     * @return the index of the stack slot
-     */
-    private static int indexForStackSlot(FrameMap frameMap, StackSlot slot) {
-        assert frameMap.offsetForStackSlot(slot) % frameMap.getTarget().wordSize == 0;
-        int value = frameMap.offsetForStackSlot(slot) / frameMap.getTarget().wordSize;
-        return value;
-    }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64StringLatin1InflateOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64StringLatin1InflateOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64StringUTF16CompressOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64StringUTF16CompressOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64VZeroUpper.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64VZeroUpper.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -27,6 +27,7 @@
 import static jdk.vm.ci.code.ValueUtil.asRegister;
 import static jdk.vm.ci.code.ValueUtil.isRegister;
 
+import java.util.ArrayList;
 import java.util.BitSet;
 
 import org.graalvm.compiler.asm.amd64.AMD64MacroAssembler;
@@ -35,6 +36,7 @@
 
 import jdk.vm.ci.amd64.AMD64;
 import jdk.vm.ci.code.Register;
+import jdk.vm.ci.code.RegisterConfig;
 import jdk.vm.ci.code.RegisterValue;
 import jdk.vm.ci.meta.Value;
 
@@ -44,30 +46,27 @@
 
     @Temp protected final RegisterValue[] xmmRegisters;
 
-    public AMD64VZeroUpper(Value[] exclude) {
+    public AMD64VZeroUpper(Value[] exclude, RegisterConfig registerConfig) {
         super(TYPE);
-        xmmRegisters = initRegisterValues(exclude);
+        xmmRegisters = initRegisterValues(exclude, registerConfig);
     }
 
-    private static RegisterValue[] initRegisterValues(Value[] exclude) {
+    private static RegisterValue[] initRegisterValues(Value[] exclude, RegisterConfig registerConfig) {
         BitSet skippedRegs = new BitSet();
-        int numSkipped = 0;
         if (exclude != null) {
             for (Value value : exclude) {
                 if (isRegister(value) && asRegister(value).getRegisterCategory().equals(AMD64.XMM)) {
                     skippedRegs.set(asRegister(value).number);
-                    numSkipped++;
                 }
             }
         }
-        RegisterValue[] regs = new RegisterValue[AMD64.xmmRegistersAVX512.length - numSkipped];
-        for (int i = 0, j = 0; i < AMD64.xmmRegistersAVX512.length; i++) {
-            Register reg = AMD64.xmmRegistersAVX512[i];
-            if (!skippedRegs.get(reg.number)) {
-                regs[j++] = reg.asValue();
+        ArrayList<RegisterValue> regs = new ArrayList<>();
+        for (Register r : registerConfig.getCallerSaveRegisters()) {
+            if (r.getRegisterCategory().equals(AMD64.XMM) && !skippedRegs.get(r.number)) {
+                regs.add(r.asValue());
             }
         }
-        return regs;
+        return regs.toArray(new RegisterValue[regs.size()]);
     }
 
     @Override
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapRegistersOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapRegistersOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -24,26 +24,21 @@
 
 package org.graalvm.compiler.lir.amd64;
 
-import static org.graalvm.compiler.lir.amd64.AMD64SaveRegistersOp.prune;
-
-import jdk.internal.vm.compiler.collections.EconomicSet;
 import org.graalvm.compiler.asm.amd64.AMD64MacroAssembler;
 import org.graalvm.compiler.lir.LIRInstructionClass;
 import org.graalvm.compiler.lir.Opcode;
-import org.graalvm.compiler.lir.StandardOp.SaveRegistersOp;
+import org.graalvm.compiler.lir.StandardOp;
 import org.graalvm.compiler.lir.asm.CompilationResultBuilder;
-import org.graalvm.compiler.lir.framemap.FrameMap;
 
 import jdk.vm.ci.amd64.AMD64Kind;
 import jdk.vm.ci.code.Register;
-import jdk.vm.ci.code.RegisterSaveLayout;
 import jdk.vm.ci.meta.JavaConstant;
 
 /**
  * Writes well known garbage values to registers.
  */
 @Opcode("ZAP_REGISTER")
-public final class AMD64ZapRegistersOp extends AMD64LIRInstruction implements SaveRegistersOp {
+public final class AMD64ZapRegistersOp extends AMD64LIRInstruction implements StandardOp.ZapRegistersOp {
     public static final LIRInstructionClass<AMD64ZapRegistersOp> TYPE = LIRInstructionClass.create(AMD64ZapRegistersOp.class);
 
     /**
@@ -71,19 +66,4 @@
             }
         }
     }
-
-    @Override
-    public boolean supportsRemove() {
-        return true;
-    }
-
-    @Override
-    public int remove(EconomicSet<Register> doNotSave) {
-        return prune(doNotSave, zappedRegisters);
-    }
-
-    @Override
-    public RegisterSaveLayout getMap(FrameMap frameMap) {
-        return new RegisterSaveLayout(new Register[0], new int[0]);
-    }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorCompareOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorCompareOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -44,12 +44,18 @@
     public static final LIRInstructionClass<AMD64VectorCompareOp> TYPE = LIRInstructionClass.create(AMD64VectorCompareOp.class);
 
     @Opcode private final VexRMOp opcode;
+    private final AVXSize size;
     @Use({REG}) protected AllocatableValue x;
     @Use({REG, STACK}) protected AllocatableValue y;
 
     public AMD64VectorCompareOp(VexRMOp opcode, AllocatableValue x, AllocatableValue y) {
+        this(opcode, AVXSize.XMM, x, y);
+    }
+
+    public AMD64VectorCompareOp(VexRMOp opcode, AVXSize size, AllocatableValue x, AllocatableValue y) {
         super(TYPE);
         this.opcode = opcode;
+        this.size = size;
         this.x = x;
         this.y = y;
     }
@@ -57,9 +63,9 @@
     @Override
     public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
         if (isRegister(y)) {
-            opcode.emit(masm, AVXSize.XMM, asRegister(x), asRegister(y));
+            opcode.emit(masm, size, asRegister(x), asRegister(y));
         } else {
-            opcode.emit(masm, AVXSize.XMM, asRegister(x), (AMD64Address) crb.asAddress(y));
+            opcode.emit(masm, size, asRegister(x), (AMD64Address) crb.asAddress(y));
         }
     }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorMove.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorMove.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -28,7 +28,7 @@
 import static jdk.vm.ci.code.ValueUtil.isRegister;
 import static jdk.vm.ci.code.ValueUtil.isStackSlot;
 import static org.graalvm.compiler.asm.amd64.AMD64Assembler.VexMoveOp.VMOVD;
-import static org.graalvm.compiler.asm.amd64.AMD64Assembler.VexMoveOp.VMOVDQU;
+import static org.graalvm.compiler.asm.amd64.AMD64Assembler.VexMoveOp.VMOVDQU32;
 import static org.graalvm.compiler.asm.amd64.AMD64Assembler.VexMoveOp.VMOVQ;
 import static org.graalvm.compiler.asm.amd64.AMD64Assembler.VexMoveOp.VMOVSD;
 import static org.graalvm.compiler.asm.amd64.AMD64Assembler.VexMoveOp.VMOVSS;
@@ -266,8 +266,8 @@
     public static class SaveRegistersOp extends AMD64SaveRegistersOp {
         public static final LIRInstructionClass<SaveRegistersOp> TYPE = LIRInstructionClass.create(SaveRegistersOp.class);
 
-        public SaveRegistersOp(Register[] savedRegisters, AllocatableValue[] slots, boolean supportsRemove) {
-            super(TYPE, savedRegisters, slots, supportsRemove);
+        public SaveRegistersOp(Register[] savedRegisters, AllocatableValue[] slots) {
+            super(TYPE, savedRegisters, slots);
         }
 
         @Override
@@ -334,7 +334,7 @@
             case DOUBLE:
                 return VMOVUPD;
             default:
-                return VMOVDQU;
+                return VMOVDQU32;
         }
     }
 
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCSaveRegistersOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCSaveRegistersOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -26,23 +26,17 @@
 
 import static jdk.vm.ci.code.ValueUtil.asStackSlot;
 import static jdk.vm.ci.code.ValueUtil.isStackSlot;
-import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.STACK;
 import static org.graalvm.compiler.lir.sparc.SPARCDelayedControlTransfer.DUMMY;
 
-import java.util.Arrays;
-
 import jdk.internal.vm.compiler.collections.EconomicSet;
 import org.graalvm.compiler.asm.sparc.SPARCAddress;
 import org.graalvm.compiler.asm.sparc.SPARCMacroAssembler;
 import org.graalvm.compiler.lir.LIRInstructionClass;
-import org.graalvm.compiler.lir.LIRValueUtil;
 import org.graalvm.compiler.lir.Opcode;
 import org.graalvm.compiler.lir.StandardOp.SaveRegistersOp;
 import org.graalvm.compiler.lir.asm.CompilationResultBuilder;
-import org.graalvm.compiler.lir.framemap.FrameMap;
 
 import jdk.vm.ci.code.Register;
-import jdk.vm.ci.code.RegisterSaveLayout;
 import jdk.vm.ci.code.RegisterValue;
 import jdk.vm.ci.code.StackSlot;
 import jdk.vm.ci.meta.AllocatableValue;
@@ -52,42 +46,26 @@
  * Saves registers to stack slots.
  */
 @Opcode("SAVE_REGISTER")
-public class SPARCSaveRegistersOp extends SPARCLIRInstruction implements SaveRegistersOp {
+public class SPARCSaveRegistersOp extends SaveRegistersOp implements SPARCLIRInstructionMixin {
     public static final LIRInstructionClass<SPARCSaveRegistersOp> TYPE = LIRInstructionClass.create(SPARCSaveRegistersOp.class);
     public static final Register RETURN_REGISTER_STORAGE = SPARC.d62;
     public static final SizeEstimate SIZE = SizeEstimate.create(32);
-    /**
-     * The registers (potentially) saved by this operation.
-     */
-    protected final Register[] savedRegisters;
-
-    /**
-     * The slots to which the registers are saved.
-     */
-    @Def(STACK) protected final AllocatableValue[] slots;
-
-    /**
-     * Specifies if {@link #remove(EconomicSet)} should have an effect.
-     */
-    protected final boolean supportsRemove;
+    private final SPARCLIRInstructionMixinStore store;
 
     /**
      *
      * @param savedRegisters the registers saved by this operation which may be subject to
      *            {@linkplain #remove(EconomicSet) pruning}
      * @param savedRegisterLocations the slots to which the registers are saved
-     * @param supportsRemove determines if registers can be {@linkplain #remove(EconomicSet) pruned}
      */
-    public SPARCSaveRegistersOp(Register[] savedRegisters, AllocatableValue[] savedRegisterLocations, boolean supportsRemove) {
-        super(TYPE, SIZE);
-        assert Arrays.asList(savedRegisterLocations).stream().allMatch(LIRValueUtil::isVirtualStackSlot);
-        this.savedRegisters = savedRegisters;
-        this.slots = savedRegisterLocations;
-        this.supportsRemove = supportsRemove;
+    public SPARCSaveRegistersOp(Register[] savedRegisters, AllocatableValue[] savedRegisterLocations) {
+        super(TYPE, savedRegisters, savedRegisterLocations);
+        this.store = new SPARCLIRInstructionMixinStore(SIZE);
     }
 
     @Override
-    public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) {
+    public void emitCode(CompilationResultBuilder crb) {
+        SPARCMacroAssembler masm = (SPARCMacroAssembler) crb.asm;
         // Can be used with VIS3
         // new Movxtod(SPARC.i0, RETURN_REGISTER_STORAGE).emit(masm);
         // We abuse the first stackslot for transferring i0 to return_register_storage
@@ -109,72 +87,8 @@
         }
     }
 
-    public AllocatableValue[] getSlots() {
-        return slots;
-    }
-
     @Override
-    public boolean supportsRemove() {
-        return supportsRemove;
-    }
-
-    @Override
-    public int remove(EconomicSet<Register> doNotSave) {
-        if (!supportsRemove) {
-            throw new UnsupportedOperationException();
-        }
-        return prune(doNotSave, savedRegisters);
-    }
-
-    static int prune(EconomicSet<Register> toRemove, Register[] registers) {
-        int pruned = 0;
-        for (int i = 0; i < registers.length; i++) {
-            if (registers[i] != null) {
-                if (toRemove.contains(registers[i])) {
-                    registers[i] = null;
-                    pruned++;
-                }
-            }
-        }
-        return pruned;
-    }
-
-    @Override
-    public RegisterSaveLayout getMap(FrameMap frameMap) {
-        int total = 0;
-        for (int i = 0; i < savedRegisters.length; i++) {
-            if (savedRegisters[i] != null) {
-                total++;
-            }
-        }
-        Register[] keys = new Register[total];
-        int[] values = new int[total];
-        if (total != 0) {
-            int mapIndex = 0;
-            for (int i = 0; i < savedRegisters.length; i++) {
-                if (savedRegisters[i] != null) {
-                    keys[mapIndex] = savedRegisters[i];
-                    assert isStackSlot(slots[i]) : "not a StackSlot: " + slots[i];
-                    StackSlot slot = asStackSlot(slots[i]);
-                    values[mapIndex] = indexForStackSlot(frameMap, slot);
-                    mapIndex++;
-                }
-            }
-            assert mapIndex == total;
-        }
-        return new RegisterSaveLayout(keys, values);
-    }
-
-    /**
-     * Computes the index of a stack slot relative to slot 0. This is also the bit index of stack
-     * slots in the reference map.
-     *
-     * @param slot a stack slot
-     * @return the index of the stack slot
-     */
-    private static int indexForStackSlot(FrameMap frameMap, StackSlot slot) {
-        assert frameMap.offsetForStackSlot(slot) % frameMap.getTarget().wordSize == 0;
-        int value = frameMap.offsetForStackSlot(slot) / frameMap.getTarget().wordSize;
-        return value;
+    public SPARCLIRInstructionMixinStore getSPARCLIRInstructionStore() {
+        return store;
     }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/BailoutAndRestartBackendException.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/BailoutAndRestartBackendException.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIR.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIR.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstructionVerifier.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,33 @@
+/*
+ * 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 org.graalvm.compiler.lir;
+
+public interface LIRInstructionVerifier {
+
+    boolean isEnabled();
+
+    void verify(LIRInstruction op, byte[] emittedCode);
+
+}
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRVerifier.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRVerifier.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StandardOp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StandardOp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -24,6 +24,8 @@
 
 package org.graalvm.compiler.lir;
 
+import static jdk.vm.ci.code.ValueUtil.asStackSlot;
+import static jdk.vm.ci.code.ValueUtil.isStackSlot;
 import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.CONST;
 import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.HINT;
 import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.OUTGOING;
@@ -31,9 +33,11 @@
 import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.STACK;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.EnumSet;
 
 import jdk.internal.vm.compiler.collections.EconomicSet;
+import jdk.internal.vm.compiler.collections.Equivalence;
 import org.graalvm.compiler.asm.Label;
 import org.graalvm.compiler.core.common.GraalOptions;
 import org.graalvm.compiler.core.common.cfg.AbstractBlockBase;
@@ -300,22 +304,41 @@
      * {@linkplain #remove(EconomicSet) pruned} and a mapping from registers to the frame slots in
      * which they are saved can be {@linkplain #getMap(FrameMap) retrieved}.
      */
-    public interface SaveRegistersOp {
+    public abstract static class SaveRegistersOp extends LIRInstruction {
+        public static final LIRInstructionClass<SaveRegistersOp> TYPE = LIRInstructionClass.create(SaveRegistersOp.class);
+
+        /**
+         * The registers (potentially) saved by this operation.
+         */
+        protected final Register[] savedRegisters;
 
         /**
-         * Determines if the {@link #remove(EconomicSet)} operation is supported for this object.
+         * The slots to which the registers are saved.
          */
-        boolean supportsRemove();
+        @Def(STACK) protected final AllocatableValue[] slots;
+
+        /**
+         *
+         * @param savedRegisters the registers saved by this operation which may be subject to
+         *            {@linkplain #remove(EconomicSet) pruning}
+         * @param savedRegisterLocations the slots to which the registers are saved
+         */
+        protected SaveRegistersOp(LIRInstructionClass<? extends SaveRegistersOp> c, Register[] savedRegisters, AllocatableValue[] savedRegisterLocations) {
+            super(c);
+            assert Arrays.asList(savedRegisterLocations).stream().allMatch(LIRValueUtil::isVirtualStackSlot);
+            this.savedRegisters = savedRegisters;
+            this.slots = savedRegisterLocations;
+        }
 
         /**
          * Prunes {@code doNotSave} from the registers saved by this operation.
          *
          * @param doNotSave registers that should not be saved by this operation
          * @return the number of registers pruned
-         * @throws UnsupportedOperationException if removal is not {@linkplain #supportsRemove()
-         *             supported}
          */
-        int remove(EconomicSet<Register> doNotSave);
+        public int remove(EconomicSet<Register> doNotSave) {
+            return prune(doNotSave, savedRegisters);
+        }
 
         /**
          * Gets a map from the saved registers saved by this operation to the frame slots in which
@@ -324,8 +347,89 @@
          * @param frameMap used to {@linkplain FrameMap#offsetForStackSlot(StackSlot) convert} a
          *            virtual slot to a frame slot index
          */
-        RegisterSaveLayout getMap(FrameMap frameMap);
+
+        public RegisterSaveLayout getMap(FrameMap frameMap) {
+            int total = 0;
+            for (int i = 0; i < savedRegisters.length; i++) {
+                if (savedRegisters[i] != null) {
+                    total++;
+                }
+            }
+            Register[] keys = new Register[total];
+            int[] values = new int[total];
+            if (total != 0) {
+                int mapIndex = 0;
+                for (int i = 0; i < savedRegisters.length; i++) {
+                    if (savedRegisters[i] != null) {
+                        keys[mapIndex] = savedRegisters[i];
+                        assert isStackSlot(slots[i]) : "not a StackSlot: " + slots[i];
+                        StackSlot slot = asStackSlot(slots[i]);
+                        values[mapIndex] = indexForStackSlot(frameMap, slot);
+                        mapIndex++;
+                    }
+                }
+                assert mapIndex == total;
+            }
+            return new RegisterSaveLayout(keys, values);
+        }
+
+        public Register[] getSavedRegisters() {
+            return savedRegisters;
+        }
+
+        public EconomicSet<Register> getSaveableRegisters() {
+            EconomicSet<Register> registers = EconomicSet.create(Equivalence.IDENTITY);
+            for (Register r : savedRegisters) {
+                registers.add(r);
+            }
+            return registers;
+        }
+
+        public AllocatableValue[] getSlots() {
+            return slots;
+        }
 
+        @Override
+        public abstract void emitCode(CompilationResultBuilder crb);
+
+        static int prune(EconomicSet<Register> toRemove, Register[] registers) {
+            int pruned = 0;
+            for (int i = 0; i < registers.length; i++) {
+                if (registers[i] != null) {
+                    if (toRemove.contains(registers[i])) {
+                        registers[i] = null;
+                        pruned++;
+                    }
+                }
+            }
+            return pruned;
+        }
+
+        /**
+         * Computes the index of a stack slot relative to slot 0. This is also the bit index of
+         * stack slots in the reference map.
+         *
+         * @param slot a stack slot
+         * @return the index of the stack slot
+         */
+        private static int indexForStackSlot(FrameMap frameMap, StackSlot slot) {
+            assert frameMap.offsetForStackSlot(slot) % frameMap.getTarget().wordSize == 0;
+            int value = frameMap.offsetForStackSlot(slot) / frameMap.getTarget().wordSize;
+            return value;
+        }
+    }
+
+    /**
+     * Marker interface for an operation that restores the registers saved by
+     * {@link SaveRegistersOp}.
+     */
+    public interface RestoreRegistersOp {
+    }
+
+    /**
+     * Marker interface for an operation that kills some set register and stack locations.
+     */
+    public interface ZapRegistersOp {
     }
 
     /**
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanWalker.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanWalker.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilder.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilder.java	Wed Sep 25 22:40:41 2019 +0200
@@ -41,6 +41,7 @@
 import org.graalvm.compiler.asm.Label;
 import org.graalvm.compiler.code.CompilationResult;
 import org.graalvm.compiler.code.CompilationResult.CodeAnnotation;
+import org.graalvm.compiler.code.CompilationResult.JumpTable;
 import org.graalvm.compiler.code.DataSection.Data;
 import org.graalvm.compiler.code.DataSection.RawData;
 import org.graalvm.compiler.core.common.NumUtil;
@@ -53,6 +54,7 @@
 import org.graalvm.compiler.lir.LIR;
 import org.graalvm.compiler.lir.LIRFrameState;
 import org.graalvm.compiler.lir.LIRInstruction;
+import org.graalvm.compiler.lir.LIRInstructionVerifier;
 import org.graalvm.compiler.lir.LabelRef;
 import org.graalvm.compiler.lir.StandardOp.LabelHoldingOp;
 import org.graalvm.compiler.lir.framemap.FrameMap;
@@ -60,6 +62,7 @@
 import org.graalvm.compiler.options.OptionKey;
 import org.graalvm.compiler.options.OptionType;
 import org.graalvm.compiler.options.OptionValues;
+import org.graalvm.compiler.serviceprovider.GraalServices;
 
 import jdk.vm.ci.code.BailoutException;
 import jdk.vm.ci.code.CodeCacheProvider;
@@ -85,6 +88,16 @@
  */
 public class CompilationResultBuilder {
 
+    private static final List<LIRInstructionVerifier> LIR_INSTRUCTION_VERIFIERS = new ArrayList<>();
+
+    static {
+        for (LIRInstructionVerifier verifier : GraalServices.load(LIRInstructionVerifier.class)) {
+            if (verifier.isEnabled()) {
+                LIR_INSTRUCTION_VERIFIERS.add(verifier);
+            }
+        }
+    }
+
     public static class Options {
         @Option(help = "Include the LIR as comments with the final assembly.", type = OptionType.Debug) //
         public static final OptionKey<Boolean> PrintLIRWithAssembly = new OptionKey<>(false);
@@ -561,7 +574,7 @@
                 if (beforeOp != null) {
                     beforeOp.accept(op);
                 }
-                emitOp(this, op);
+                emitOp(op);
                 if (afterOp != null) {
                     afterOp.accept(op);
                 }
@@ -571,12 +584,29 @@
         }
     }
 
-    private static void emitOp(CompilationResultBuilder crb, LIRInstruction op) {
+    private void emitOp(LIRInstruction op) {
         try {
-            int start = crb.asm.position();
-            op.emitCode(crb);
+            int start = asm.position();
+            op.emitCode(this);
             if (op.getPosition() != null) {
-                crb.recordSourceMapping(start, crb.asm.position(), op.getPosition());
+                recordSourceMapping(start, asm.position(), op.getPosition());
+            }
+            if (LIR_INSTRUCTION_VERIFIERS.size() > 0 && start < asm.position()) {
+                int end = asm.position();
+                for (CodeAnnotation codeAnnotation : compilationResult.getCodeAnnotations()) {
+                    if (codeAnnotation instanceof JumpTable) {
+                        // Skip jump table. Here we assume the jump table is at the tail of the
+                        // emitted code.
+                        int jumpTableStart = codeAnnotation.position;
+                        if (jumpTableStart >= start && jumpTableStart < end) {
+                            end = jumpTableStart;
+                        }
+                    }
+                }
+                byte[] emittedCode = asm.copy(start, end);
+                for (LIRInstructionVerifier verifier : LIR_INSTRUCTION_VERIFIERS) {
+                    verifier.verify(op, emittedCode);
+                }
             }
         } catch (BailoutException e) {
             throw e;
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilderFactory.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilderFactory.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantLoadOptimization.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantLoadOptimization.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarkerPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarkerPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMap.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMap.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilder.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilder.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderImpl.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderImpl.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/VirtualStackSlotRange.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/VirtualStackSlotRange.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGeneratorTool.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGeneratorTool.java	Wed Sep 25 22:40:41 2019 +0200
@@ -137,8 +137,4 @@
         throw GraalError.unimplemented("No specialized implementation available");
     }
 
-    @SuppressWarnings("unused")
-    default void emitZeroMemory(Value address, Value length) {
-        throw GraalError.unimplemented("Bulk zeroing is not supported on this platform");
-    }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/DiagnosticLIRGeneratorTool.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/DiagnosticLIRGeneratorTool.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -26,6 +26,8 @@
 
 import org.graalvm.compiler.lir.LIRInstruction;
 import org.graalvm.compiler.lir.StandardOp.SaveRegistersOp;
+import org.graalvm.compiler.lir.StandardOp.ZapRegistersOp;
+
 import jdk.vm.ci.code.Register;
 import jdk.vm.ci.code.RegisterConfig;
 import jdk.vm.ci.code.StackSlot;
@@ -41,25 +43,31 @@
      * Creates a {@link SaveRegistersOp} that fills a given set of registers with known garbage
      * value.
      *
-     * The set of registers actually touched might be {@link SaveRegistersOp#remove reduced} later.
-     *
      * @param zappedRegisters registers to be zapped
      * @param zapValues values used for zapping
      *
      * @see DiagnosticLIRGeneratorTool#createZapRegisters()
      */
-    SaveRegistersOp createZapRegisters(Register[] zappedRegisters, JavaConstant[] zapValues);
+    ZapRegistersOp createZapRegisters(Register[] zappedRegisters, JavaConstant[] zapValues);
 
     /**
-     * Creates a {@link SaveRegistersOp} that fills all
+     * Creates a {@link SaveRegistersOp} that fills a given set of registers with a
+     * {@link LIRGenerator#zapValueForKind known garbage value}.
+     *
+     * @param zappedRegisters registers to be zapped
+     *
+     * @see DiagnosticLIRGeneratorTool#createZapRegisters()
+     */
+    ZapRegistersOp createZapRegisters(Register[] zappedRegisters);
+
+    /**
+     * Creates a {@link ZapRegistersOp} that fills all
      * {@link RegisterConfig#getAllocatableRegisters() allocatable registers} with a
      * {@link LIRGenerator#zapValueForKind known garbage value}.
      *
-     * The set of registers actually touched might be {@link SaveRegistersOp#remove reduced} later.
-     *
      * @see DiagnosticLIRGeneratorTool#createZapRegisters(Register[], JavaConstant[])
      */
-    SaveRegistersOp createZapRegisters();
+    ZapRegistersOp createZapRegisters();
 
     /**
      * Marker interface for {@link LIRInstruction instructions} that should be succeeded with a
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerationResult.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerationResult.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -28,6 +28,7 @@
 import jdk.internal.vm.compiler.collections.Equivalence;
 import org.graalvm.compiler.core.common.CompilationIdentifier;
 import org.graalvm.compiler.core.common.CompilationIdentifier.Verbosity;
+import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig;
 import org.graalvm.compiler.debug.DebugContext;
 import org.graalvm.compiler.lir.LIR;
 import org.graalvm.compiler.lir.LIRInstruction;
@@ -42,6 +43,7 @@
     private final LIR lir;
     private final FrameMapBuilder frameMapBuilder;
     private FrameMap frameMap;
+    private final RegisterAllocationConfig registerAllocationConfig;
     private final CallingConvention callingConvention;
     /**
      * Records whether the code being generated makes at least one foreign call.
@@ -57,13 +59,18 @@
      */
     private EconomicMap<LIRInstruction, String> comments;
 
-    public LIRGenerationResult(CompilationIdentifier compilationId, LIR lir, FrameMapBuilder frameMapBuilder, CallingConvention callingConvention) {
+    public LIRGenerationResult(CompilationIdentifier compilationId, LIR lir, FrameMapBuilder frameMapBuilder, RegisterAllocationConfig registerAllocationConfig, CallingConvention callingConvention) {
         this.lir = lir;
         this.frameMapBuilder = frameMapBuilder;
+        this.registerAllocationConfig = registerAllocationConfig;
         this.callingConvention = callingConvention;
         this.compilationId = compilationId;
     }
 
+    public RegisterAllocationConfig getRegisterAllocationConfig() {
+        return registerAllocationConfig;
+    }
+
     /**
      * Adds a comment to a {@link LIRInstruction}. Existing comments are replaced.
      */
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerator.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerator.java	Wed Sep 25 22:40:41 2019 +0200
@@ -59,7 +59,7 @@
 import org.graalvm.compiler.lir.StandardOp;
 import org.graalvm.compiler.lir.StandardOp.BlockEndOp;
 import org.graalvm.compiler.lir.StandardOp.LabelOp;
-import org.graalvm.compiler.lir.StandardOp.SaveRegistersOp;
+import org.graalvm.compiler.lir.StandardOp.ZapRegistersOp;
 import org.graalvm.compiler.lir.SwitchStrategy;
 import org.graalvm.compiler.lir.Variable;
 import org.graalvm.compiler.lir.hashing.Hasher;
@@ -604,11 +604,16 @@
     }
 
     @Override
-    public abstract SaveRegistersOp createZapRegisters(Register[] zappedRegisters, JavaConstant[] zapValues);
+    public abstract ZapRegistersOp createZapRegisters(Register[] zappedRegisters, JavaConstant[] zapValues);
 
     @Override
-    public SaveRegistersOp createZapRegisters() {
+    public ZapRegistersOp createZapRegisters() {
         Register[] zappedRegisters = getResult().getFrameMap().getRegisterConfig().getAllocatableRegisters().toArray();
+        return createZapRegisters(zappedRegisters);
+    }
+
+    @Override
+    public ZapRegistersOp createZapRegisters(Register[] zappedRegisters) {
         JavaConstant[] zapValues = new JavaConstant[zappedRegisters.length];
         for (int i = 0; i < zappedRegisters.length; i++) {
             PlatformKind kind = target().arch.getLargestStorableKind(zappedRegisters[i].getRegisterCategory());
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGeneratorTool.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGeneratorTool.java	Wed Sep 25 22:40:41 2019 +0200
@@ -279,10 +279,10 @@
         throw GraalError.unimplemented("String.compareTo substitution is not implemented on this architecture");
     }
 
-    Variable emitArrayEquals(JavaKind kind, Value array1, Value array2, Value length, int constantLength, boolean directPointers);
+    Variable emitArrayEquals(JavaKind kind, Value array1, Value array2, Value length, boolean directPointers);
 
     @SuppressWarnings("unused")
-    default Variable emitArrayEquals(JavaKind kind1, JavaKind kind2, Value array1, Value array2, Value length, int constantLength, boolean directPointers) {
+    default Variable emitArrayEquals(JavaKind kind1, JavaKind kind2, Value array1, Value array2, Value length, boolean directPointers) {
         throw GraalError.unimplemented("Array.equals with different types substitution is not implemented on this architecture");
     }
 
@@ -353,4 +353,9 @@
     default Value emitReadReturnAddress(Stamp wordStamp, int returnAddressSize) {
         return emitMove(StackSlot.get(getLIRKind(wordStamp), -returnAddressSize, true));
     }
+
+    @SuppressWarnings("unused")
+    default void emitZeroMemory(Value address, Value length) {
+        throw GraalError.unimplemented("Bulk zeroing is not implemented on this architecture");
+    }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAVerifier.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAVerifier.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/LSStackSlotAllocator.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/LSStackSlotAllocator.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/SimpleStackSlotAllocator.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/SimpleStackSlotAllocator.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ContextlessLoopPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ContextlessLoopPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ConvertDeoptimizeToGuardPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ConvertDeoptimizeToGuardPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopFullUnrollPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopFullUnrollPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPartialUnrollPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPartialUnrollPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPeelingPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPeelingPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopSafepointEliminationPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopSafepointEliminationPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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,18 +40,24 @@
     @Override
     protected void run(StructuredGraph graph, MidTierContext context) {
         LoopsData loops = new LoopsData(graph);
-        if (context.getOptimisticOptimizations().useLoopLimitChecks(graph.getOptions()) && graph.getGuardsStage().allowsFloatingGuards()) {
-            loops.detectedCountedLoops();
-            for (LoopEx loop : loops.countedLoops()) {
-                if (loop.loop().getChildren().isEmpty() && loop.counted().getStamp().getBits() <= 32) {
-                    boolean hasSafepoint = false;
-                    for (LoopEndNode loopEnd : loop.loopBegin().loopEnds()) {
-                        hasSafepoint |= loopEnd.canSafepoint();
+        loops.detectedCountedLoops();
+        for (LoopEx loop : loops.countedLoops()) {
+            if (loop.loop().getChildren().isEmpty() && loop.counted().getStamp().getBits() <= 32) {
+                boolean hasSafepoint = false;
+                for (LoopEndNode loopEnd : loop.loopBegin().loopEnds()) {
+                    hasSafepoint |= loopEnd.canSafepoint();
+                }
+                if (hasSafepoint) {
+                    if (!loop.counted().counterNeverOverflows()) {
+                        // Counter can overflow, need to create a guard.
+                        if (context.getOptimisticOptimizations().useLoopLimitChecks(graph.getOptions()) && graph.getGuardsStage().allowsFloatingGuards()) {
+                            loop.counted().createOverFlowGuard();
+                        } else {
+                            // Cannot disable this safepoint, because the loop could overflow.
+                            continue;
+                        }
                     }
-                    if (hasSafepoint) {
-                        loop.counted().createOverFlowGuard();
-                        loop.loopBegin().disableSafepoint();
-                    }
+                    loop.loopBegin().disableSafepoint();
                 }
             }
         }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopTransformations.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopTransformations.java	Wed Sep 25 22:40:41 2019 +0200
@@ -62,10 +62,10 @@
 import org.graalvm.compiler.nodes.calc.AddNode;
 import org.graalvm.compiler.nodes.calc.CompareNode;
 import org.graalvm.compiler.nodes.calc.ConditionalNode;
-import org.graalvm.compiler.nodes.calc.IntegerLessThanNode;
 import org.graalvm.compiler.nodes.extended.OpaqueNode;
 import org.graalvm.compiler.nodes.extended.SwitchNode;
 import org.graalvm.compiler.nodes.spi.CoreProviders;
+import org.graalvm.compiler.nodes.util.IntegerHelper;
 import org.graalvm.compiler.phases.common.CanonicalizerPhase;
 
 public abstract class LoopTransformations {
@@ -359,11 +359,12 @@
         ValueNode newLimit = AddNode.add(preCounted.getStart(), preCounted.getCounter().strideNode(), NodeView.DEFAULT);
         // Fetch the variable we are not replacing and configure the one we are
         ValueNode ub = preCounted.getLimit();
+        IntegerHelper helper = preCounted.getCounterIntegerHelper();
         LogicNode entryCheck;
         if (preCounted.getDirection() == Direction.Up) {
-            entryCheck = IntegerLessThanNode.create(newLimit, ub, NodeView.DEFAULT);
+            entryCheck = helper.createCompareNode(newLimit, ub, NodeView.DEFAULT);
         } else {
-            entryCheck = IntegerLessThanNode.create(ub, newLimit, NodeView.DEFAULT);
+            entryCheck = helper.createCompareNode(ub, newLimit, NodeView.DEFAULT);
         }
         newLimit = ConditionalNode.create(entryCheck, newLimit, ub, NodeView.DEFAULT);
         // Re-wire the condition with the new limit
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.test/src/org/graalvm/compiler/loop/test/LoopPartialUnrollTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.test/src/org/graalvm/compiler/loop/test/LoopPartialUnrollTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -143,6 +143,35 @@
     }
 
     @Test
+    @Ignore
+    public void testUnsignedLoopCarried() {
+        for (int i = -1; i < 64; i++) {
+            for (int j = 0; j < 64; j++) {
+                test("testUnsignedLoopCarriedSnippet", i, j);
+            }
+        }
+        test("testUnsignedLoopCarriedSnippet", -1 - 32, -1);
+        test("testUnsignedLoopCarriedSnippet", -1 - 4, -1);
+        test("testUnsignedLoopCarriedSnippet", -1 - 32, 0);
+    }
+
+    public static int testUnsignedLoopCarriedSnippet(int start, int end) {
+        int a = 0;
+        int b = 0;
+        int c = 0;
+
+        for (int i = start; branchProbability(0.99, Integer.compareUnsigned(i, end) < 0); i++) {
+            int t1 = volatileInt;
+            int t2 = a + b;
+            c = b;
+            b = a;
+            a = t1 + t2;
+        }
+
+        return c;
+    }
+
+    @Test
     public void testLoopCarried2() {
         for (int i = -1; i < 64; i++) {
             for (int j = -1; j < 64; j++) {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/CountedLoopInfo.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/CountedLoopInfo.java	Wed Sep 25 22:40:41 2019 +0200
@@ -29,7 +29,6 @@
 import static org.graalvm.compiler.nodes.calc.BinaryArithmeticNode.add;
 import static org.graalvm.compiler.nodes.calc.BinaryArithmeticNode.sub;
 
-import org.graalvm.compiler.core.common.NumUtil;
 import org.graalvm.compiler.core.common.type.IntegerStamp;
 import org.graalvm.compiler.core.common.type.Stamp;
 import org.graalvm.compiler.core.common.util.UnsignedLong;
@@ -44,10 +43,12 @@
 import org.graalvm.compiler.nodes.StructuredGraph;
 import org.graalvm.compiler.nodes.ValueNode;
 import org.graalvm.compiler.nodes.calc.ConditionalNode;
-import org.graalvm.compiler.nodes.calc.IntegerLessThanNode;
 import org.graalvm.compiler.nodes.calc.NegateNode;
 import org.graalvm.compiler.nodes.extended.GuardingNode;
 import org.graalvm.compiler.nodes.util.GraphUtil;
+import org.graalvm.compiler.nodes.util.IntegerHelper;
+import org.graalvm.compiler.nodes.util.SignedIntegerHelper;
+import org.graalvm.compiler.nodes.util.UnsignedIntegerHelper;
 
 import jdk.vm.ci.meta.DeoptimizationAction;
 import jdk.vm.ci.meta.DeoptimizationReason;
@@ -61,8 +62,9 @@
     private boolean oneOff;
     private AbstractBeginNode body;
     private IfNode ifNode;
+    private final boolean unsigned;
 
-    CountedLoopInfo(LoopEx loop, InductionVariable iv, IfNode ifNode, ValueNode end, boolean oneOff, AbstractBeginNode body) {
+    CountedLoopInfo(LoopEx loop, InductionVariable iv, IfNode ifNode, ValueNode end, boolean oneOff, AbstractBeginNode body, boolean unsigned) {
         assert iv.direction() != null;
         this.loop = loop;
         this.iv = iv;
@@ -70,6 +72,7 @@
         this.oneOff = oneOff;
         this.body = body;
         this.ifNode = ifNode;
+        this.unsigned = unsigned;
     }
 
     /**
@@ -85,6 +88,10 @@
         return maxTripCountNode(false);
     }
 
+    public boolean isUnsignedCheck() {
+        return this.unsigned;
+    }
+
     /**
      * Returns a node that computes the maximum trip count of this loop. That is the trip count of
      * this loop assuming it is not exited by an other exit than the {@linkplain #getLimitTest()
@@ -127,7 +134,10 @@
             return graph.addOrUniqueWithInputs(div);
         }
         ConstantNode zero = ConstantNode.forIntegerStamp(stamp, 0);
-        LogicNode noEntryCheck = IntegerLessThanNode.create(max, min, NodeView.DEFAULT);
+        // This check is "wide": it looks like min <= max
+        // That's OK even if the loop is strict (`!isLimitIncluded()`)
+        // because in this case, `div` will be zero when min == max
+        LogicNode noEntryCheck = getCounterIntegerHelper().createCompareNode(max, min, NodeView.DEFAULT);
         return graph.addOrUniqueWithInputs(ConditionalNode.create(noEntryCheck, zero, div, NodeView.DEFAULT));
     }
 
@@ -152,15 +162,16 @@
         long initValue = iv.constantInit();
         long range;
         long absStride;
+        IntegerHelper helper = getCounterIntegerHelper(64);
         if (iv.direction() == Direction.Up) {
-            if (endValue < initValue) {
+            if (helper.compare(endValue, initValue) < 0) {
                 return 0;
             }
             range = endValue - iv.constantInit();
             absStride = iv.constantStride();
         } else {
             assert iv.direction() == Direction.Down;
-            if (initValue < endValue) {
+            if (helper.compare(initValue, endValue) < 0) {
                 return 0;
             }
             range = iv.constantInit() - endValue;
@@ -173,6 +184,21 @@
         return Long.divideUnsigned(denominator, absStride);
     }
 
+    public IntegerHelper getCounterIntegerHelper() {
+        IntegerStamp stamp = (IntegerStamp) iv.valueNode().stamp(NodeView.DEFAULT);
+        return getCounterIntegerHelper(stamp.getBits());
+    }
+
+    public IntegerHelper getCounterIntegerHelper(int bits) {
+        IntegerHelper helper;
+        if (isUnsignedCheck()) {
+            helper = new UnsignedIntegerHelper(bits);
+        } else {
+            helper = new SignedIntegerHelper(bits);
+        }
+        return helper;
+    }
+
     public boolean isExactTripCount() {
         return loop.loop().getNaturalExits().size() == 1;
     }
@@ -246,12 +272,13 @@
         ValueNode strideNode = iv.strideNode();
         IntegerStamp strideStamp = (IntegerStamp) strideNode.stamp(NodeView.DEFAULT);
         GraphUtil.tryKillUnused(strideNode);
+        IntegerHelper integerHelper = getCounterIntegerHelper();
         if (getDirection() == Direction.Up) {
-            long max = NumUtil.maxValue(endStamp.getBits());
-            return endStamp.upperBound() <= max - (strideStamp.upperBound() - 1) - (oneOff ? 1 : 0);
+            long max = integerHelper.maxValue();
+            return integerHelper.compare(endStamp.upperBound(), max - (strideStamp.upperBound() - 1) - (oneOff ? 1 : 0)) <= 0;
         } else if (getDirection() == Direction.Down) {
-            long min = NumUtil.minValue(endStamp.getBits());
-            return min + (1 - strideStamp.lowerBound()) + (oneOff ? 1 : 0) <= endStamp.lowerBound();
+            long min = integerHelper.minValue();
+            return integerHelper.compare(min + (1 - strideStamp.lowerBound()) + (oneOff ? 1 : 0), endStamp.lowerBound()) <= 0;
         }
         return false;
     }
@@ -264,22 +291,23 @@
         }
         try (DebugCloseable position = loop.loopBegin().withNodeSourcePosition()) {
             IntegerStamp stamp = (IntegerStamp) iv.valueNode().stamp(NodeView.DEFAULT);
+            IntegerHelper integerHelper = getCounterIntegerHelper();
             StructuredGraph graph = iv.valueNode().graph();
             LogicNode cond; // we use a negated guard with a < condition to achieve a >=
             ConstantNode one = ConstantNode.forIntegerStamp(stamp, 1, graph);
             if (iv.direction() == Direction.Up) {
-                ValueNode v1 = sub(ConstantNode.forIntegerStamp(stamp, NumUtil.maxValue(stamp.getBits())), sub(iv.strideNode(), one));
+                ValueNode v1 = sub(ConstantNode.forIntegerStamp(stamp, integerHelper.maxValue()), sub(iv.strideNode(), one));
                 if (oneOff) {
                     v1 = sub(v1, one);
                 }
-                cond = graph.addOrUniqueWithInputs(IntegerLessThanNode.create(v1, end, NodeView.DEFAULT));
+                cond = graph.addOrUniqueWithInputs(integerHelper.createCompareNode(v1, end, NodeView.DEFAULT));
             } else {
                 assert iv.direction() == Direction.Down;
-                ValueNode v1 = add(ConstantNode.forIntegerStamp(stamp, NumUtil.minValue(stamp.getBits())), sub(one, iv.strideNode()));
+                ValueNode v1 = add(ConstantNode.forIntegerStamp(stamp, integerHelper.minValue()), sub(one, iv.strideNode()));
                 if (oneOff) {
                     v1 = add(v1, one);
                 }
-                cond = graph.addOrUniqueWithInputs(IntegerLessThanNode.create(end, v1, NodeView.DEFAULT));
+                cond = graph.addOrUniqueWithInputs(integerHelper.createCompareNode(end, v1, NodeView.DEFAULT));
             }
             assert graph.getGuardsStage().allowsFloatingGuards();
             overflowGuard = graph.unique(new GuardNode(cond, AbstractBeginNode.prevBegin(loop.entryPoint()), DeoptimizationReason.LoopLimitCheck, DeoptimizationAction.InvalidateRecompile, true,
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DefaultLoopPolicies.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DefaultLoopPolicies.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopEx.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopEx.java	Wed Sep 25 22:40:41 2019 +0200
@@ -61,9 +61,6 @@
 import org.graalvm.compiler.nodes.calc.AddNode;
 import org.graalvm.compiler.nodes.calc.BinaryArithmeticNode;
 import org.graalvm.compiler.nodes.calc.CompareNode;
-import org.graalvm.compiler.nodes.calc.IntegerBelowNode;
-import org.graalvm.compiler.nodes.calc.IntegerEqualsNode;
-import org.graalvm.compiler.nodes.calc.IntegerLessThanNode;
 import org.graalvm.compiler.nodes.calc.LeftShiftNode;
 import org.graalvm.compiler.nodes.calc.MulNode;
 import org.graalvm.compiler.nodes.calc.NegateNode;
@@ -211,6 +208,7 @@
         return count != 0;
     }
 
+    @SuppressWarnings("fallthrough")
     public boolean detectCounted() {
         if (countedLoopChecked) {
             return isCounted();
@@ -231,27 +229,24 @@
                 negated = true;
             }
             LogicNode ifTest = ifNode.condition();
-            if (!(ifTest instanceof IntegerLessThanNode) && !(ifTest instanceof IntegerEqualsNode)) {
-                if (ifTest instanceof IntegerBelowNode) {
-                    ifTest.getDebug().log("Ignored potential Counted loop at %s with |<|", loopBegin);
-                }
+            if (!(ifTest instanceof CompareNode)) {
                 return false;
             }
-            CompareNode lessThan = (CompareNode) ifTest;
+            CompareNode compare = (CompareNode) ifTest;
             Condition condition = null;
             InductionVariable iv = null;
             ValueNode limit = null;
-            if (isOutsideLoop(lessThan.getX())) {
-                iv = getInductionVariables().get(lessThan.getY());
+            if (isOutsideLoop(compare.getX())) {
+                iv = getInductionVariables().get(compare.getY());
                 if (iv != null) {
-                    condition = lessThan.condition().asCondition().mirror();
-                    limit = lessThan.getX();
+                    condition = compare.condition().asCondition().mirror();
+                    limit = compare.getX();
                 }
-            } else if (isOutsideLoop(lessThan.getY())) {
-                iv = getInductionVariables().get(lessThan.getX());
+            } else if (isOutsideLoop(compare.getY())) {
+                iv = getInductionVariables().get(compare.getX());
                 if (iv != null) {
-                    condition = lessThan.condition().asCondition();
-                    limit = lessThan.getY();
+                    condition = compare.condition().asCondition();
+                    limit = compare.getY();
                 }
             }
             if (condition == null) {
@@ -261,21 +256,34 @@
                 condition = condition.negate();
             }
             boolean oneOff = false;
+            boolean unsigned = false;
             switch (condition) {
                 case EQ:
-                    return false;
-                case NE: {
-                    if (!iv.isConstantStride() || Math.abs(iv.constantStride()) != 1) {
+                    if (iv.initNode() == limit) {
+                        // allow "single iteration" case
+                        oneOff = true;
+                    } else {
                         return false;
                     }
+                    break;
+                case NE: {
                     IntegerStamp initStamp = (IntegerStamp) iv.initNode().stamp(NodeView.DEFAULT);
                     IntegerStamp limitStamp = (IntegerStamp) limit.stamp(NodeView.DEFAULT);
+                    IntegerStamp counterStamp = (IntegerStamp) iv.valueNode().stamp(NodeView.DEFAULT);
                     if (iv.direction() == Direction.Up) {
-                        if (initStamp.upperBound() > limitStamp.lowerBound()) {
+                        if (limitStamp.asConstant() != null && limitStamp.asConstant().asLong() == counterStamp.upperBound()) {
+                            // signed: i < MAX_INT
+                        } else if (limitStamp.asConstant() != null && limitStamp.asConstant().asLong() == counterStamp.unsignedUpperBound()) {
+                            unsigned = true;
+                        } else if (!iv.isConstantStride() || Math.abs(iv.constantStride()) != 1 || initStamp.upperBound() > limitStamp.lowerBound()) {
                             return false;
                         }
                     } else if (iv.direction() == Direction.Down) {
-                        if (initStamp.lowerBound() < limitStamp.upperBound()) {
+                        if (limitStamp.asConstant() != null && limitStamp.asConstant().asLong() == counterStamp.lowerBound()) {
+                            // signed: MIN_INT > i
+                        } else if (limitStamp.asConstant() != null && limitStamp.asConstant().asLong() == counterStamp.unsignedLowerBound()) {
+                            unsigned = true;
+                        } else if (!iv.isConstantStride() || Math.abs(iv.constantStride()) != 1 || initStamp.lowerBound() < limitStamp.upperBound()) {
                             return false;
                         }
                     } else {
@@ -283,23 +291,31 @@
                     }
                     break;
                 }
+                case BE:
+                    unsigned = true; // fall through
                 case LE:
                     oneOff = true;
                     if (iv.direction() != Direction.Up) {
                         return false;
                     }
                     break;
+                case BT:
+                    unsigned = true; // fall through
                 case LT:
                     if (iv.direction() != Direction.Up) {
                         return false;
                     }
                     break;
+                case AE:
+                    unsigned = true; // fall through
                 case GE:
                     oneOff = true;
                     if (iv.direction() != Direction.Down) {
                         return false;
                     }
                     break;
+                case AT:
+                    unsigned = true; // fall through
                 case GT:
                     if (iv.direction() != Direction.Down) {
                         return false;
@@ -308,7 +324,7 @@
                 default:
                     throw GraalError.shouldNotReachHere(condition.toString());
             }
-            counted = new CountedLoopInfo(this, iv, ifNode, limit, oneOff, negated ? ifNode.falseSuccessor() : ifNode.trueSuccessor());
+            counted = new CountedLoopInfo(this, iv, ifNode, limit, oneOff, negated ? ifNode.falseSuccessor() : ifNode.trueSuccessor(), unsigned);
             return true;
         }
         return false;
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInside.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInside.java	Wed Sep 25 22:40:41 2019 +0200
@@ -71,8 +71,7 @@
 import org.graalvm.compiler.nodes.extended.OpaqueNode;
 import org.graalvm.compiler.nodes.memory.MemoryPhiNode;
 import org.graalvm.compiler.nodes.util.GraphUtil;
-
-import jdk.vm.ci.code.CodeUtil;
+import org.graalvm.compiler.nodes.util.IntegerHelper;
 
 public class LoopFragmentInside extends LoopFragment {
 
@@ -206,18 +205,19 @@
                 ValueNode limit = counted.getLimit();
                 int bits = ((IntegerStamp) limit.stamp(NodeView.DEFAULT)).getBits();
                 ValueNode newLimit = SubNode.create(limit, opaque, NodeView.DEFAULT);
+                IntegerHelper helper = counted.getCounterIntegerHelper();
                 LogicNode overflowCheck;
                 ConstantNode extremum;
                 if (counted.getDirection() == InductionVariable.Direction.Up) {
                     // limit - counterStride could overflow negatively if limit - min <
                     // counterStride
-                    extremum = ConstantNode.forIntegerBits(bits, CodeUtil.minValue(bits));
+                    extremum = ConstantNode.forIntegerBits(bits, helper.minValue());
                     overflowCheck = IntegerBelowNode.create(SubNode.create(limit, extremum, NodeView.DEFAULT), opaque, NodeView.DEFAULT);
                 } else {
                     assert counted.getDirection() == InductionVariable.Direction.Down;
                     // limit - counterStride could overflow if max - limit < -counterStride
                     // i.e., counterStride < limit - max
-                    extremum = ConstantNode.forIntegerBits(bits, CodeUtil.maxValue(bits));
+                    extremum = ConstantNode.forIntegerBits(bits, helper.maxValue());
                     overflowCheck = IntegerBelowNode.create(opaque, SubNode.create(limit, extremum, NodeView.DEFAULT), NodeView.DEFAULT);
                 }
                 newLimit = ConditionalNode.create(overflowCheck, extremum, newLimit, NodeView.DEFAULT);
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/ConditionalEliminationBenchmark.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/ConditionalEliminationBenchmark.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/GraalCompilerState.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/GraalCompilerState.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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,6 +45,7 @@
 import org.graalvm.compiler.core.LIRGenerationPhase.LIRGenerationContext;
 import org.graalvm.compiler.core.common.CompilationIdentifier;
 import org.graalvm.compiler.core.common.alloc.ComputeBlockOrder;
+import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig;
 import org.graalvm.compiler.core.common.cfg.AbstractBlockBase;
 import org.graalvm.compiler.core.gen.LIRCompilerBackend;
 import org.graalvm.compiler.core.gen.LIRGenerationProvider;
@@ -377,7 +378,8 @@
 
         LIR lir = new LIR(cfg, linearScanOrder, codeEmittingOrder, getGraphOptions(), getGraphDebug());
         LIRGenerationProvider lirBackend = (LIRGenerationProvider) request.backend;
-        lirGenRes = lirBackend.newLIRGenerationResult(graph.compilationId(), lir, registerConfig, request.graph, stub);
+        RegisterAllocationConfig registerAllocationConfig = request.backend.newRegisterAllocationConfig(registerConfig, null);
+        lirGenRes = lirBackend.newLIRGenerationResult(graph.compilationId(), lir, registerAllocationConfig, request.graph, stub);
         lirGenTool = lirBackend.newLIRGenerator(lirGenRes);
         nodeLirGen = lirBackend.newNodeLIRBuilder(request.graph, lirGenTool);
     }
@@ -441,7 +443,7 @@
     }
 
     protected AllocationContext createAllocationContext() {
-        return new AllocationContext(lirGenTool.getSpillMoveFactory(), request.backend.newRegisterAllocationConfig(registerConfig, null));
+        return new AllocationContext(lirGenTool.getSpillMoveFactory(), lirGenRes.getRegisterAllocationConfig());
     }
 
     /**
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IfNodeCanonicalizationTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IfNodeCanonicalizationTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopPhiCanonicalizerTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopPhiCanonicalizerTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/PrimitiveStampBoundaryTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/PrimitiveStampBoundaryTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ShortCircuitOrNodeTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ShortCircuitOrNodeTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractFixedGuardNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractFixedGuardNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CallTargetNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CallTargetNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ComputeObjectAddressNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ComputeObjectAddressNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSplitNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSplitNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,6 @@
 package org.graalvm.compiler.nodes;
 
 import org.graalvm.compiler.core.common.type.Stamp;
-import org.graalvm.compiler.graph.IterableNodeType;
 import org.graalvm.compiler.graph.NodeClass;
 import org.graalvm.compiler.nodeinfo.NodeInfo;
 
@@ -34,7 +33,7 @@
  * (ie. have more than one successor).
  */
 @NodeInfo
-public abstract class ControlSplitNode extends FixedNode implements IterableNodeType {
+public abstract class ControlSplitNode extends FixedNode {
     public static final NodeClass<ControlSplitNode> TYPE = NodeClass.create(ControlSplitNode.class);
 
     protected ControlSplitNode(NodeClass<? extends ControlSplitNode> c, Stamp stamp) {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedGuardNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedGuardNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FrameState.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FrameState.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphEncoder.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphEncoder.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IfNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IfNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -49,6 +49,7 @@
 import org.graalvm.compiler.debug.DebugCloseable;
 import org.graalvm.compiler.debug.DebugContext;
 import org.graalvm.compiler.debug.GraalError;
+import org.graalvm.compiler.graph.IterableNodeType;
 import org.graalvm.compiler.graph.Node;
 import org.graalvm.compiler.graph.NodeClass;
 import org.graalvm.compiler.graph.NodeSourcePosition;
@@ -61,11 +62,12 @@
 import org.graalvm.compiler.nodes.calc.AddNode;
 import org.graalvm.compiler.nodes.calc.CompareNode;
 import org.graalvm.compiler.nodes.calc.ConditionalNode;
+import org.graalvm.compiler.nodes.calc.FloatNormalizeCompareNode;
 import org.graalvm.compiler.nodes.calc.IntegerBelowNode;
 import org.graalvm.compiler.nodes.calc.IntegerEqualsNode;
 import org.graalvm.compiler.nodes.calc.IntegerLessThanNode;
+import org.graalvm.compiler.nodes.calc.IntegerNormalizeCompareNode;
 import org.graalvm.compiler.nodes.calc.IsNullNode;
-import org.graalvm.compiler.nodes.calc.NormalizeCompareNode;
 import org.graalvm.compiler.nodes.calc.ObjectEqualsNode;
 import org.graalvm.compiler.nodes.extended.UnboxNode;
 import org.graalvm.compiler.nodes.java.InstanceOfNode;
@@ -90,9 +92,12 @@
  * of a comparison.
  */
 @NodeInfo(cycles = CYCLES_1, size = SIZE_2, sizeRationale = "2 jmps")
-public final class IfNode extends ControlSplitNode implements Simplifiable, LIRLowerable, SwitchFoldable {
+public final class IfNode extends ControlSplitNode implements Simplifiable, LIRLowerable, IterableNodeType, SwitchFoldable {
     public static final NodeClass<IfNode> TYPE = NodeClass.create(IfNode.class);
 
+    private static final int MAX_USAGE_COLOR_SET_SIZE = 64;
+    private static final int MAX_FRAMESTATE_SEARCH_DEPTH = 4;
+
     private static final CounterKey CORRECTED_PROBABILITIES = DebugContext.counter("CorrectedProbabilities");
 
     @Successor AbstractBeginNode trueSuccessor;
@@ -346,7 +351,7 @@
         }
     }
 
-    private boolean isUnboxedFrom(MetaAccessProvider meta, NodeView view, ValueNode x, ValueNode src) {
+    private static boolean isUnboxedFrom(MetaAccessProvider meta, NodeView view, ValueNode x, ValueNode src) {
         if (x == src) {
             return true;
         } else if (x instanceof UnboxNode) {
@@ -1118,6 +1123,9 @@
                         return null;
                     }
                     boolean unsigned = cond1.isUnsigned() || cond2.isUnsigned();
+                    boolean floatingPoint = x.stamp(NodeView.from(tool)) instanceof FloatStamp;
+                    assert !floatingPoint || y.stamp(NodeView.from(tool)) instanceof FloatStamp;
+                    assert !(floatingPoint && unsigned);
 
                     long expected1 = expectedConstantForNormalize(cond1);
                     long expected2 = expectedConstantForNormalize(cond2);
@@ -1134,26 +1142,22 @@
                         // cannot be expressed by NormalizeCompareNode
                         return null;
                     }
-                    if (unsigned) {
-                        // for unsigned comparisons, we need to add MIN_VALUE (see
-                        // Long.compareUnsigned)
-                        ValueNode minValue = graph().unique(ConstantNode.forIntegerStamp(x.stamp,
-                                        x.stamp.getStackKind().getMinValue()));
-                        x = graph().unique(new AddNode(x, minValue));
-                        y = graph().unique(new AddNode(y, minValue));
+                    if (floatingPoint) {
+                        boolean unorderedLess = false;
+                        if (((FloatStamp) x.stamp).canBeNaN() || ((FloatStamp) y.stamp).canBeNaN()) {
+                            // we may encounter NaNs, check the unordered value
+                            // (following the original condition's "unorderedIsTrue" path)
+                            long unorderedValue = condition1.unorderedIsTrue() ? c1 : condition2.unorderedIsTrue() ? c2 : c3;
+                            if (unorderedValue == 0) {
+                                // returning "0" for unordered is not possible
+                                return null;
+                            }
+                            unorderedLess = unorderedValue == -1;
+                        }
+                        return graph().unique(new FloatNormalizeCompareNode(x, y, stackKind, unorderedLess));
+                    } else {
+                        return graph().unique(new IntegerNormalizeCompareNode(x, y, stackKind, unsigned));
                     }
-                    boolean unorderedLess = false;
-                    if (x.stamp instanceof FloatStamp && (((FloatStamp) x.stamp).canBeNaN() || ((FloatStamp) y.stamp).canBeNaN())) {
-                        // we may encounter NaNs, check the unordered value
-                        // (following the original condition's "unorderedIsTrue" path)
-                        long unorderedValue = condition1.unorderedIsTrue() ? c1 : condition2.unorderedIsTrue() ? c2 : c3;
-                        if (unorderedValue == 0) {
-                            // returning "0" for unordered is not possible
-                            return null;
-                        }
-                        unorderedLess = unorderedValue == -1;
-                    }
-                    return graph().unique(new NormalizeCompareNode(x, y, stackKind, unorderedLess));
                 }
             }
         }
@@ -1171,6 +1175,15 @@
         }
     }
 
+    public enum NodeColor {
+        NONE,
+        CONDITION_USAGE,
+        TRUE_BRANCH,
+        FALSE_BRANCH,
+        PHI_MIXED,
+        MIXED
+    }
+
     /**
      * Take an if that is immediately dominated by a merge with a single phi and split off any paths
      * where the test would be statically decidable creating a new merge below the appropriate side
@@ -1189,28 +1202,73 @@
             return false;
         }
         if (merge.getUsageCount() != 1 || merge.phis().count() != 1) {
+            // Don't trigger with multiple phis. Would require more rewiring.
+            // Most of the time the additional phis are memory phis that are removed after
+            // fixed read phase.
             return false;
         }
         if (graph().getGuardsStage().areFrameStatesAtSideEffects() && merge.stateAfter() == null) {
             return false;
         }
-        PhiNode phi = merge.phis().first();
-        if (phi.getUsageCount() != 1) {
-            /*
-             * For simplicity the below code assumes assumes the phi goes dead at the end so skip
-             * this case.
-             */
+
+        PhiNode generalPhi = merge.phis().first();
+        if (!(generalPhi instanceof ValuePhiNode)) {
             return false;
         }
 
+        ValuePhiNode phi = (ValuePhiNode) generalPhi;
+
+        EconomicMap<Node, NodeColor> coloredNodes = EconomicMap.create(Equivalence.IDENTITY, 8);
+
         /*
          * Check that the condition uses the phi and that there is only one user of the condition
          * expression.
          */
-        if (!conditionUses(condition(), phi)) {
+        if (!conditionUses(condition(), phi, coloredNodes)) {
+            return false;
+        }
+
+        if (!mayRemoveSplit(merge)) {
             return false;
         }
 
+        LogicNode[] results = new LogicNode[merge.forwardEndCount()];
+        boolean success = false;
+        for (int i = 0; i < results.length; ++i) {
+            ValueNode value = phi.valueAt(i);
+            LogicNode curResult = computeCondition(tool, condition, phi, value);
+            if (curResult != condition) {
+                for (Node n : curResult.inputs()) {
+                    if (n instanceof ConstantNode || n instanceof ParameterNode || n instanceof FixedNode) {
+                        // Constant inputs or parameters or fixed nodes are OK.
+                    } else if (n == value) {
+                        // References to the value itself are also OK.
+                    } else {
+                        // Input may cause scheduling issues.
+                        curResult = condition;
+                        break;
+                    }
+                }
+                success = true;
+            }
+            results[i] = curResult;
+        }
+
+        if (!success) {
+            return false;
+        }
+
+        for (Node usage : phi.usages()) {
+            if (usage == merge.stateAfter()) {
+                // This usage can be ignored, because it is directly in the state after.
+            } else {
+                NodeColor color = colorUsage(coloredNodes, usage, merge, this.trueSuccessor(), this.falseSuccessor());
+                if (color == NodeColor.MIXED) {
+                    return false;
+                }
+            }
+        }
+
         /*
          * We could additionally filter for the case that at least some of the Phi inputs or one of
          * the condition inputs are constants but there are cases where a non-constant is
@@ -1220,23 +1278,27 @@
         /* Each successor of the if gets a new merge if needed. */
         MergeNode trueMerge = null;
         MergeNode falseMerge = null;
-
+        int i = 0;
         for (EndNode end : merge.forwardEnds().snapshot()) {
-            Node value = phi.valueAt(end);
-            LogicNode result = computeCondition(tool, condition, phi, value);
+            ValueNode value = phi.valueAt(end);
+            LogicNode result = results[i++];
             if (result instanceof LogicConstantNode) {
-                merge.removeEnd(end);
                 if (((LogicConstantNode) result).getValue()) {
                     if (trueMerge == null) {
-                        trueMerge = insertMerge(trueSuccessor(), merge.stateAfter());
+                        trueMerge = insertMerge(trueSuccessor(), phi, merge.stateAfter(), tool);
+                        replaceNodesInBranch(coloredNodes, NodeColor.TRUE_BRANCH, phi, trueMerge.phis().first());
                     }
+                    trueMerge.phis().first().addInput(value);
                     trueMerge.addForwardEnd(end);
                 } else {
                     if (falseMerge == null) {
-                        falseMerge = insertMerge(falseSuccessor(), merge.stateAfter());
+                        falseMerge = insertMerge(falseSuccessor(), phi, merge.stateAfter(), tool);
+                        replaceNodesInBranch(coloredNodes, NodeColor.FALSE_BRANCH, phi, falseMerge.phis().first());
                     }
+                    falseMerge.phis().first().addInput(value);
                     falseMerge.addForwardEnd(end);
                 }
+                merge.removeEnd(end);
             } else if (result != condition) {
                 // Build a new IfNode using the new condition
                 BeginNode trueBegin = graph().add(new BeginNode());
@@ -1250,28 +1312,29 @@
                 }
                 IfNode newIfNode = graph().add(new IfNode(result, trueBegin, falseBegin, trueSuccessorProbability));
                 newIfNode.setNodeSourcePosition(getNodeSourcePosition());
-                merge.removeEnd(end);
-                ((FixedWithNextNode) end.predecessor()).setNext(newIfNode);
 
                 if (trueMerge == null) {
-                    trueMerge = insertMerge(trueSuccessor(), merge.stateAfter());
+                    trueMerge = insertMerge(trueSuccessor(), phi, merge.stateAfter(), tool);
+                    replaceNodesInBranch(coloredNodes, NodeColor.TRUE_BRANCH, phi, trueMerge.phis().first());
                 }
+                trueMerge.phis().first().addInput(value);
                 trueBegin.setNext(graph().add(new EndNode()));
                 trueMerge.addForwardEnd((EndNode) trueBegin.next());
 
                 if (falseMerge == null) {
-                    falseMerge = insertMerge(falseSuccessor(), merge.stateAfter());
+                    falseMerge = insertMerge(falseSuccessor(), phi, merge.stateAfter(), tool);
+                    replaceNodesInBranch(coloredNodes, NodeColor.FALSE_BRANCH, phi, falseMerge.phis().first());
                 }
+                falseMerge.phis().first().addInput(value);
                 falseBegin.setNext(graph().add(new EndNode()));
                 falseMerge.addForwardEnd((EndNode) falseBegin.next());
 
+                merge.removeEnd(end);
+                ((FixedWithNextNode) end.predecessor()).setNext(newIfNode);
                 end.safeDelete();
             }
         }
 
-        transferProxies(trueSuccessor(), trueMerge);
-        transferProxies(falseSuccessor(), falseMerge);
-
         cleanupMerge(merge);
         cleanupMerge(trueMerge);
         cleanupMerge(falseMerge);
@@ -1279,14 +1342,122 @@
         return true;
     }
 
+    private static void replaceNodesInBranch(EconomicMap<Node, NodeColor> coloredNodes, NodeColor branch, ValuePhiNode phi, ValueNode newValue) {
+        for (Node n : phi.usages().snapshot()) {
+            if (coloredNodes.get(n) == branch) {
+                n.replaceAllInputs(phi, newValue);
+            } else if (coloredNodes.get(n) == NodeColor.PHI_MIXED) {
+                assert n instanceof PhiNode;
+                PhiNode phiNode = (PhiNode) n;
+                AbstractMergeNode merge = phiNode.merge();
+                for (int i = 0; i < merge.forwardEndCount(); ++i) {
+                    if (phiNode.valueAt(i) == phi && coloredNodes.get(merge.forwardEndAt(i)) == branch) {
+                        phiNode.setValueAt(i, newValue);
+                    }
+                }
+            }
+        }
+    }
+
+    private NodeColor colorUsage(EconomicMap<Node, NodeColor> coloredNodes, Node node, MergeNode merge, AbstractBeginNode trueSucc, AbstractBeginNode falseSucc) {
+        NodeColor color = coloredNodes.get(node);
+        if (color == null) {
+
+            if (coloredNodes.size() >= MAX_USAGE_COLOR_SET_SIZE) {
+                return NodeColor.MIXED;
+            }
+
+            coloredNodes.put(node, NodeColor.MIXED);
+
+            if (node == merge) {
+                color = NodeColor.MIXED;
+            } else if (node == trueSucc) {
+                color = NodeColor.TRUE_BRANCH;
+            } else if (node == falseSucc) {
+                color = NodeColor.FALSE_BRANCH;
+            } else {
+                if (node instanceof AbstractMergeNode) {
+                    AbstractMergeNode mergeNode = (AbstractMergeNode) node;
+                    NodeColor combinedColor = null;
+                    for (int i = 0; i < mergeNode.forwardEndCount(); ++i) {
+                        NodeColor curColor = colorUsage(coloredNodes, mergeNode.forwardEndAt(i), merge, trueSucc, falseSucc);
+                        if (combinedColor == null) {
+                            combinedColor = curColor;
+                        } else if (combinedColor != curColor) {
+                            combinedColor = NodeColor.MIXED;
+                            break;
+                        }
+                    }
+                    color = combinedColor;
+                } else if (node instanceof StartNode) {
+                    color = NodeColor.MIXED;
+                } else if (node instanceof FixedNode) {
+                    FixedNode fixedNode = (FixedNode) node;
+                    Node predecessor = fixedNode.predecessor();
+                    assert predecessor != null : fixedNode;
+                    color = colorUsage(coloredNodes, predecessor, merge, trueSucc, falseSucc);
+                } else if (node instanceof PhiNode) {
+                    PhiNode phiNode = (PhiNode) node;
+                    AbstractMergeNode phiMerge = phiNode.merge();
+
+                    if (phiMerge instanceof LoopBeginNode) {
+                        color = colorUsage(coloredNodes, phiMerge, merge, trueSucc, falseSucc);
+                    } else {
+
+                        for (int i = 0; i < phiMerge.forwardEndCount(); ++i) {
+                            NodeColor curColor = colorUsage(coloredNodes, phiMerge.forwardEndAt(i), merge, trueSucc, falseSucc);
+                            if (curColor != NodeColor.TRUE_BRANCH && curColor != NodeColor.FALSE_BRANCH) {
+                                color = NodeColor.MIXED;
+                                break;
+                            }
+                        }
+
+                        if (color == null) {
+                            // Each of the inputs to the phi are either coming unambigously from
+                            // true or false branch.
+                            color = NodeColor.PHI_MIXED;
+                            assert node instanceof PhiNode;
+                        }
+                    }
+                } else {
+                    NodeColor combinedColor = null;
+                    for (Node n : node.usages()) {
+                        if (n != node) {
+                            NodeColor curColor = colorUsage(coloredNodes, n, merge, trueSucc, falseSucc);
+                            if (combinedColor == null) {
+                                combinedColor = curColor;
+                            } else if (combinedColor != curColor) {
+                                combinedColor = NodeColor.MIXED;
+                                break;
+                            }
+                        }
+                    }
+                    if (combinedColor == NodeColor.PHI_MIXED) {
+                        combinedColor = NodeColor.MIXED;
+                    }
+                    if (combinedColor == null) {
+                        // Floating node without usages => association unclear.
+                        combinedColor = NodeColor.MIXED;
+                    }
+                    color = combinedColor;
+                }
+            }
+
+            assert color != null : node;
+            coloredNodes.put(node, color);
+        }
+        return color;
+    }
+
     /**
      * @param condition
      * @param phi
+     * @param coloredNodes
      * @return true if the passed in {@code condition} uses {@code phi} and the condition is only
      *         used once. Since the phi will go dead the condition using it will also have to be
      *         dead after the optimization.
      */
-    private static boolean conditionUses(LogicNode condition, PhiNode phi) {
+    private static boolean conditionUses(LogicNode condition, PhiNode phi, EconomicMap<Node, NodeColor> coloredNodes) {
         if (!condition.hasExactlyOneUsage()) {
             return false;
         }
@@ -1299,14 +1470,20 @@
                  * condition.
                  */
                 ShortCircuitOrNode orNode = (ShortCircuitOrNode) condition;
-                return (conditionUses(orNode.x, phi) || conditionUses(orNode.y, phi));
+                return (conditionUses(orNode.x, phi, coloredNodes) || conditionUses(orNode.y, phi, coloredNodes));
             }
         } else if (condition instanceof Canonicalizable.Unary<?>) {
             Canonicalizable.Unary<?> unary = (Canonicalizable.Unary<?>) condition;
-            return unary.getValue() == phi;
+            if (unary.getValue() == phi) {
+                coloredNodes.put(condition, NodeColor.CONDITION_USAGE);
+                return true;
+            }
         } else if (condition instanceof Canonicalizable.Binary<?>) {
             Canonicalizable.Binary<?> binary = (Canonicalizable.Binary<?>) condition;
-            return binary.getX() == phi || binary.getY() == phi;
+            if (binary.getX() == phi || binary.getY() == phi) {
+                coloredNodes.put(condition, NodeColor.CONDITION_USAGE);
+                return true;
+            }
         }
         return false;
     }
@@ -1343,10 +1520,8 @@
             }
         } else if (condition instanceof Canonicalizable.Binary<?>) {
             Canonicalizable.Binary<Node> compare = (Canonicalizable.Binary<Node>) condition;
-            if (compare.getX() == phi) {
-                return (LogicNode) compare.canonical(tool, value, compare.getY());
-            } else if (compare.getY() == phi) {
-                return (LogicNode) compare.canonical(tool, compare.getX(), value);
+            if (compare.getX() == phi || compare.getY() == phi) {
+                return (LogicNode) compare.canonical(tool, compare.getX() == phi ? value : compare.getX(), compare.getY() == phi ? value : compare.getY());
             }
         } else if (condition instanceof Canonicalizable.Unary<?>) {
             Canonicalizable.Unary<Node> compare = (Canonicalizable.Unary<Node>) condition;
@@ -1360,15 +1535,6 @@
         return condition;
     }
 
-    private static void transferProxies(AbstractBeginNode successor, MergeNode falseMerge) {
-        if (successor instanceof LoopExitNode && falseMerge != null) {
-            LoopExitNode loopExitNode = (LoopExitNode) successor;
-            for (ProxyNode proxy : loopExitNode.proxies().snapshot()) {
-                proxy.replaceFirstInput(successor, falseMerge);
-            }
-        }
-    }
-
     private void cleanupMerge(MergeNode merge) {
         if (merge != null && merge.isAlive()) {
             if (merge.forwardEndCount() == 0) {
@@ -1380,30 +1546,31 @@
     }
 
     @SuppressWarnings("try")
-    private MergeNode insertMerge(AbstractBeginNode begin, FrameState stateAfter) {
+    private MergeNode insertMerge(AbstractBeginNode begin, ValuePhiNode oldPhi, FrameState stateAfter, SimplifierTool tool) {
         MergeNode merge = graph().add(new MergeNode());
-        if (!begin.anchored().isEmpty()) {
-            Object before = begin.anchored().snapshot();
-            begin.replaceAtUsages(InputType.Guard, merge);
-            begin.replaceAtUsages(InputType.Anchor, merge);
-            assert begin.anchored().isEmpty() : before + " " + begin.anchored().snapshot();
+
+        AbstractBeginNode newBegin;
+        try (DebugCloseable position = begin.withNodeSourcePosition()) {
+            newBegin = graph().add(new BeginNode());
+            begin.replaceAtPredecessor(newBegin);
+            newBegin.setNext(begin);
         }
 
-        AbstractBeginNode theBegin = begin;
-        if (begin instanceof LoopExitNode) {
-            // Insert an extra begin to make it easier.
-            try (DebugCloseable position = begin.withNodeSourcePosition()) {
-                theBegin = graph().add(new BeginNode());
-                begin.replaceAtPredecessor(theBegin);
-                theBegin.setNext(begin);
-            }
+        FixedNode next = newBegin.next();
+        next.replaceAtPredecessor(merge);
+        newBegin.setNext(graph().add(new EndNode()));
+        merge.addForwardEnd((EndNode) newBegin.next());
+
+        ValuePhiNode phi = begin.graph().addOrUnique(new ValuePhiNode(oldPhi.stamp(NodeView.DEFAULT), merge));
+        phi.addInput(oldPhi);
+
+        if (stateAfter != null) {
+            FrameState newState = stateAfter.duplicate();
+            newState.replaceAllInputs(oldPhi, phi);
+            merge.setStateAfter(newState);
         }
-        FixedNode next = theBegin.next();
-        next.replaceAtPredecessor(merge);
-        theBegin.setNext(graph().add(new EndNode()));
-        merge.addForwardEnd((EndNode) theBegin.next());
-        merge.setStateAfter(stateAfter);
         merge.setNext(next);
+        tool.addToWorkList(begin);
         return merge;
     }
 
@@ -1481,14 +1648,49 @@
         // Ensure phi is used by at most the comparison and the merge's frame state (if any)
         ValuePhiNode phi = (ValuePhiNode) singleUsage;
         NodeIterable<Node> phiUsages = phi.usages();
-        if (phiUsages.count() > 2) {
+        for (Node usage : phiUsages) {
+            if (usage == compare) {
+                continue;
+            }
+            if (usage == merge.stateAfter()) {
+                continue;
+            }
+            // Checkstyle: stop
+            // @formatter:off
+            //
+            // We also want to allow the usage to be on the loop-proxy if one of the branches is a
+            // loop exit.
+            //
+            // This pattern:
+            //
+            //      if------->cond
+            //     /  \
+            // begin  begin
+            //   |      |
+            //  end    end        C1 V2
+            //     \  /            \ /
+            //     merge---------->phi<------    C1
+            //       |              ^        \  /
+            //       if-------------|-------->==
+            //      /  \            |
+            //     A    B<--------Proxy
+            //
+            // Must be simplified to:
+            //
+            //       if---------------------->cond
+            //      /  \
+            //     A    B<--------Proxy------>V2
+            //
+            // @formatter:on
+            // Checkstyle: resume
+            if (usage instanceof ValueProxyNode) {
+                ValueProxyNode proxy = (ValueProxyNode) usage;
+                if (proxy.proxyPoint() == trueSuccessor || proxy.proxyPoint() == falseSuccessor) {
+                    continue;
+                }
+            }
             return false;
         }
-        for (Node usage : phiUsages) {
-            if (usage != compare && usage != merge.stateAfter()) {
-                return false;
-            }
-        }
 
         List<EndNode> mergePredecessors = merge.cfgPredecessors().snapshot();
         assert phi.valueCount() == merge.forwardEndCount();
@@ -1499,8 +1701,7 @@
             return false;
         }
 
-        // Sanity check that both ends are not followed by a merge without frame state.
-        if (!checkFrameState(trueSuccessor()) && !checkFrameState(falseSuccessor())) {
+        if (!mayRemoveSplit(merge)) {
             return false;
         }
 
@@ -1527,8 +1728,8 @@
         assert !ends.hasNext();
         assert falseEnds.size() + trueEnds.size() == xs.length;
 
-        connectEnds(falseEnds, phiValues, oldFalseSuccessor, merge, tool);
-        connectEnds(trueEnds, phiValues, oldTrueSuccessor, merge, tool);
+        connectEnds(falseEnds, phi, phiValues, oldFalseSuccessor, merge, tool);
+        connectEnds(trueEnds, phi, phiValues, oldTrueSuccessor, merge, tool);
 
         if (this.trueSuccessorProbability == 0.0) {
             for (AbstractEndNode endNode : trueEnds) {
@@ -1562,7 +1763,16 @@
         return true;
     }
 
-    private void propagateZeroProbability(FixedNode startNode) {
+    private boolean mayRemoveSplit(AbstractMergeNode merge) {
+
+        if (merge.stateAfter() != null && (!checkFrameState(trueSuccessor, MAX_FRAMESTATE_SEARCH_DEPTH) || !checkFrameState(trueSuccessor, MAX_FRAMESTATE_SEARCH_DEPTH))) {
+            return false;
+        }
+
+        return true;
+    }
+
+    private static void propagateZeroProbability(FixedNode startNode) {
         Node prev = null;
         for (FixedNode node : GraphUtil.predecessorIterable(startNode)) {
             if (node instanceof IfNode) {
@@ -1598,7 +1808,14 @@
         }
     }
 
-    private static boolean checkFrameState(FixedNode start) {
+    /**
+     * Snippet lowerings may produce patterns without a frame state on the merge. We need to take
+     * extra care when optimizing these patterns.
+     */
+    private static boolean checkFrameState(FixedNode start, int maxDepth) {
+        if (maxDepth == 0) {
+            return false;
+        }
         FixedNode node = start;
         while (true) {
             if (node instanceof AbstractMergeNode) {
@@ -1618,7 +1835,7 @@
             if (node instanceof ControlSplitNode) {
                 ControlSplitNode controlSplitNode = (ControlSplitNode) node;
                 for (Node succ : controlSplitNode.cfgSuccessors()) {
-                    if (checkFrameState((FixedNode) succ)) {
+                    if (checkFrameState((FixedNode) succ, maxDepth - 1)) {
                         return true;
                     }
                 }
@@ -1632,6 +1849,7 @@
             } else if (node instanceof ControlSinkNode) {
                 return true;
             } else {
+                assert false : "unexpected node";
                 return false;
             }
         }
@@ -1642,13 +1860,27 @@
      * end. If {@code ends} is not empty, then {@code successor} is added to {@code tool}'s
      * {@linkplain SimplifierTool#addToWorkList(org.graalvm.compiler.graph.Node) work list}.
      *
+     * @param phi the original single-usage phi of the preceding merge
+     * @param phiValues the values of the phi at the merge, keyed by the merge ends
      * @param oldMerge the merge being removed
-     * @param phiValues the values of the phi at the merge, keyed by the merge ends
      */
-    private void connectEnds(List<EndNode> ends, EconomicMap<AbstractEndNode, ValueNode> phiValues, AbstractBeginNode successor, AbstractMergeNode oldMerge, SimplifierTool tool) {
+    private void connectEnds(List<EndNode> ends, ValuePhiNode phi, EconomicMap<AbstractEndNode, ValueNode> phiValues, AbstractBeginNode successor, AbstractMergeNode oldMerge, SimplifierTool tool) {
         if (!ends.isEmpty()) {
+            // If there was a value proxy usage, then the proxy needs a new value.
+            ValueProxyNode valueProxy = null;
+            if (successor instanceof LoopExitNode) {
+                for (Node usage : phi.usages()) {
+                    if (usage instanceof ValueProxyNode && ((ValueProxyNode) usage).proxyPoint() == successor) {
+                        valueProxy = (ValueProxyNode) usage;
+                    }
+                }
+            }
+            final ValueProxyNode proxy = valueProxy;
             if (ends.size() == 1) {
                 AbstractEndNode end = ends.get(0);
+                if (proxy != null) {
+                    phi.replaceAtUsages(phiValues.get(end), n -> n == proxy);
+                }
                 ((FixedWithNextNode) end.predecessor()).setNext(successor);
                 oldMerge.removeEnd(end);
                 GraphUtil.killCFG(end);
@@ -1660,6 +1892,10 @@
                 PhiNode oldPhi = (PhiNode) oldMerge.usages().first();
                 PhiNode newPhi = graph().addWithoutUnique(new ValuePhiNode(oldPhi.stamp(view), newMerge));
 
+                if (proxy != null) {
+                    phi.replaceAtUsages(newPhi, n -> n == proxy);
+                }
+
                 for (EndNode end : ends) {
                     newPhi.addInput(phiValues.get(end));
                     newMerge.addForwardEnd(end);
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/Invoke.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/Invoke.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeWithExceptionNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeWithExceptionNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -34,6 +34,7 @@
 
 import org.graalvm.compiler.core.common.type.Stamp;
 import org.graalvm.compiler.debug.DebugCloseable;
+import org.graalvm.compiler.graph.IterableNodeType;
 import org.graalvm.compiler.graph.Node;
 import org.graalvm.compiler.graph.NodeClass;
 import org.graalvm.compiler.nodeinfo.NodeInfo;
@@ -50,7 +51,7 @@
 import jdk.vm.ci.code.BytecodeFrame;
 
 @NodeInfo(nameTemplate = "Invoke!#{p#targetMethod/s}", allowedUsageTypes = {Memory}, cycles = CYCLES_UNKNOWN, size = SIZE_UNKNOWN)
-public final class InvokeWithExceptionNode extends ControlSplitNode implements Invoke, MemoryCheckpoint.Single, LIRLowerable, UncheckedInterfaceProvider {
+public final class InvokeWithExceptionNode extends ControlSplitNode implements Invoke, IterableNodeType, MemoryCheckpoint.Single, LIRLowerable, UncheckedInterfaceProvider {
     public static final NodeClass<InvokeWithExceptionNode> TYPE = NodeClass.create(InvokeWithExceptionNode.class);
 
     private static final double EXCEPTION_PROBA = 1e-5;
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopBeginNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopBeginNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopExitNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopExitNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -33,7 +33,6 @@
 import org.graalvm.compiler.core.common.type.StampFactory;
 import org.graalvm.compiler.core.common.type.TypeReference;
 import org.graalvm.compiler.debug.DebugContext;
-import org.graalvm.compiler.graph.IterableNodeType;
 import org.graalvm.compiler.graph.Node;
 import org.graalvm.compiler.graph.NodeClass;
 import org.graalvm.compiler.graph.spi.Canonicalizable;
@@ -65,7 +64,7 @@
  * also the scheduling restriction enforced by the guard, will go away.
  */
 @NodeInfo(cycles = CYCLES_0, size = SIZE_0)
-public class PiNode extends FloatingGuardedNode implements LIRLowerable, Virtualizable, IterableNodeType, Canonicalizable, ValueProxy {
+public class PiNode extends FloatingGuardedNode implements LIRLowerable, Virtualizable, Canonicalizable, ValueProxy {
 
     public static final NodeClass<PiNode> TYPE = NodeClass.create(PiNode.class);
     @Input ValueNode object;
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SimplifyingGraphDecoder.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SimplifyingGraphDecoder.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StructuredGraph.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StructuredGraph.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -38,6 +38,7 @@
 import jdk.vm.ci.meta.Constant;
 import jdk.vm.ci.meta.JavaConstant;
 import jdk.vm.ci.meta.JavaKind;
+import jdk.vm.ci.meta.SerializableConstant;
 
 /**
  * This class represents a value within the graph, including local variables, phis, and all other
@@ -166,6 +167,19 @@
         }
     }
 
+    public final boolean isSerializableConstant() {
+        return isConstant() && asConstant() instanceof SerializableConstant;
+    }
+
+    public final SerializableConstant asSerializableConstant() {
+        Constant value = asConstant();
+        if (value instanceof SerializableConstant) {
+            return (SerializableConstant) value;
+        } else {
+            return null;
+        }
+    }
+
     @Override
     public ValueNode asNode() {
         return this;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AbstractNormalizeCompareNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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 org.graalvm.compiler.nodes.calc;
+
+import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_2;
+
+import org.graalvm.compiler.core.common.calc.CanonicalCondition;
+import org.graalvm.compiler.core.common.type.Stamp;
+import org.graalvm.compiler.core.common.type.StampFactory;
+import org.graalvm.compiler.graph.IterableNodeType;
+import org.graalvm.compiler.graph.NodeClass;
+import org.graalvm.compiler.nodeinfo.NodeCycles;
+import org.graalvm.compiler.nodeinfo.NodeInfo;
+import org.graalvm.compiler.nodes.ConstantNode;
+import org.graalvm.compiler.nodes.LogicConstantNode;
+import org.graalvm.compiler.nodes.LogicNode;
+import org.graalvm.compiler.nodes.NodeView;
+import org.graalvm.compiler.nodes.ValueNode;
+import org.graalvm.compiler.options.OptionValues;
+
+import jdk.vm.ci.meta.ConstantReflectionProvider;
+import jdk.vm.ci.meta.JavaKind;
+import jdk.vm.ci.meta.MetaAccessProvider;
+
+/**
+ * Returns -1, 0, or 1 if either x &lt; y, x == y, or x &gt; y.
+ */
+@NodeInfo(cycles = NodeCycles.CYCLES_2, size = SIZE_2)
+public abstract class AbstractNormalizeCompareNode extends BinaryNode implements IterableNodeType {
+    public static final NodeClass<AbstractNormalizeCompareNode> TYPE = NodeClass.create(AbstractNormalizeCompareNode.class);
+
+    public AbstractNormalizeCompareNode(NodeClass<? extends BinaryNode> c, JavaKind kind, ValueNode x, ValueNode y) {
+        super(c, StampFactory.forInteger(kind, -1, 1), x, y);
+    }
+
+    @Override
+    public boolean inferStamp() {
+        return false;
+    }
+
+    @Override
+    public Stamp foldStamp(Stamp stampX, Stamp stampY) {
+        return stamp(NodeView.DEFAULT);
+    }
+
+    protected static ValueNode tryConstantFold(ValueNode x, ValueNode y, boolean isUnorderedLess, boolean unsigned, JavaKind kind, ConstantReflectionProvider constantReflection) {
+        LogicNode result = CompareNode.tryConstantFold(CanonicalCondition.EQ, x, y, null, false);
+        if (result instanceof LogicConstantNode) {
+            LogicConstantNode logicConstantNode = (LogicConstantNode) result;
+            LogicNode resultLT = CompareNode.tryConstantFold(unsigned ? CanonicalCondition.BT : CanonicalCondition.LT, x, y, constantReflection, isUnorderedLess);
+            if (resultLT instanceof LogicConstantNode) {
+                LogicConstantNode logicConstantNodeLT = (LogicConstantNode) resultLT;
+                if (logicConstantNodeLT.getValue()) {
+                    return ConstantNode.forIntegerKind(kind, -1);
+                } else if (logicConstantNode.getValue()) {
+                    return ConstantNode.forIntegerKind(kind, 0);
+                } else {
+                    return ConstantNode.forIntegerKind(kind, 1);
+                }
+            }
+        }
+        return null;
+    }
+
+    public abstract LogicNode createEqualComparison();
+
+    public abstract LogicNode createEqualComparison(ConstantReflectionProvider constantReflection, MetaAccessProvider metaAccess, OptionValues options, Integer smallestCompareWidth, NodeView view);
+
+    public LogicNode createLowerComparison() {
+        return createLowerComparison(false);
+    }
+
+    public LogicNode createLowerComparison(ConstantReflectionProvider constantReflection, MetaAccessProvider metaAccess, OptionValues options, Integer smallestCompareWidth, NodeView view) {
+        return createLowerComparison(false, constantReflection, metaAccess, options, smallestCompareWidth, view);
+    }
+
+    public abstract LogicNode createLowerComparison(boolean swapInputs);
+
+    public abstract LogicNode createLowerComparison(boolean swapInputs, ConstantReflectionProvider constantReflection, MetaAccessProvider metaAccess, OptionValues options,
+                    Integer smallestCompareWidth, NodeView view);
+}
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/CompareNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/CompareNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -184,17 +184,25 @@
                     realCondition = realCondition.mirror();
                 }
                 return optimizeConditional(constant, (ConditionalNode) nonConstant, constantReflection, realCondition, unorderedIsTrue);
-            } else if (nonConstant instanceof NormalizeCompareNode) {
-                return optimizeNormalizeCompare(constantReflection, metaAccess, options, smallestCompareWidth, constant, (NormalizeCompareNode) nonConstant, mirrored, view);
+            } else if (nonConstant instanceof AbstractNormalizeCompareNode) {
+                return optimizeNormalizeCompare(constantReflection, metaAccess, options, smallestCompareWidth, constant, (AbstractNormalizeCompareNode) nonConstant, mirrored, view);
             } else if (nonConstant instanceof ConvertNode) {
                 ConvertNode convert = (ConvertNode) nonConstant;
                 boolean multiUsage = (convert.asNode().hasMoreThanOneUsage() && convert.getValue().hasExactlyOneUsage());
-                if ((convert instanceof ZeroExtendNode || convert instanceof SignExtendNode) && multiUsage) {
-                    // Do not perform for zero or sign extend if it could introduce
+                if (convert instanceof IntegerConvertNode && multiUsage) {
+                    // Do not perform for integer convers if it could introduce
                     // new live values.
                     return null;
                 }
 
+                if (convert instanceof NarrowNode) {
+                    NarrowNode narrowNode = (NarrowNode) convert;
+                    if (narrowNode.getInputBits() > 32 && !constant.isDefaultForKind()) {
+                        // Avoid large integer constants.
+                        return null;
+                    }
+                }
+
                 boolean supported = true;
                 if (convert.getValue().stamp(view) instanceof IntegerStamp) {
                     IntegerStamp intStamp = (IntegerStamp) convert.getValue().stamp(view);
@@ -233,7 +241,7 @@
 
         @SuppressWarnings("unused")
         protected LogicNode optimizeNormalizeCompare(ConstantReflectionProvider constantReflection, MetaAccessProvider metaAccess, OptionValues options, Integer smallestCompareWidth,
-                        Constant constant, NormalizeCompareNode normalizeNode, boolean mirrored, NodeView view) {
+                        Constant constant, AbstractNormalizeCompareNode normalizeNode, boolean mirrored, NodeView view) {
             throw new PermanentBailoutException("NormalizeCompareNode connected to %s (%s %s %s)", this, constant, normalizeNode, mirrored);
         }
 
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConditionalNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConditionalNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -214,8 +214,7 @@
                     // (value & 1) == 0 ? 0 : 1
                     // (value & 1) == 1 ? 1 : 0
                     IntegerTestNode integerTestNode = (IntegerTestNode) condition;
-                    if (integerTestNode.getY().isConstant()) {
-                        assert integerTestNode.getX().stamp(view) instanceof IntegerStamp;
+                    if (integerTestNode.getY().isConstant() && integerTestNode.getX().stamp(view) instanceof IntegerStamp) {
                         long testY = integerTestNode.getY().asJavaConstant().asLong();
                         if (testY == 1 && constTrueValue == 0 && constFalseValue == 1) {
                             return IntegerConvertNode.convertUnsigned(AndNode.create(integerTestNode.getX(), integerTestNode.getY(), view), stamp, view);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatNormalizeCompareNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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 org.graalvm.compiler.nodes.calc;
+
+import org.graalvm.compiler.graph.NodeClass;
+import org.graalvm.compiler.graph.spi.CanonicalizerTool;
+import org.graalvm.compiler.nodeinfo.NodeInfo;
+import org.graalvm.compiler.nodes.LogicNode;
+import org.graalvm.compiler.nodes.NodeView;
+import org.graalvm.compiler.nodes.ValueNode;
+import org.graalvm.compiler.options.OptionValues;
+
+import jdk.vm.ci.meta.ConstantReflectionProvider;
+import jdk.vm.ci.meta.JavaKind;
+import jdk.vm.ci.meta.MetaAccessProvider;
+
+/**
+ * If the comparison is undecided (one of the inputs is NaN), the result is 1 if isUnorderedLess is
+ * false and -1 if isUnorderedLess is true.
+ */
+@NodeInfo
+public final class FloatNormalizeCompareNode extends AbstractNormalizeCompareNode {
+    public static final NodeClass<FloatNormalizeCompareNode> TYPE = NodeClass.create(FloatNormalizeCompareNode.class);
+    protected final boolean isUnorderedLess;
+
+    public FloatNormalizeCompareNode(ValueNode x, ValueNode y, JavaKind kind, boolean isUnorderedLess) {
+        super(TYPE, kind, x, y);
+        this.isUnorderedLess = isUnorderedLess;
+    }
+
+    public static ValueNode create(ValueNode x, ValueNode y, boolean isUnorderedLess, JavaKind kind, ConstantReflectionProvider constantReflection) {
+        ValueNode result = tryConstantFold(x, y, isUnorderedLess, false, kind, constantReflection);
+        if (result != null) {
+            return result;
+        }
+
+        return new FloatNormalizeCompareNode(x, y, kind, isUnorderedLess);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {
+        NodeView view = NodeView.from(tool);
+        ValueNode result = tryConstantFold(x, y, isUnorderedLess, false, stamp(view).getStackKind(), tool.getConstantReflection());
+        if (result != null) {
+            return result;
+        }
+        return this;
+    }
+
+    public boolean isUnorderedLess() {
+        return isUnorderedLess;
+    }
+
+    @Override
+    public LogicNode createEqualComparison() {
+        return FloatEqualsNode.create(x, y, NodeView.DEFAULT);
+    }
+
+    @Override
+    public LogicNode createEqualComparison(ConstantReflectionProvider constantReflection, MetaAccessProvider metaAccess, OptionValues options, Integer smallestCompareWidth, NodeView view) {
+        return FloatEqualsNode.create(constantReflection, metaAccess, options, smallestCompareWidth, x, y, NodeView.DEFAULT);
+    }
+
+    @Override
+    public LogicNode createLowerComparison(boolean swapInputs) {
+        ValueNode a = swapInputs ? y : x;
+        ValueNode b = swapInputs ? x : y;
+        return FloatLessThanNode.create(a, b, isUnorderedLess() ^ swapInputs, NodeView.DEFAULT);
+    }
+
+    @Override
+    public LogicNode createLowerComparison(boolean swapInputs, ConstantReflectionProvider constantReflection, MetaAccessProvider metaAccess, OptionValues options, Integer smallestCompareWidth,
+                    NodeView view) {
+        ValueNode a = swapInputs ? y : x;
+        ValueNode b = swapInputs ? x : y;
+        return FloatLessThanNode.create(constantReflection, metaAccess, options, smallestCompareWidth, a, b, isUnorderedLess() ^ swapInputs, NodeView.DEFAULT);
+    }
+}
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerConvertNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerConvertNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -69,7 +69,7 @@
         this.getReverseOp = getReverseOp;
         this.inputBits = inputBits;
         this.resultBits = resultBits;
-        assert ((PrimitiveStamp) input.stamp(NodeView.DEFAULT)).getBits() == inputBits;
+        assert PrimitiveStamp.getBits(input.stamp(NodeView.DEFAULT)) == 0 || PrimitiveStamp.getBits(input.stamp(NodeView.DEFAULT)) == inputBits;
     }
 
     public int getInputBits() {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerDivRemNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerDivRemNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -29,6 +29,7 @@
 
 import org.graalvm.compiler.core.common.type.IntegerStamp;
 import org.graalvm.compiler.core.common.type.Stamp;
+import org.graalvm.compiler.graph.IterableNodeType;
 import org.graalvm.compiler.graph.NodeClass;
 import org.graalvm.compiler.nodeinfo.InputType;
 import org.graalvm.compiler.nodeinfo.NodeInfo;
@@ -39,7 +40,7 @@
 import org.graalvm.compiler.nodes.spi.LoweringTool;
 
 @NodeInfo(cycles = CYCLES_32, size = SIZE_1)
-public abstract class IntegerDivRemNode extends FixedBinaryNode implements Lowerable {
+public abstract class IntegerDivRemNode extends FixedBinaryNode implements Lowerable, IterableNodeType {
 
     public static final NodeClass<IntegerDivRemNode> TYPE = NodeClass.create(IntegerDivRemNode.class);
 
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerEqualsNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerEqualsNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -109,30 +109,15 @@
     public static class IntegerEqualsOp extends CompareOp {
         @Override
         protected LogicNode optimizeNormalizeCompare(ConstantReflectionProvider constantReflection, MetaAccessProvider metaAccess, OptionValues options, Integer smallestCompareWidth,
-                        Constant constant, NormalizeCompareNode normalizeNode, boolean mirrored, NodeView view) {
+                        Constant constant, AbstractNormalizeCompareNode normalizeNode, boolean mirrored, NodeView view) {
             PrimitiveConstant primitive = (PrimitiveConstant) constant;
-            ValueNode a = normalizeNode.getX();
-            ValueNode b = normalizeNode.getY();
             long cst = primitive.asLong();
-
             if (cst == 0) {
-                if (normalizeNode.getX().getStackKind() == JavaKind.Double || normalizeNode.getX().getStackKind() == JavaKind.Float) {
-                    return FloatEqualsNode.create(constantReflection, metaAccess, options, smallestCompareWidth, a, b, view);
-                } else {
-                    return IntegerEqualsNode.create(constantReflection, metaAccess, options, smallestCompareWidth, a, b, view);
-                }
+                return normalizeNode.createEqualComparison(constantReflection, metaAccess, options, smallestCompareWidth, view);
             } else if (cst == 1) {
-                if (normalizeNode.getX().getStackKind() == JavaKind.Double || normalizeNode.getX().getStackKind() == JavaKind.Float) {
-                    return FloatLessThanNode.create(b, a, !normalizeNode.isUnorderedLess, view);
-                } else {
-                    return IntegerLessThanNode.create(constantReflection, metaAccess, options, smallestCompareWidth, b, a, view);
-                }
+                return normalizeNode.createLowerComparison(true, constantReflection, metaAccess, options, smallestCompareWidth, view);
             } else if (cst == -1) {
-                if (normalizeNode.getX().getStackKind() == JavaKind.Double || normalizeNode.getX().getStackKind() == JavaKind.Float) {
-                    return FloatLessThanNode.create(a, b, normalizeNode.isUnorderedLess, view);
-                } else {
-                    return IntegerLessThanNode.create(constantReflection, metaAccess, options, smallestCompareWidth, a, b, view);
-                }
+                return normalizeNode.createLowerComparison(false, constantReflection, metaAccess, options, smallestCompareWidth, view);
             } else {
                 return LogicConstantNode.contradiction();
             }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerLessThanNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerLessThanNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -114,7 +114,7 @@
 
         @Override
         protected LogicNode optimizeNormalizeCompare(ConstantReflectionProvider constantReflection, MetaAccessProvider metaAccess, OptionValues options, Integer smallestCompareWidth,
-                        Constant constant, NormalizeCompareNode normalizeNode, boolean mirrored, NodeView view) {
+                        Constant constant, AbstractNormalizeCompareNode normalizeNode, boolean mirrored, NodeView view) {
             PrimitiveConstant primitive = (PrimitiveConstant) constant;
             /* @formatter:off
              * a NC b < c  (not mirrored)
@@ -136,25 +136,14 @@
              *  We can handle mirroring by swapping a & b and negating the constant.
              *  @formatter:on
              */
-            ValueNode a = mirrored ? normalizeNode.getY() : normalizeNode.getX();
-            ValueNode b = mirrored ? normalizeNode.getX() : normalizeNode.getY();
             long cst = mirrored ? -primitive.asLong() : primitive.asLong();
 
             if (cst == 0) {
-                if (normalizeNode.getX().getStackKind() == JavaKind.Double || normalizeNode.getX().getStackKind() == JavaKind.Float) {
-                    return FloatLessThanNode.create(constantReflection, metaAccess, options, smallestCompareWidth, a, b, mirrored ^ normalizeNode.isUnorderedLess, view);
-                } else {
-                    return IntegerLessThanNode.create(constantReflection, metaAccess, options, smallestCompareWidth, a, b, view);
-                }
+                return normalizeNode.createLowerComparison(mirrored, constantReflection, metaAccess, options, smallestCompareWidth, view);
             } else if (cst == 1) {
                 // a <= b <=> !(a > b)
-                LogicNode compare;
-                if (normalizeNode.getX().getStackKind() == JavaKind.Double || normalizeNode.getX().getStackKind() == JavaKind.Float) {
-                    // since we negate, we have to reverse the unordered result
-                    compare = FloatLessThanNode.create(constantReflection, metaAccess, options, smallestCompareWidth, b, a, mirrored == normalizeNode.isUnorderedLess, view);
-                } else {
-                    compare = IntegerLessThanNode.create(constantReflection, metaAccess, options, smallestCompareWidth, b, a, view);
-                }
+                // since we negate, we have to reverse the unordered result
+                LogicNode compare = normalizeNode.createLowerComparison(!mirrored, constantReflection, metaAccess, options, smallestCompareWidth, view);
                 return LogicNegationNode.create(compare);
             } else if (cst <= -1) {
                 return LogicConstantNode.contradiction();
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerLowerThanNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerLowerThanNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerNormalizeCompareNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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 org.graalvm.compiler.nodes.calc;
+
+import org.graalvm.compiler.graph.NodeClass;
+import org.graalvm.compiler.graph.spi.CanonicalizerTool;
+import org.graalvm.compiler.nodeinfo.NodeInfo;
+import org.graalvm.compiler.nodes.LogicNode;
+import org.graalvm.compiler.nodes.NodeView;
+import org.graalvm.compiler.nodes.ValueNode;
+import org.graalvm.compiler.options.OptionValues;
+
+import jdk.vm.ci.meta.ConstantReflectionProvider;
+import jdk.vm.ci.meta.JavaKind;
+import jdk.vm.ci.meta.MetaAccessProvider;
+
+@NodeInfo
+public final class IntegerNormalizeCompareNode extends AbstractNormalizeCompareNode {
+    public static final NodeClass<IntegerNormalizeCompareNode> TYPE = NodeClass.create(IntegerNormalizeCompareNode.class);
+    protected final boolean unsigned;
+
+    public IntegerNormalizeCompareNode(ValueNode x, ValueNode y, JavaKind kind, boolean unsigned) {
+        super(TYPE, kind, x, y);
+        this.unsigned = unsigned;
+    }
+
+    public static ValueNode create(ValueNode x, ValueNode y, boolean unsigned, JavaKind kind, ConstantReflectionProvider constantReflection) {
+        ValueNode result = tryConstantFold(x, y, false, unsigned, kind, constantReflection);
+        if (result != null) {
+            return result;
+        }
+
+        return new IntegerNormalizeCompareNode(x, y, kind, unsigned);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {
+        NodeView view = NodeView.from(tool);
+        ValueNode result = tryConstantFold(x, y, false, unsigned, stamp(view).getStackKind(), tool.getConstantReflection());
+        if (result != null) {
+            return result;
+        }
+        return this;
+    }
+
+    @Override
+    public LogicNode createLowerComparison(boolean swapInputs) {
+        ValueNode a = swapInputs ? y : x;
+        ValueNode b = swapInputs ? x : y;
+        if (unsigned) {
+            return IntegerBelowNode.create(a, b, NodeView.DEFAULT);
+        } else {
+            return IntegerLessThanNode.create(a, b, NodeView.DEFAULT);
+        }
+    }
+
+    @Override
+    public LogicNode createLowerComparison(boolean swapInputs, ConstantReflectionProvider constantReflection, MetaAccessProvider metaAccess, OptionValues options, Integer smallestCompareWidth,
+                    NodeView view) {
+        ValueNode a = swapInputs ? y : x;
+        ValueNode b = swapInputs ? x : y;
+        if (unsigned) {
+            return IntegerBelowNode.create(constantReflection, metaAccess, options, smallestCompareWidth, a, b, NodeView.DEFAULT);
+        } else {
+            return IntegerLessThanNode.create(constantReflection, metaAccess, options, smallestCompareWidth, a, b, NodeView.DEFAULT);
+        }
+    }
+
+    @Override
+    public LogicNode createEqualComparison() {
+        return IntegerEqualsNode.create(x, y, NodeView.DEFAULT);
+    }
+
+    @Override
+    public LogicNode createEqualComparison(ConstantReflectionProvider constantReflection, MetaAccessProvider metaAccess, OptionValues options, Integer smallestCompareWidth, NodeView view) {
+        return IntegerEqualsNode.create(constantReflection, metaAccess, options, smallestCompareWidth, x, y, view);
+    }
+}
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerTestNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerTestNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -27,6 +27,8 @@
 import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2;
 import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_2;
 
+import java.nio.ByteBuffer;
+
 import org.graalvm.compiler.core.common.type.IntegerStamp;
 import org.graalvm.compiler.core.common.type.Stamp;
 import org.graalvm.compiler.graph.NodeClass;
@@ -35,6 +37,7 @@
 import org.graalvm.compiler.nodeinfo.NodeInfo;
 import org.graalvm.compiler.nodes.BinaryOpLogicNode;
 import org.graalvm.compiler.nodes.LogicConstantNode;
+import org.graalvm.compiler.nodes.LogicNode;
 import org.graalvm.compiler.nodes.NodeView;
 import org.graalvm.compiler.nodes.ValueNode;
 
@@ -53,11 +56,27 @@
         super(TYPE, x, y);
     }
 
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {
-        NodeView view = NodeView.from(tool);
+    public static LogicNode create(ValueNode x, ValueNode y, NodeView view) {
+        LogicNode value = canonical(x, y, view);
+        if (value != null) {
+            return value;
+        }
+        return new IntegerTestNode(x, y);
+    }
+
+    private static LogicNode canonical(ValueNode forX, ValueNode forY, NodeView view) {
         if (forX.isConstant() && forY.isConstant()) {
-            return LogicConstantNode.forBoolean((forX.asJavaConstant().asLong() & forY.asJavaConstant().asLong()) == 0);
+            if (forX.isJavaConstant() && forY.isJavaConstant()) {
+                return LogicConstantNode.forBoolean((forX.asJavaConstant().asLong() & forY.asJavaConstant().asLong()) == 0);
+            }
+            if (forX.isSerializableConstant() && forY.isSerializableConstant()) {
+                int bufSize = Math.min(forX.asSerializableConstant().getSerializedSize(), forX.asSerializableConstant().getSerializedSize());
+                ByteBuffer xBuf = ByteBuffer.allocate(bufSize);
+                ByteBuffer yBuf = ByteBuffer.allocate(bufSize);
+                forX.asSerializableConstant().serialize(xBuf);
+                forY.asSerializableConstant().serialize(yBuf);
+                return serializableToConst(xBuf, yBuf, bufSize);
+            }
         }
         if (forX.stamp(view) instanceof IntegerStamp && forY.stamp(view) instanceof IntegerStamp) {
             IntegerStamp xStamp = (IntegerStamp) forX.stamp(view);
@@ -68,7 +87,22 @@
                 return LogicConstantNode.contradiction();
             }
         }
-        return this;
+        return null;
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {
+        ValueNode value = canonical(forX, forY, NodeView.from(tool));
+        return value != null ? value : this;
+    }
+
+    private static LogicNode serializableToConst(ByteBuffer xBuf, ByteBuffer yBuf, int bufSize) {
+        for (int i = 0; i < bufSize; i++) {
+            if ((xBuf.get(i) & yBuf.get(i)) != 0) {
+                return LogicConstantNode.contradiction();
+            }
+        }
+        return LogicConstantNode.tautology();
     }
 
     @Override
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IsNullNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IsNullNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -26,12 +26,14 @@
 
 import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_1;
 
+import org.graalvm.compiler.core.common.calc.CanonicalCondition;
 import org.graalvm.compiler.core.common.type.ArithmeticOpTable;
 import org.graalvm.compiler.core.common.type.ArithmeticOpTable.IntegerConvertOp;
 import org.graalvm.compiler.core.common.type.ArithmeticOpTable.IntegerConvertOp.Narrow;
 import org.graalvm.compiler.core.common.type.ArithmeticOpTable.IntegerConvertOp.SignExtend;
 import org.graalvm.compiler.core.common.type.IntegerStamp;
 import org.graalvm.compiler.core.common.type.PrimitiveStamp;
+import org.graalvm.compiler.core.common.type.Stamp;
 import org.graalvm.compiler.graph.NodeClass;
 import org.graalvm.compiler.graph.spi.CanonicalizerTool;
 import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool;
@@ -75,10 +77,33 @@
 
     @Override
     public boolean isLossless() {
+        return checkLossless(this.getResultBits());
+    }
+
+    private boolean checkLossless(int bits) {
+        Stamp valueStamp = this.getValue().stamp(NodeView.DEFAULT);
+        if (bits > 0 && valueStamp instanceof IntegerStamp) {
+            IntegerStamp integerStamp = (IntegerStamp) valueStamp;
+            long valueUpMask = integerStamp.upMask();
+            if ((valueUpMask & CodeUtil.mask(bits)) == valueUpMask) {
+                return true;
+            }
+        }
         return false;
     }
 
     @Override
+    public boolean preservesOrder(CanonicalCondition cond) {
+        switch (cond) {
+            case LT:
+                // Must guarantee that also sign bit does not flip.
+                return checkLossless(this.getResultBits() - 1);
+            default:
+                return checkLossless(this.getResultBits());
+        }
+    }
+
+    @Override
     public ValueNode canonical(CanonicalizerTool tool, ValueNode forValue) {
         NodeView view = NodeView.from(tool);
         ValueNode ret = super.canonical(tool, forValue);
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NormalizeCompareNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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 org.graalvm.compiler.nodes.calc;
-
-import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_2;
-
-import org.graalvm.compiler.core.common.calc.CanonicalCondition;
-import org.graalvm.compiler.core.common.type.Stamp;
-import org.graalvm.compiler.core.common.type.StampFactory;
-import org.graalvm.compiler.graph.IterableNodeType;
-import org.graalvm.compiler.graph.NodeClass;
-import org.graalvm.compiler.graph.spi.CanonicalizerTool;
-import org.graalvm.compiler.nodeinfo.NodeCycles;
-import org.graalvm.compiler.nodeinfo.NodeInfo;
-import org.graalvm.compiler.nodes.ConstantNode;
-import org.graalvm.compiler.nodes.LogicConstantNode;
-import org.graalvm.compiler.nodes.LogicNode;
-import org.graalvm.compiler.nodes.NodeView;
-import org.graalvm.compiler.nodes.ValueNode;
-
-import jdk.vm.ci.meta.ConstantReflectionProvider;
-import jdk.vm.ci.meta.JavaKind;
-
-/**
- * Returns -1, 0, or 1 if either x &lt; y, x == y, or x &gt; y. If the comparison is undecided (one
- * of the inputs is NaN), the result is 1 if isUnorderedLess is false and -1 if isUnorderedLess is
- * true.
- */
-@NodeInfo(cycles = NodeCycles.CYCLES_2, size = SIZE_2)
-public final class NormalizeCompareNode extends BinaryNode implements IterableNodeType {
-
-    public static final NodeClass<NormalizeCompareNode> TYPE = NodeClass.create(NormalizeCompareNode.class);
-    protected final boolean isUnorderedLess;
-
-    public NormalizeCompareNode(ValueNode x, ValueNode y, JavaKind kind, boolean isUnorderedLess) {
-        super(TYPE, StampFactory.forInteger(kind, -1, 1), x, y);
-        this.isUnorderedLess = isUnorderedLess;
-    }
-
-    public static ValueNode create(ValueNode x, ValueNode y, boolean isUnorderedLess, JavaKind kind, ConstantReflectionProvider constantReflection) {
-        ValueNode result = tryConstantFold(x, y, isUnorderedLess, kind, constantReflection);
-        if (result != null) {
-            return result;
-        }
-
-        return new NormalizeCompareNode(x, y, kind, isUnorderedLess);
-    }
-
-    protected static ValueNode tryConstantFold(ValueNode x, ValueNode y, boolean isUnorderedLess, JavaKind kind, ConstantReflectionProvider constantReflection) {
-        LogicNode result = CompareNode.tryConstantFold(CanonicalCondition.EQ, x, y, null, false);
-        if (result instanceof LogicConstantNode) {
-            LogicConstantNode logicConstantNode = (LogicConstantNode) result;
-            LogicNode resultLT = CompareNode.tryConstantFold(CanonicalCondition.LT, x, y, constantReflection, isUnorderedLess);
-            if (resultLT instanceof LogicConstantNode) {
-                LogicConstantNode logicConstantNodeLT = (LogicConstantNode) resultLT;
-                if (logicConstantNodeLT.getValue()) {
-                    return ConstantNode.forIntegerKind(kind, -1);
-                } else if (logicConstantNode.getValue()) {
-                    return ConstantNode.forIntegerKind(kind, 0);
-                } else {
-                    return ConstantNode.forIntegerKind(kind, 1);
-                }
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {
-        NodeView view = NodeView.from(tool);
-        ValueNode result = tryConstantFold(x, y, isUnorderedLess, stamp(view).getStackKind(), tool.getConstantReflection());
-        if (result != null) {
-            return result;
-        }
-        return this;
-    }
-
-    @Override
-    public boolean inferStamp() {
-        return false;
-    }
-
-    @Override
-    public Stamp foldStamp(Stamp stampX, Stamp stampY) {
-        return stamp(NodeView.DEFAULT);
-    }
-
-    public boolean isUnorderedLess() {
-        return isUnorderedLess;
-    }
-}
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/PointerEqualsNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/PointerEqualsNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ReinterpretNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ReinterpretNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/Block.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/Block.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/ControlFlowGraph.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/ControlFlowGraph.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ArrayRangeWrite.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ArrayRangeWrite.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BranchProbabilityNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BranchProbabilityNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -74,6 +74,8 @@
     public static final double VERY_FAST_PATH_PROBABILITY = 0.999;
     public static final double VERY_SLOW_PATH_PROBABILITY = 1 - VERY_FAST_PATH_PROBABILITY;
 
+    public static final double DEOPT_PROBABILITY = 0.0;
+
     /*
      * This probability may seem excessive, but it makes a difference in long running loops. Lets
      * say a loop is executed 100k times and it has a few null checks with probability 0.999. As
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ForeignCallNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ForeignCallNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedUnsafeLoadNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedUnsafeLoadNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/IntegerSwitchNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/IntegerSwitchNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaWriteNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaWriteNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadHubNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadHubNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
 import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2;
 import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_1;
 
+import org.graalvm.compiler.core.common.type.AbstractPointerStamp;
 import org.graalvm.compiler.core.common.type.ObjectStamp;
 import org.graalvm.compiler.core.common.type.Stamp;
 import org.graalvm.compiler.core.common.type.TypeReference;
@@ -62,13 +63,17 @@
         return value;
     }
 
-    private static Stamp hubStamp(StampProvider stampProvider, ValueNode value) {
+    private static AbstractPointerStamp hubStamp(StampProvider stampProvider, ValueNode value) {
         assert value.stamp(NodeView.DEFAULT) instanceof ObjectStamp;
         return stampProvider.createHubStamp(((ObjectStamp) value.stamp(NodeView.DEFAULT)));
     }
 
     public static ValueNode create(ValueNode value, StampProvider stampProvider, MetaAccessProvider metaAccess, ConstantReflectionProvider constantReflection) {
-        Stamp stamp = hubStamp(stampProvider, value);
+        final AbstractPointerStamp stamp = hubStamp(stampProvider, value);
+        return create(value, stamp, metaAccess, constantReflection);
+    }
+
+    public static ValueNode create(ValueNode value, AbstractPointerStamp stamp, MetaAccessProvider metaAccess, ConstantReflectionProvider constantReflection) {
         ValueNode synonym = findSynonym(value, stamp, metaAccess, constantReflection);
         if (synonym != null) {
             return synonym;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadHubOrNullNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,129 @@
+/*
+ * 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
+ * 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 org.graalvm.compiler.nodes.extended;
+
+import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC;
+import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2;
+import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_1;
+
+import org.graalvm.compiler.core.common.type.AbstractPointerStamp;
+import org.graalvm.compiler.core.common.type.ObjectStamp;
+import org.graalvm.compiler.core.common.type.Stamp;
+import org.graalvm.compiler.core.common.type.TypeReference;
+import org.graalvm.compiler.graph.NodeClass;
+import org.graalvm.compiler.graph.spi.Canonicalizable;
+import org.graalvm.compiler.graph.spi.CanonicalizerTool;
+import org.graalvm.compiler.nodeinfo.NodeInfo;
+import org.graalvm.compiler.nodes.ConstantNode;
+import org.graalvm.compiler.nodes.NodeView;
+import org.graalvm.compiler.nodes.ValueNode;
+import org.graalvm.compiler.nodes.calc.FloatingNode;
+import org.graalvm.compiler.nodes.spi.Lowerable;
+import org.graalvm.compiler.nodes.spi.LoweringTool;
+import org.graalvm.compiler.nodes.spi.StampProvider;
+import org.graalvm.compiler.nodes.spi.Virtualizable;
+import org.graalvm.compiler.nodes.spi.VirtualizerTool;
+import org.graalvm.compiler.nodes.type.StampTool;
+
+import jdk.vm.ci.meta.ConstantReflectionProvider;
+import jdk.vm.ci.meta.MetaAccessProvider;
+
+/**
+ * Loads an object's hub, or null if the object is null.
+ */
+@NodeInfo(cycles = CYCLES_2, size = SIZE_1)
+public final class LoadHubOrNullNode extends FloatingNode implements Lowerable, Canonicalizable, Virtualizable {
+
+    public static final NodeClass<LoadHubOrNullNode> TYPE = NodeClass.create(LoadHubOrNullNode.class);
+    @Input ValueNode value;
+
+    public ValueNode getValue() {
+        return value;
+    }
+
+    private static AbstractPointerStamp hubStamp(StampProvider stampProvider, ValueNode value) {
+        assert value.stamp(NodeView.DEFAULT) instanceof ObjectStamp;
+        return stampProvider.createHubStamp(((ObjectStamp) value.stamp(NodeView.DEFAULT))).asMaybeNull();
+    }
+
+    public static ValueNode create(ValueNode value, StampProvider stampProvider, MetaAccessProvider metaAccess, ConstantReflectionProvider constantReflection) {
+        AbstractPointerStamp stamp = hubStamp(stampProvider, value);
+        return create(value, stamp, metaAccess, constantReflection);
+    }
+
+    public static ValueNode create(ValueNode value, AbstractPointerStamp stamp, MetaAccessProvider metaAccess, ConstantReflectionProvider constantReflection) {
+        ValueNode synonym = findSynonym(value, stamp, metaAccess, constantReflection);
+        if (synonym != null) {
+            return synonym;
+        }
+        return new LoadHubOrNullNode(stamp, value);
+    }
+
+    public LoadHubOrNullNode(@InjectedNodeParameter StampProvider stampProvider, ValueNode value) {
+        this(hubStamp(stampProvider, value), value);
+    }
+
+    public LoadHubOrNullNode(Stamp stamp, ValueNode value) {
+        super(TYPE, stamp);
+        this.value = value;
+    }
+
+    @Override
+    public void lower(LoweringTool tool) {
+        tool.getLowerer().lower(this, tool);
+    }
+
+    @Override
+    public ValueNode canonical(CanonicalizerTool tool) {
+        if (!GeneratePIC.getValue(tool.getOptions())) {
+            NodeView view = NodeView.from(tool);
+            MetaAccessProvider metaAccess = tool.getMetaAccess();
+            ValueNode curValue = getValue();
+            ValueNode newNode = findSynonym(curValue, (AbstractPointerStamp) stamp(view), metaAccess, tool.getConstantReflection());
+            if (newNode != null) {
+                return newNode;
+            }
+        }
+        return this;
+    }
+
+    public static ValueNode findSynonym(ValueNode curValue, AbstractPointerStamp stamp, MetaAccessProvider metaAccess, ConstantReflectionProvider constantReflection) {
+        if (StampTool.isPointerNonNull(stamp)) {
+            return LoadHubNode.create(curValue, stamp.asNonNull(), metaAccess, constantReflection);
+        }
+        return null;
+    }
+
+    @Override
+    public void virtualize(VirtualizerTool tool) {
+        if (!GeneratePIC.getValue(tool.getOptions())) {
+            ValueNode alias = tool.getAlias(getValue());
+            TypeReference type = StampTool.typeReferenceOrNull(alias);
+            if (type != null && type.isExact()) {
+                tool.replaceWithValue(ConstantNode.forConstant(stamp(NodeView.DEFAULT), tool.getConstantReflection().asObjectHub(type.getType()), tool.getMetaAccess(), graph()));
+            }
+        }
+    }
+}
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MultiGuardNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MultiGuardNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -32,6 +32,8 @@
 import org.graalvm.compiler.graph.Node;
 import org.graalvm.compiler.graph.NodeClass;
 import org.graalvm.compiler.graph.NodeInputList;
+import org.graalvm.compiler.graph.spi.Canonicalizable;
+import org.graalvm.compiler.graph.spi.CanonicalizerTool;
 import org.graalvm.compiler.graph.spi.Simplifiable;
 import org.graalvm.compiler.graph.spi.SimplifierTool;
 import org.graalvm.compiler.nodeinfo.NodeInfo;
@@ -43,7 +45,7 @@
 import org.graalvm.compiler.nodes.util.GraphUtil;
 
 @NodeInfo(allowedUsageTypes = Guard, cycles = CYCLES_0, size = SIZE_0)
-public final class MultiGuardNode extends FloatingNode implements GuardingNode, LIRLowerable, Simplifiable, Node.ValueNumberable {
+public final class MultiGuardNode extends FloatingNode implements GuardingNode, LIRLowerable, Simplifiable, Canonicalizable, Node.ValueNumberable {
     public static final NodeClass<MultiGuardNode> TYPE = NodeClass.create(MultiGuardNode.class);
 
     @OptionalInput(Guard) NodeInputList<ValueNode> guards;
@@ -58,6 +60,20 @@
     }
 
     @Override
+    public Node canonical(CanonicalizerTool tool) {
+        // Make sure there are no nulls remaining in the set of guards references.
+        guards.trim();
+        if (guards.size() == 0) {
+            // No guards left => can delete the multi-guard.
+            return null;
+        } else if (guards.size() == 1) {
+            // Only a single guard left => replace multi-guard with that single guard.
+            return guards.get(0);
+        }
+        return this;
+    }
+
+    @Override
     public void simplify(SimplifierTool tool) {
         if (usages().filter(node -> node instanceof ValueAnchorNode).isNotEmpty()) {
             /*
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/SwitchNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/SwitchNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GeneratedInvocationPlugin.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GeneratedInvocationPlugin.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -109,4 +109,8 @@
             throw new GraalError(e);
         }
     }
+
+    public final boolean isGeneratedFromFoldOrNodeIntrinsic() {
+        return getSource().equals(Fold.class) || getSource().equals(NodeIntrinsic.class);
+    }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderConfiguration.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderConfiguration.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderContext.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderContext.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -258,6 +258,13 @@
     }
 
     /**
+     * Determines if a graph builder plugin is enabled under current context.
+     */
+    default boolean isPluginEnabled(GraphBuilderPlugin plugin) {
+        return parsingIntrinsic() || !(plugin instanceof GeneratedInvocationPlugin && ((GeneratedInvocationPlugin) plugin).isGeneratedFromFoldOrNodeIntrinsic());
+    }
+
+    /**
      * Gets the intrinsic of the current parsing context or {@code null} if not
      * {@link #parsingIntrinsic() parsing an intrinsic}.
      */
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderTool.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderTool.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InlineInvokePlugin.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InlineInvokePlugin.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/IntrinsicContext.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/IntrinsicContext.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugins.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugins.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -702,8 +702,10 @@
                 }
                 if (res != null) {
                     // A decorator plugin is trusted since it does not replace
-                    // the method it intrinsifies.
-                    if (res.isDecorator() || canBeIntrinsified(declaringClass)) {
+                    // the method it intrinsifies. A GeneratedInvocationPlugin
+                    // is trusted since it only exists for @NodeIntrinsics and
+                    // @Fold annotated methods (i.e., trusted Graal code).
+                    if (res.isDecorator() || res instanceof GeneratedInvocationPlugin || canBeIntrinsified(declaringClass)) {
                         return res;
                     }
                 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/MethodSubstitutionPlugin.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/MethodSubstitutionPlugin.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewObjectNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewObjectNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ArrayLengthNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ArrayLengthNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadIndexedNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadIndexedNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorExitNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorExitNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewArrayNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewArrayNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewInstanceNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewInstanceNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreFieldNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreFieldNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreIndexedNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreIndexedNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/TypeSwitchNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/TypeSwitchNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractWriteNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractWriteNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FixedAccessNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FixedAccessNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -25,7 +25,6 @@
 package org.graalvm.compiler.nodes.memory;
 
 import org.graalvm.compiler.core.common.type.Stamp;
-import org.graalvm.compiler.graph.IterableNodeType;
 import org.graalvm.compiler.graph.NodeClass;
 import org.graalvm.compiler.nodeinfo.InputType;
 import org.graalvm.compiler.nodeinfo.NodeInfo;
@@ -40,7 +39,7 @@
  * does not include a null check on the object.
  */
 @NodeInfo
-public abstract class FixedAccessNode extends DeoptimizingFixedWithNextNode implements Access, IterableNodeType {
+public abstract class FixedAccessNode extends DeoptimizingFixedWithNextNode implements Access {
     public static final NodeClass<FixedAccessNode> TYPE = NodeClass.create(FixedAccessNode.class);
 
     @OptionalInput(InputType.Guard) protected GuardingNode guard;
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/HeapAccess.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/HeapAccess.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/IndexAddressNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/IndexAddressNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/DelegatingReplacements.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/DelegatingReplacements.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -53,7 +53,8 @@
     Integer smallestCompareWidth();
 
     /**
-     * Indicates whether the target platform supports bulk zeroing instruction.
+     * Returns the granularity in terms of bytes that this target platform's bulk zeroing supports.
+     * Returns 0 to indicate that this target platform does not support bulk zeroing instruction.
      */
-    boolean supportBulkZeroing();
+    int bulkZeroingStride();
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringTool.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringTool.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Replacements.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Replacements.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/StampProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/StampProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -24,8 +24,8 @@
 
 package org.graalvm.compiler.nodes.spi;
 
+import org.graalvm.compiler.core.common.type.AbstractPointerStamp;
 import org.graalvm.compiler.core.common.type.ObjectStamp;
-import org.graalvm.compiler.core.common.type.Stamp;
 import org.graalvm.compiler.nodes.extended.LoadHubNode;
 
 /**
@@ -36,10 +36,10 @@
     /**
      * Create the stamp of the {@link LoadHubNode hub} of an object.
      */
-    Stamp createHubStamp(ObjectStamp object);
+    AbstractPointerStamp createHubStamp(ObjectStamp object);
 
     /**
      * Create the stamp of a pointer to a method.
      */
-    Stamp createMethodStamp();
+    AbstractPointerStamp createMethodStamp();
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/type/NarrowOopStamp.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/type/NarrowOopStamp.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/GraphUtil.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/GraphUtil.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/IntegerHelper.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,86 @@
+/*
+ * 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
+ * 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 org.graalvm.compiler.nodes.util;
+
+import org.graalvm.compiler.core.common.type.IntegerStamp;
+import org.graalvm.compiler.nodes.LogicNode;
+import org.graalvm.compiler.nodes.NodeView;
+import org.graalvm.compiler.nodes.ValueNode;
+
+public abstract class IntegerHelper {
+    protected final int bits;
+
+    protected IntegerHelper(int bits) {
+        this.bits = bits;
+    }
+
+    public abstract long upperBound(IntegerStamp stamp);
+
+    public abstract long lowerBound(IntegerStamp stamp);
+
+    public int compare(long a, long b) {
+        return rawCompare(cast(a), cast(b));
+    }
+
+    public boolean isGreater(long a, long b) {
+        return compare(a, b) > 0;
+    }
+
+    public boolean isSmaller(long a, long b) {
+        return compare(a, b) < 0;
+    }
+
+    public boolean isGreaterEqual(long a, long b) {
+        return compare(a, b) >= 0;
+    }
+
+    public boolean isSmallerEqual(long a, long b) {
+        return compare(a, b) <= 0;
+    }
+
+    public long min(long a, long b) {
+        return rawMin(cast(a), cast(b));
+    }
+
+    public long max(long a, long b) {
+        return rawMax(cast(a), cast(b));
+    }
+
+    public abstract long cast(long a);
+
+    public abstract long minValue();
+
+    public abstract long maxValue();
+
+    public abstract IntegerStamp stamp(long min, long max);
+
+    public abstract LogicNode createCompareNode(ValueNode x, ValueNode y, NodeView view);
+
+    protected abstract int rawCompare(long a, long b);
+
+    protected abstract long rawMin(long a, long b);
+
+    protected abstract long rawMax(long a, long b);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/SignedIntegerHelper.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+package org.graalvm.compiler.nodes.util;
+
+import org.graalvm.compiler.core.common.NumUtil;
+import org.graalvm.compiler.core.common.type.IntegerStamp;
+import org.graalvm.compiler.core.common.type.StampFactory;
+import org.graalvm.compiler.nodes.LogicNode;
+import org.graalvm.compiler.nodes.NodeView;
+import org.graalvm.compiler.nodes.ValueNode;
+import org.graalvm.compiler.nodes.calc.IntegerLessThanNode;
+
+import jdk.vm.ci.code.CodeUtil;
+
+public class SignedIntegerHelper extends IntegerHelper {
+    public SignedIntegerHelper(int bits) {
+        super(bits);
+    }
+
+    @Override
+    public long upperBound(IntegerStamp stamp) {
+        assert stamp.getBits() == bits;
+        return stamp.upperBound();
+    }
+
+    @Override
+    public long lowerBound(IntegerStamp stamp) {
+        assert stamp.getBits() == bits;
+        return stamp.lowerBound();
+    }
+
+    @Override
+    protected int rawCompare(long a, long b) {
+        return Long.compare(a, b);
+    }
+
+    @Override
+    protected long rawMin(long a, long b) {
+        return Math.min(a, b);
+    }
+
+    @Override
+    protected long rawMax(long a, long b) {
+        return Math.max(a, b);
+    }
+
+    @Override
+    public long cast(long a) {
+        return CodeUtil.signExtend(a, bits);
+    }
+
+    @Override
+    public long minValue() {
+        return NumUtil.minValue(bits);
+    }
+
+    @Override
+    public long maxValue() {
+        return NumUtil.maxValue(bits);
+    }
+
+    @Override
+    public IntegerStamp stamp(long min, long max) {
+        return StampFactory.forInteger(bits, cast(min), cast(max));
+    }
+
+    @Override
+    public LogicNode createCompareNode(ValueNode x, ValueNode y, NodeView view) {
+        return IntegerLessThanNode.create(x, y, view);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/UnsignedIntegerHelper.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+package org.graalvm.compiler.nodes.util;
+
+import org.graalvm.compiler.core.common.NumUtil;
+import org.graalvm.compiler.core.common.type.IntegerStamp;
+import org.graalvm.compiler.core.common.type.StampFactory;
+import org.graalvm.compiler.nodes.LogicNode;
+import org.graalvm.compiler.nodes.NodeView;
+import org.graalvm.compiler.nodes.ValueNode;
+import org.graalvm.compiler.nodes.calc.IntegerBelowNode;
+
+import jdk.vm.ci.code.CodeUtil;
+
+public class UnsignedIntegerHelper extends IntegerHelper {
+    public UnsignedIntegerHelper(int bits) {
+        super(bits);
+    }
+
+    @Override
+    public long upperBound(IntegerStamp stamp) {
+        assert stamp.getBits() == bits;
+        return stamp.unsignedUpperBound();
+    }
+
+    @Override
+    public long lowerBound(IntegerStamp stamp) {
+        assert stamp.getBits() == bits;
+        return stamp.unsignedLowerBound();
+    }
+
+    @Override
+    protected int rawCompare(long a, long b) {
+        return Long.compareUnsigned(a, b);
+    }
+
+    @Override
+    protected long rawMin(long a, long b) {
+        return NumUtil.minUnsigned(a, b);
+    }
+
+    @Override
+    protected long rawMax(long a, long b) {
+        return NumUtil.maxUnsigned(a, b);
+    }
+
+    @Override
+    public long cast(long a) {
+        return CodeUtil.zeroExtend(a, bits);
+    }
+
+    @Override
+    public long minValue() {
+        return 0;
+    }
+
+    @Override
+    public long maxValue() {
+        return NumUtil.maxValueUnsigned(bits);
+    }
+
+    @Override
+    public IntegerStamp stamp(long min, long max) {
+        return StampFactory.forUnsignedInteger(bits, min, max);
+    }
+
+    @Override
+    public LogicNode createCompareNode(ValueNode x, ValueNode y, NodeView view) {
+        return IntegerBelowNode.create(x, y, view);
+    }
+}
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.processor/src/org/graalvm/compiler/options/processor/OptionProcessor.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.processor/src/org/graalvm/compiler/options/processor/OptionProcessor.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/ModuleSupport.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,40 @@
+/*
+ * 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 org.graalvm.compiler.options;
+
+import java.util.ServiceLoader;
+
+public class ModuleSupport {
+
+    static Iterable<OptionDescriptors> getOptionsLoader() {
+        /*
+         * The Graal module (i.e., jdk.internal.vm.compiler) is loaded by the platform class loader
+         * as of JDK 9. Modules that depend on and extend Graal are loaded by the app class loader.
+         * As such, we need to start the provider search at the app class loader instead of the
+         * platform class loader.
+         */
+        return ServiceLoader.load(OptionDescriptors.class, ClassLoader.getSystemClassLoader());
+    }
+}
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/Option.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/Option.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptor.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptor.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionKey.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionKey.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionValues.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionValues.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionsParser.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionsParser.java	Wed Sep 25 22:40:41 2019 +0200
@@ -36,8 +36,6 @@
 import jdk.internal.vm.compiler.collections.EconomicMap;
 import jdk.internal.vm.compiler.collections.MapCursor;
 
-import jdk.vm.ci.services.Services;
-
 /**
  * This class contains methods for parsing Graal options and matching them against a set of
  * {@link OptionDescriptors}. The {@link OptionDescriptors} are loaded via a {@link ServiceLoader}.
@@ -53,26 +51,12 @@
         if (IS_IN_NATIVE_IMAGE || cachedOptionDescriptors != null) {
             return cachedOptionDescriptors;
         }
-        boolean java8OrEarlier = Services.getSavedProperties().get("java.specification.version").compareTo("1.9") < 0;
-        ClassLoader loader;
-        if (java8OrEarlier) {
-            // On JDK 8, Graal and its extensions are loaded by same class loader.
-            loader = OptionDescriptors.class.getClassLoader();
-        } else {
-            /*
-             * The Graal module (i.e., jdk.internal.vm.compiler) is loaded by the platform class
-             * loader as of JDK 9. Modules that depend on and extend Graal are loaded by the app
-             * class loader. As such, we need to start the provider search at the app class loader
-             * instead of the platform class loader.
-             */
-            loader = ClassLoader.getSystemClassLoader();
-        }
-        return ServiceLoader.load(OptionDescriptors.class, loader);
+        return ModuleSupport.getOptionsLoader();
     }
 
-    public static void setCachedOptionDescriptors(List<OptionDescriptors> cachedOptionDescriptors) {
+    public static void setCachedOptionDescriptors(List<OptionDescriptors> list) {
         assert IS_BUILDING_NATIVE_IMAGE : "Used to pre-initialize the option descriptors during native image generation";
-        OptionsParser.cachedOptionDescriptors = cachedOptionDescriptors;
+        OptionsParser.cachedOptionDescriptors = list;
     }
 
     /**
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AddressLoweringByUsePhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AddressLoweringByUsePhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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.
  * Copyright (c) 2017, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -69,7 +69,7 @@
             AddressNode lowered;
             if (node instanceof ReadNode) {
                 ReadNode readNode = (ReadNode) node;
-                Stamp stamp = readNode.stamp(NodeView.DEFAULT);
+                Stamp stamp = readNode.getAccessStamp();
                 address = readNode.getAddress();
                 lowered = lowering.lower(readNode, stamp, address);
             } else if (node instanceof JavaReadNode) {
@@ -79,12 +79,12 @@
                 lowered = lowering.lower(javaReadNode, stamp, address);
             } else if (node instanceof FloatingReadNode) {
                 FloatingReadNode floatingReadNode = (FloatingReadNode) node;
-                Stamp stamp = floatingReadNode.stamp(NodeView.DEFAULT);
+                Stamp stamp = floatingReadNode.getAccessStamp();
                 address = floatingReadNode.getAddress();
                 lowered = lowering.lower(floatingReadNode, stamp, address);
             } else if (node instanceof AbstractWriteNode) {
                 AbstractWriteNode abstractWriteNode = (AbstractWriteNode) node;
-                Stamp stamp = abstractWriteNode.value().stamp(NodeView.DEFAULT);
+                Stamp stamp = abstractWriteNode.getAccessStamp();
                 address = abstractWriteNode.getAddress();
                 lowered = lowering.lower(abstractWriteNode, stamp, address);
             } else if (node instanceof PrefetchAllocateNode) {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/CanonicalizerPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/CanonicalizerPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ConditionalEliminationPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ConditionalEliminationPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -309,7 +309,7 @@
             this.conditions = new ArrayDeque<>();
             tool = GraphUtil.getDefaultSimplifier(context.getMetaAccess(), context.getConstantReflection(), context.getConstantFieldProvider(), false, graph.getAssumptions(), graph.getOptions(),
                             context.getLowerer());
-            mergeMaps = EconomicMap.create();
+            mergeMaps = EconomicMap.create(Equivalence.IDENTITY);
         }
 
         protected void processConditionAnchor(ConditionAnchorNode node) {
@@ -616,7 +616,7 @@
                         Stamp newStamp = infoElement.getStamp();
                         if (phi.stamp(NodeView.DEFAULT).tryImproveWith(newStamp) != null) {
                             if (mergeMap == null) {
-                                mergeMap = EconomicMap.create();
+                                mergeMap = EconomicMap.create(Equivalence.IDENTITY);
                                 mergeMaps.put(merge, mergeMap);
                             }
 
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeoptimizationGroupingPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeoptimizationGroupingPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ExpandLogicPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ExpandLogicPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -24,7 +24,6 @@
 
 package org.graalvm.compiler.phases.common;
 
-import org.graalvm.compiler.core.common.type.FloatStamp;
 import org.graalvm.compiler.core.common.type.Stamp;
 import org.graalvm.compiler.debug.DebugCloseable;
 import org.graalvm.compiler.debug.GraalError;
@@ -42,12 +41,8 @@
 import org.graalvm.compiler.nodes.ShortCircuitOrNode;
 import org.graalvm.compiler.nodes.StructuredGraph;
 import org.graalvm.compiler.nodes.ValueNode;
+import org.graalvm.compiler.nodes.calc.AbstractNormalizeCompareNode;
 import org.graalvm.compiler.nodes.calc.ConditionalNode;
-import org.graalvm.compiler.nodes.calc.FloatEqualsNode;
-import org.graalvm.compiler.nodes.calc.FloatLessThanNode;
-import org.graalvm.compiler.nodes.calc.IntegerEqualsNode;
-import org.graalvm.compiler.nodes.calc.IntegerLessThanNode;
-import org.graalvm.compiler.nodes.calc.NormalizeCompareNode;
 import org.graalvm.compiler.phases.Phase;
 
 public class ExpandLogicPhase extends Phase {
@@ -61,7 +56,7 @@
         }
         assert graph.getNodes(ShortCircuitOrNode.TYPE).isEmpty();
 
-        for (NormalizeCompareNode logic : graph.getNodes(NormalizeCompareNode.TYPE)) {
+        for (AbstractNormalizeCompareNode logic : graph.getNodes(AbstractNormalizeCompareNode.TYPE)) {
             try (DebugCloseable context = logic.withNodeSourcePosition()) {
                 processNormalizeCompareNode(logic);
             }
@@ -69,23 +64,12 @@
         graph.setAfterExpandLogic();
     }
 
-    private static void processNormalizeCompareNode(NormalizeCompareNode normalize) {
-        LogicNode equalComp;
-        LogicNode lessComp;
+    private static void processNormalizeCompareNode(AbstractNormalizeCompareNode normalize) {
         StructuredGraph graph = normalize.graph();
-        ValueNode x = normalize.getX();
-        ValueNode y = normalize.getY();
-        if (x.stamp(NodeView.DEFAULT) instanceof FloatStamp) {
-            equalComp = graph.addOrUniqueWithInputs(FloatEqualsNode.create(x, y, NodeView.DEFAULT));
-            lessComp = graph.addOrUniqueWithInputs(FloatLessThanNode.create(x, y, normalize.isUnorderedLess(), NodeView.DEFAULT));
-        } else {
-            equalComp = graph.addOrUniqueWithInputs(IntegerEqualsNode.create(x, y, NodeView.DEFAULT));
-            lessComp = graph.addOrUniqueWithInputs(IntegerLessThanNode.create(x, y, NodeView.DEFAULT));
-        }
-
+        LogicNode equalComp = graph.addOrUniqueWithInputs(normalize.createEqualComparison());
+        LogicNode lessComp = graph.addOrUniqueWithInputs(normalize.createLowerComparison());
         Stamp stamp = normalize.stamp(NodeView.DEFAULT);
-        ConditionalNode equalValue = graph.unique(
-                        new ConditionalNode(equalComp, ConstantNode.forIntegerStamp(stamp, 0, graph), ConstantNode.forIntegerStamp(stamp, 1, graph)));
+        ConditionalNode equalValue = graph.unique(new ConditionalNode(equalComp, ConstantNode.forIntegerStamp(stamp, 0, graph), ConstantNode.forIntegerStamp(stamp, 1, graph)));
         ConditionalNode value = graph.unique(new ConditionalNode(lessComp, ConstantNode.forIntegerStamp(stamp, -1, graph), equalValue));
         normalize.replaceAtUsagesAndDelete(value);
     }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FixReadsPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FixReadsPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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 @@
 package org.graalvm.compiler.phases.common;
 
 import jdk.internal.vm.compiler.collections.EconomicMap;
+import jdk.internal.vm.compiler.collections.Equivalence;
 import jdk.internal.vm.compiler.collections.MapCursor;
 import org.graalvm.compiler.core.common.GraalOptions;
 import org.graalvm.compiler.core.common.cfg.BlockMap;
@@ -209,7 +210,7 @@
             this.schedule = schedule;
             this.metaAccess = metaAccess;
             blockActionStart = new BlockMap<>(schedule.getCFG());
-            endMaps = EconomicMap.create();
+            endMaps = EconomicMap.create(Equivalence.IDENTITY);
             stampMap = graph.createNodeMap();
             undoOperations = new NodeStack();
             replaceConstantInputs = replaceInputsWithConstants && GraalOptions.ReplaceInputsWithConstantsBasedOnStamps.getValue(graph.getOptions());
@@ -310,7 +311,7 @@
 
                 if (currentEndMap == null || !currentEndMap.isEmpty()) {
 
-                    EconomicMap<ValueNode, Stamp> endMap = EconomicMap.create();
+                    EconomicMap<ValueNode, Stamp> endMap = EconomicMap.create(Equivalence.IDENTITY);
 
                     // Process phis
                     for (ValuePhiNode phi : merge.valuePhis()) {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FrameStateAssignmentPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FrameStateAssignmentPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -86,7 +86,7 @@
 
             if (node instanceof DeoptimizingNode.DeoptDuring) {
                 DeoptimizingNode.DeoptDuring deopt = (DeoptimizingNode.DeoptDuring) node;
-                if (deopt.canDeoptimize()) {
+                if (deopt.canDeoptimize() && deopt.stateDuring() == null) {
                     GraalError.guarantee(currentState != null, "no FrameState at DeoptimizingNode %s", deopt);
                     deopt.computeStateDuring(currentState);
                 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IncrementalCanonicalizerPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IncrementalCanonicalizerPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoweringPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoweringPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/NodeCounterPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/NodeCounterPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/OptimizeDivPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/OptimizeDivPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -49,12 +49,12 @@
 
     @Override
     protected void run(StructuredGraph graph) {
-        for (IntegerDivRemNode rem : graph.getNodes().filter(IntegerDivRemNode.class)) {
+        for (IntegerDivRemNode rem : graph.getNodes(IntegerDivRemNode.TYPE)) {
             if (rem instanceof SignedRemNode && divByNonZeroConstant(rem)) {
                 optimizeRem(rem);
             }
         }
-        for (IntegerDivRemNode div : graph.getNodes().filter(IntegerDivRemNode.class)) {
+        for (IntegerDivRemNode div : graph.getNodes(IntegerDivRemNode.TYPE)) {
             if (div instanceof SignedDivNode && divByNonZeroConstant(div)) {
                 optimizeSignedDiv((SignedDivNode) div);
             }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/PropagateDeoptimizeProbabilityPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/PropagateDeoptimizeProbabilityPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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 jdk.internal.vm.compiler.collections.EconomicMap;
 import jdk.internal.vm.compiler.collections.EconomicSet;
+import jdk.internal.vm.compiler.collections.Equivalence;
 import jdk.internal.vm.compiler.collections.MapCursor;
 import org.graalvm.compiler.graph.NodeStack;
 import org.graalvm.compiler.nodes.AbstractBeginNode;
@@ -52,7 +53,7 @@
         if (graph.hasNode(AbstractDeoptimizeNode.TYPE)) {
 
             NodeStack stack = new NodeStack();
-            EconomicMap<ControlSplitNode, EconomicSet<AbstractBeginNode>> reachableSplits = EconomicMap.create();
+            EconomicMap<ControlSplitNode, EconomicSet<AbstractBeginNode>> reachableSplits = EconomicMap.create(Equivalence.IDENTITY);
 
             // Mark all control flow nodes that are post-dominated by a deoptimization.
             for (AbstractDeoptimizeNode d : graph.getNodes(AbstractDeoptimizeNode.TYPE)) {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/RemoveValueProxyPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/RemoveValueProxyPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/UseTrappingNullChecksPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/UseTrappingNullChecksPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -45,6 +45,7 @@
 import org.graalvm.compiler.nodes.FixedNode;
 import org.graalvm.compiler.nodes.IfNode;
 import org.graalvm.compiler.nodes.LogicNode;
+import org.graalvm.compiler.nodes.LoopExitNode;
 import org.graalvm.compiler.nodes.StructuredGraph;
 import org.graalvm.compiler.nodes.ValueNode;
 import org.graalvm.compiler.nodes.ValuePhiNode;
@@ -165,7 +166,8 @@
 
     private static void tryUseTrappingNullCheck(AbstractDeoptimizeNode deopt, Node predecessor, DeoptimizationReason deoptimizationReason, Speculation speculation, long implicitNullCheckLimit) {
         assert predecessor != null;
-        if (deoptimizationReason != DeoptimizationReason.NullCheckException && deoptimizationReason != DeoptimizationReason.UnreachedCode) {
+        if (deoptimizationReason != DeoptimizationReason.NullCheckException && deoptimizationReason != DeoptimizationReason.UnreachedCode &&
+                        deoptimizationReason != DeoptimizationReason.TypeCheckedInliningViolated) {
             deopt.getDebug().log(DebugContext.INFO_LEVEL, "Not a null check or unreached %s", predecessor);
             return;
         }
@@ -174,17 +176,23 @@
             deopt.getDebug().log(DebugContext.INFO_LEVEL, "Has a speculation %s", predecessor);
             return;
         }
-        if (predecessor instanceof AbstractMergeNode) {
-            AbstractMergeNode merge = (AbstractMergeNode) predecessor;
+
+        // Skip over loop exit nodes.
+        Node pred = predecessor;
+        while (pred instanceof LoopExitNode) {
+            pred = pred.predecessor();
+        }
+        if (pred instanceof AbstractMergeNode) {
+            AbstractMergeNode merge = (AbstractMergeNode) pred;
             if (merge.phis().isEmpty()) {
                 for (AbstractEndNode end : merge.cfgPredecessors().snapshot()) {
                     checkPredecessor(deopt, end.predecessor(), deoptimizationReason, implicitNullCheckLimit);
                 }
             }
-        } else if (predecessor instanceof AbstractBeginNode) {
-            checkPredecessor(deopt, predecessor, deoptimizationReason, implicitNullCheckLimit);
+        } else if (pred instanceof AbstractBeginNode) {
+            checkPredecessor(deopt, pred, deoptimizationReason, implicitNullCheckLimit);
         } else {
-            deopt.getDebug().log(DebugContext.INFO_LEVEL, "Not a Begin or Merge %s", predecessor);
+            deopt.getDebug().log(DebugContext.INFO_LEVEL, "Not a Begin or Merge %s", pred);
         }
     }
 
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningUtil.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningUtil.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -728,7 +728,7 @@
         FrameState stateAtReturn = invoke.stateAfter();
         FrameState outerFrameState = null;
         JavaKind invokeReturnKind = invoke.asNode().getStackKind();
-        EconomicMap<Node, Node> replacements = EconomicMap.create();
+        EconomicMap<Node, Node> replacements = EconomicMap.create(Equivalence.IDENTITY);
         for (FrameState original : inlineGraph.getNodes(FrameState.TYPE)) {
             FrameState frameState = (FrameState) duplicates.get(original);
             if (frameState != null && frameState.isAlive()) {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/InlineableGraph.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/InlineableGraph.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/AbstractInliningPolicy.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/AbstractInliningPolicy.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/GreedyInliningPolicy.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/GreedyInliningPolicy.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineEverythingPolicy.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineEverythingPolicy.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineMethodSubstitutionsPolicy.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineMethodSubstitutionsPolicy.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InliningPolicy.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InliningPolicy.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/util/EconomicSetNodeEventListener.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/util/EconomicSetNodeEventListener.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/PhaseSuite.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/PhaseSuite.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/VerifyPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/VerifyPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantBlockIterator.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantBlockIterator.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/HighTierContext.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/HighTierContext.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/LowTierContext.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/LowTierContext.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/MidTierContext.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/MidTierContext.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/GraphOrder.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/GraphOrder.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -158,7 +158,7 @@
     public static boolean assertSchedulableGraph(final StructuredGraph graph) {
         assert graph.getGuardsStage() != GuardsStage.AFTER_FSA : "Cannot use the BlockIteratorClosure after FrameState Assignment, HIR Loop Data Structures are no longer valid.";
         try (DebugContext.Scope s = graph.getDebug().scope("AssertSchedulableGraph")) {
-            final SchedulePhase schedulePhase = new SchedulePhase(SchedulingStrategy.LATEST_OUT_OF_LOOPS, true);
+            final SchedulePhase schedulePhase = new SchedulePhase(getSchedulingPolicy(graph), true);
             final EconomicMap<LoopBeginNode, NodeBitMap> loopEntryStates = EconomicMap.create(Equivalence.IDENTITY);
             schedulePhase.apply(graph, false);
             final ScheduleResult schedule = graph.getLastSchedule();
@@ -216,11 +216,11 @@
                                             }
                                         }
                                     }
-
                                     // loop contents are only accessible via proxies at the exit
                                     currentState.clearAll();
                                     currentState.markAll(loopEntryStates.get(((LoopExitNode) node).loopBegin()));
                                 }
+
                                 // Loop proxies aren't scheduled, so they need to be added
                                 // explicitly
                                 currentState.markAll(((LoopExitNode) node).proxies());
@@ -297,4 +297,14 @@
         }
         return true;
     }
+
+    /*
+     * Complexity of verification for LATEST_OUT_OF_LOOPS with value proxies exceeds the benefits.
+     * The problem are floating values that can be scheduled before the loop and have proxies only
+     * on some use edges after the loop. These values, which are hard to detect, get scheduled
+     * before the loop exit and are not visible in the state after the loop exit.
+     */
+    private static SchedulingStrategy getSchedulingPolicy(StructuredGraph graph) {
+        return graph.hasValueProxies() ? SchedulingStrategy.EARLIEST : SchedulingStrategy.LATEST_OUT_OF_LOOPS;
+    }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/Providers.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/Providers.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BinaryGraphPrinter.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BinaryGraphPrinter.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinterObserver.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinterObserver.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraalDebugHandlersFactory.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraalDebugHandlersFactory.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinter.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinter.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -28,8 +28,11 @@
 import java.io.IOException;
 import java.lang.reflect.Array;
 import java.util.Arrays;
+import java.util.Collections;
+import java.util.IdentityHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import org.graalvm.compiler.api.replacements.SnippetReflectionProvider;
 import org.graalvm.compiler.debug.DebugContext;
@@ -106,7 +109,7 @@
 
     /**
      * Use the real {@link Object#toString()} method for {@link JavaConstant JavaConstants} that are
-     * wrapping trusted types, other just return the results of {@link JavaConstant#toString()}.
+     * wrapping trusted types, otherwise just return the result of {@link JavaConstant#toString()}.
      */
     @Override
     default String format(JavaConstant constant) {
@@ -122,7 +125,8 @@
                 } catch (Throwable ex) {
                 }
                 if (obj != null) {
-                    return GraphPrinter.constantToString(obj);
+                    Set<Object> visited = Collections.newSetFromMap(new IdentityHashMap<>());
+                    return GraphPrinter.constantToString(obj, visited);
                 }
             }
         }
@@ -180,49 +184,61 @@
         return s;
     }
 
-    static String constantToString(Object value) {
-        Class<?> c = value.getClass();
-        String suffix = "";
-        if (c.isArray()) {
-            return constantArrayToString(value);
-        } else if (value instanceof Enum) {
-            return ((Enum<?>) value).name();
-        } else if (isToStringTrusted(c)) {
-            try {
-                return value.toString();
-            } catch (Throwable t) {
-                suffix = "[toString error: " + t.getClass().getName() + "]";
-                if (isToStringTrusted(t.getClass())) {
-                    try {
-                        suffix = "[toString error: " + t + "]";
-                    } catch (Throwable t2) {
-                        // No point in going further
+    static String constantToString(Object value, Set<Object> visited) {
+        if (!visited.contains(value)) {
+            Class<?> c = value.getClass();
+            String suffix = "";
+            if (c.isArray()) {
+                return constantArrayToString(value, visited);
+            }
+            visited.add(value);
+            if (value instanceof Enum) {
+                return ((Enum<?>) value).name();
+            } else if (isToStringTrusted(c)) {
+                try {
+                    return value.toString();
+                } catch (Throwable t) {
+                    suffix = "[toString error: " + t.getClass().getName() + "]";
+                    if (isToStringTrusted(t.getClass())) {
+                        try {
+                            suffix = "[toString error: " + t + "]";
+                        } catch (Throwable t2) {
+                            // No point in going further
+                        }
                     }
                 }
             }
+            return MetaUtil.getSimpleName(c, true) + "@" + Integer.toHexString(System.identityHashCode(value)) + suffix;
+        } else {
+            return "...";
         }
-        return MetaUtil.getSimpleName(c, true) + "@" + Integer.toHexString(System.identityHashCode(value)) + suffix;
+
     }
 
-    static String constantArrayToString(Object array) {
-        Class<?> componentType = array.getClass().getComponentType();
-        assert componentType != null;
-        int arrayLength = Array.getLength(array);
-        StringBuilder buf = new StringBuilder(MetaUtil.getSimpleName(componentType, true)).append('[').append(arrayLength).append("]{");
-        int length = arrayLength;
-        boolean primitive = componentType.isPrimitive();
-        for (int i = 0; i < length; i++) {
-            if (primitive) {
-                buf.append(Array.get(array, i));
-            } else {
-                Object o = ((Object[]) array)[i];
-                buf.append(o == null ? "null" : constantToString(o));
+    static String constantArrayToString(Object array, Set<Object> visited) {
+        if (!visited.contains(array)) {
+            visited.add(array);
+            Class<?> componentType = array.getClass().getComponentType();
+            assert componentType != null;
+            int arrayLength = Array.getLength(array);
+            StringBuilder buf = new StringBuilder(MetaUtil.getSimpleName(componentType, true)).append('[').append(arrayLength).append("]{");
+            int length = arrayLength;
+            boolean primitive = componentType.isPrimitive();
+            for (int i = 0; i < length; i++) {
+                if (primitive) {
+                    buf.append(Array.get(array, i));
+                } else {
+                    Object o = ((Object[]) array)[i];
+                    buf.append(o == null ? "null" : constantToString(o, visited));
+                }
+                if (i != length - 1) {
+                    buf.append(", ");
+                }
             }
-            if (i != length - 1) {
-                buf.append(", ");
-            }
+            return buf.append('}').toString();
+        } else {
+            return "...";
         }
-        return buf.append('}').toString();
     }
 
     @SuppressWarnings("try")
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinterDumpHandler.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinterDumpHandler.java	Wed Sep 25 22:40:41 2019 +0200
@@ -37,13 +37,14 @@
 import java.util.Map;
 import java.util.WeakHashMap;
 
+import org.graalvm.compiler.core.common.CompilationIdentifier;
 import org.graalvm.compiler.debug.DebugContext;
 import org.graalvm.compiler.debug.DebugDumpHandler;
 import org.graalvm.compiler.debug.DebugDumpScope;
 import org.graalvm.compiler.debug.DebugOptions;
+import org.graalvm.compiler.debug.DebugOptions.PrintGraphTarget;
 import org.graalvm.compiler.debug.GraalError;
 import org.graalvm.compiler.debug.TTY;
-import org.graalvm.compiler.debug.DebugOptions.PrintGraphTarget;
 import org.graalvm.compiler.graph.Graph;
 import org.graalvm.compiler.nodes.StructuredGraph;
 import org.graalvm.compiler.options.OptionValues;
@@ -66,6 +67,7 @@
     private final GraphPrinterSupplier printerSupplier;
     protected GraphPrinter printer;
     private List<String> previousInlineContext;
+    private CompilationIdentifier previousCompilationID = CompilationIdentifier.INVALID_COMPILATION_ID;
     private int[] dumpIds = {};
     private int failuresCount;
     private Map<Graph, List<String>> inlineContextMap;
@@ -136,6 +138,22 @@
             // Get all current JavaMethod instances in the context.
             List<String> inlineContext = getInlineContext(graph);
 
+            if (graph instanceof StructuredGraph) {
+                CompilationIdentifier compilationID = ((StructuredGraph) graph).compilationId();
+                // If the graph to be dumped is with an invalid compilation id, it is likely derived
+                // from inlining.
+                if (compilationID != CompilationIdentifier.INVALID_COMPILATION_ID) {
+                    if (previousCompilationID != CompilationIdentifier.INVALID_COMPILATION_ID && !compilationID.equals(previousCompilationID)) {
+                        // Compilation ID does not match, close existing scopes.
+                        for (int inlineDepth = previousInlineContext.size() - 1; inlineDepth >= 0; --inlineDepth) {
+                            closeScope(debug, inlineDepth);
+                        }
+                        previousInlineContext = new ArrayList<>();
+                    }
+                    previousCompilationID = compilationID;
+                }
+            }
+
             if (!inlineContext.equals(previousInlineContext)) {
                 Map<Object, Object> properties = new HashMap<>();
                 properties.put("graph", graph.toString());
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64GraphBuilderPlugins.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64GraphBuilderPlugins.java	Wed Sep 25 22:40:41 2019 +0200
@@ -45,17 +45,24 @@
 import org.graalvm.compiler.nodes.java.AtomicReadAndWriteNode;
 import org.graalvm.compiler.nodes.memory.address.AddressNode;
 import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode;
+import org.graalvm.compiler.replacements.TargetGraphBuilderPlugins;
 import org.graalvm.compiler.replacements.nodes.BinaryMathIntrinsicNode;
 import org.graalvm.compiler.replacements.nodes.UnaryMathIntrinsicNode;
 import org.graalvm.compiler.replacements.nodes.UnaryMathIntrinsicNode.UnaryOperation;
 import org.graalvm.compiler.serviceprovider.JavaVersionUtil;
 import jdk.internal.vm.compiler.word.LocationIdentity;
 
+import jdk.vm.ci.code.Architecture;
 import jdk.vm.ci.meta.JavaKind;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 import sun.misc.Unsafe;
 
-public class AArch64GraphBuilderPlugins {
+public class AArch64GraphBuilderPlugins implements TargetGraphBuilderPlugins {
+    @Override
+    public void register(Plugins plugins, BytecodeProvider replacementsBytecodeProvider, Architecture arch, boolean explicitUnsafeNullChecks, boolean registerMathPlugins,
+                    boolean emitJDK9StringSubstitutions, boolean useFMAIntrinsics) {
+        register(plugins, replacementsBytecodeProvider, explicitUnsafeNullChecks, registerMathPlugins, emitJDK9StringSubstitutions);
+    }
 
     public static void register(Plugins plugins, BytecodeProvider bytecodeProvider, boolean explicitUnsafeNullChecks,
                     boolean registerMathPlugins) {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerArithmeticSnippets.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerArithmeticSnippets.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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.
  * Copyright (c) 2018, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -44,6 +44,7 @@
 import org.graalvm.compiler.nodes.calc.SignedRemNode;
 import org.graalvm.compiler.nodes.calc.UnsignedDivNode;
 import org.graalvm.compiler.nodes.calc.UnsignedRemNode;
+import org.graalvm.compiler.nodes.extended.BranchProbabilityNode;
 import org.graalvm.compiler.nodes.spi.LoweringTool;
 import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool;
 import org.graalvm.compiler.options.OptionValues;
@@ -183,14 +184,14 @@
     }
 
     private static void checkForZero(int y) {
-        if (y == 0) {
+        if (BranchProbabilityNode.probability(BranchProbabilityNode.DEOPT_PROBABILITY, y == 0)) {
             // "/ by zero"
             DeoptimizeNode.deopt(DeoptimizationAction.InvalidateReprofile, DeoptimizationReason.ArithmeticException);
         }
     }
 
     private static void checkForZero(long y) {
-        if (y == 0) {
+        if (BranchProbabilityNode.probability(BranchProbabilityNode.DEOPT_PROBABILITY, y == 0)) {
             // "/ by zero"
             DeoptimizeNode.deopt(DeoptimizationAction.InvalidateReprofile, DeoptimizationReason.ArithmeticException);
         }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64ArrayIndexOf.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64ArrayIndexOf.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64ArrayIndexOfNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64ArrayIndexOfNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64GraphBuilderPlugins.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64GraphBuilderPlugins.java	Wed Sep 25 22:40:41 2019 +0200
@@ -54,6 +54,7 @@
 import org.graalvm.compiler.replacements.StandardGraphBuilderPlugins.UnsafeAccessPlugin;
 import org.graalvm.compiler.replacements.StandardGraphBuilderPlugins.UnsafeGetPlugin;
 import org.graalvm.compiler.replacements.StandardGraphBuilderPlugins.UnsafePutPlugin;
+import org.graalvm.compiler.replacements.TargetGraphBuilderPlugins;
 import org.graalvm.compiler.replacements.nodes.BinaryMathIntrinsicNode;
 import org.graalvm.compiler.replacements.nodes.BinaryMathIntrinsicNode.BinaryOperation;
 import org.graalvm.compiler.replacements.nodes.BitCountNode;
@@ -64,11 +65,17 @@
 
 import jdk.vm.ci.amd64.AMD64;
 import jdk.vm.ci.amd64.AMD64.CPUFeature;
+import jdk.vm.ci.code.Architecture;
 import jdk.vm.ci.meta.JavaKind;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 import sun.misc.Unsafe;
 
-public class AMD64GraphBuilderPlugins {
+public class AMD64GraphBuilderPlugins implements TargetGraphBuilderPlugins {
+    @Override
+    public void register(Plugins plugins, BytecodeProvider replacementsBytecodeProvider, Architecture architecture, boolean explicitUnsafeNullChecks,
+                    boolean registerMathPlugins, boolean emitJDK9StringSubstitutions, boolean useFMAIntrinsics) {
+        register(plugins, replacementsBytecodeProvider, (AMD64) architecture, explicitUnsafeNullChecks, emitJDK9StringSubstitutions, useFMAIntrinsics);
+    }
 
     public static void register(Plugins plugins, BytecodeProvider replacementsBytecodeProvider, AMD64 arch, boolean explicitUnsafeNullChecks, boolean emitJDK9StringSubstitutions,
                     boolean useFMAIntrinsics) {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringLatin1Substitutions.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringLatin1Substitutions.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -134,8 +134,6 @@
         }
         if (targetCount == 1) {
             return AMD64ArrayIndexOf.indexOf1Byte(source, sourceCount, fromIndex, target[0]);
-        } else if (targetCount == 2) {
-            return AMD64ArrayIndexOf.indexOfTwoConsecutiveBytes(source, sourceCount, fromIndex, target[0], target[1]);
         } else {
             int haystackLength = sourceCount - (targetCount - 2);
             int offset = fromIndex;
@@ -147,7 +145,7 @@
                 offset = indexOfResult;
                 Pointer cmpSourcePointer = byteOffsetPointer(source, offset);
                 Pointer targetPointer = pointer(target);
-                if (ArrayRegionEqualsNode.regionEquals(cmpSourcePointer, targetPointer, targetCount, JavaKind.Byte)) {
+                if (targetCount == 2 || ArrayRegionEqualsNode.regionEquals(cmpSourcePointer, targetPointer, targetCount, JavaKind.Byte)) {
                     return offset;
                 }
                 offset++;
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringSubstitutions.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringSubstitutions.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -85,8 +85,6 @@
 
         if (targetCount == 1) {
             return AMD64ArrayIndexOf.indexOf1Char(source, sourceCount, totalOffset, target[targetOffset]);
-        } else if (targetCount == 2) {
-            return AMD64ArrayIndexOf.indexOfTwoConsecutiveChars(source, sourceCount, totalOffset, target[targetOffset], target[targetOffset + 1]);
         } else {
             int haystackLength = sourceCount - (targetCount - 2);
             while (totalOffset < haystackLength) {
@@ -95,10 +93,14 @@
                     return -1;
                 }
                 totalOffset = indexOfResult;
-                Pointer cmpSourcePointer = Word.objectToTrackedPointer(source).add(charArrayBaseOffset(INJECTED)).add(totalOffset * charArrayIndexScale(INJECTED));
-                Pointer targetPointer = Word.objectToTrackedPointer(target).add(charArrayBaseOffset(INJECTED)).add(targetOffset * charArrayIndexScale(INJECTED));
-                if (ArrayRegionEqualsNode.regionEquals(cmpSourcePointer, targetPointer, targetCount, JavaKind.Char)) {
+                if (targetCount == 2) {
                     return totalOffset;
+                } else {
+                    Pointer cmpSourcePointer = Word.objectToTrackedPointer(source).add(charArrayBaseOffset(INJECTED)).add(totalOffset * charArrayIndexScale(INJECTED));
+                    Pointer targetPointer = Word.objectToTrackedPointer(target).add(charArrayBaseOffset(INJECTED)).add(targetOffset * charArrayIndexScale(INJECTED));
+                    if (ArrayRegionEqualsNode.regionEquals(cmpSourcePointer, targetPointer, targetCount, JavaKind.Char)) {
+                        return totalOffset;
+                    }
                 }
                 totalOffset++;
             }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringUTF16Substitutions.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringUTF16Substitutions.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -122,8 +122,6 @@
         ReplacementsUtil.runtimeAssert(sourceCount >= targetCount, "StringUTF16.indexOfUnsafe invalid args: sourceCount < targetCount");
         if (targetCount == 1) {
             return AMD64ArrayIndexOf.indexOf1Char(source, sourceCount, fromIndex, StringUTF16Substitutions.getChar(target, 0));
-        } else if (targetCount == 2) {
-            return AMD64ArrayIndexOf.indexOfTwoConsecutiveChars(source, sourceCount, fromIndex, StringUTF16Substitutions.getChar(target, 0), StringUTF16Substitutions.getChar(target, 1));
         } else {
             int haystackLength = sourceCount - (targetCount - 2);
             int offset = fromIndex;
@@ -136,7 +134,7 @@
                 offset = indexOfResult;
                 Pointer cmpSourcePointer = charOffsetPointer(source, offset);
                 Pointer targetPointer = pointer(target);
-                if (ArrayRegionEqualsNode.regionEquals(cmpSourcePointer, targetPointer, targetCount, JavaKind.Char)) {
+                if (targetCount == 2 || ArrayRegionEqualsNode.regionEquals(cmpSourcePointer, targetPointer, targetCount, JavaKind.Char)) {
                     return offset;
                 }
                 offset++;
@@ -153,8 +151,6 @@
         ReplacementsUtil.runtimeAssert(sourceCount >= targetCount, "StringUTF16.indexOfLatin1Unsafe invalid args: sourceCount < targetCount");
         if (targetCount == 1) {
             return AMD64ArrayIndexOf.indexOf1Char(source, sourceCount, fromIndex, (char) Byte.toUnsignedInt(target[0]));
-        } else if (targetCount == 2) {
-            return AMD64ArrayIndexOf.indexOfTwoConsecutiveChars(source, sourceCount, fromIndex, (char) Byte.toUnsignedInt(target[0]), (char) Byte.toUnsignedInt(target[1]));
         } else {
             int haystackLength = sourceCount - (targetCount - 2);
             int offset = fromIndex;
@@ -166,7 +162,7 @@
                 offset = indexOfResult;
                 Pointer cmpSourcePointer = charOffsetPointer(source, offset);
                 Pointer targetPointer = pointer(target);
-                if (ArrayRegionEqualsNode.regionEquals(cmpSourcePointer, targetPointer, targetCount, JavaKind.Char, JavaKind.Byte)) {
+                if (targetCount == 2 || ArrayRegionEqualsNode.regionEquals(cmpSourcePointer, targetPointer, targetCount, JavaKind.Char, JavaKind.Byte)) {
                     return offset;
                 }
                 offset++;
@@ -185,9 +181,7 @@
      */
     @MethodSubstitution
     public static int compress(char[] src, int srcIndex, byte[] dest, int destIndex, int len) {
-        if (len < 0 || srcIndex < 0 || (srcIndex + len > src.length) || destIndex < 0 || (destIndex + len > dest.length)) {
-            DeoptimizeNode.deopt(DeoptimizationAction.None, DeoptimizationReason.BoundsCheckException);
-        }
+        checkLimits(src.length, srcIndex, dest.length, destIndex, len);
 
         Pointer srcPointer = Word.objectToTrackedPointer(src).add(charArrayBaseOffset(INJECTED)).add(srcIndex * charArrayIndexScale(INJECTED));
         Pointer destPointer = Word.objectToTrackedPointer(dest).add(byteArrayBaseOffset(INJECTED)).add(destIndex * byteArrayIndexScale(INJECTED));
@@ -208,13 +202,17 @@
      */
     @MethodSubstitution
     public static int compress(byte[] src, int srcIndex, byte[] dest, int destIndex, int len) {
-        if (len < 0 || srcIndex < 0 || (srcIndex * 2 + len * 2 > src.length) || destIndex < 0 || (destIndex + len > dest.length)) {
-            DeoptimizeNode.deopt(DeoptimizationAction.None, DeoptimizationReason.BoundsCheckException);
-        }
+        checkLimits(src.length >> 1, srcIndex, dest.length, destIndex, len);
 
         Pointer srcPointer = Word.objectToTrackedPointer(src).add(byteArrayBaseOffset(INJECTED)).add(srcIndex * 2 * byteArrayIndexScale(INJECTED));
         Pointer destPointer = Word.objectToTrackedPointer(dest).add(byteArrayBaseOffset(INJECTED)).add(destIndex * byteArrayIndexScale(INJECTED));
         return AMD64StringUTF16CompressNode.compress(srcPointer, destPointer, len, JavaKind.Byte);
     }
 
+    private static void checkLimits(int srcLen, int srcIndex, int destLen, int destIndex, int len) {
+        if (len < 0 || srcIndex < 0 || (srcIndex + len > srcLen) || destIndex < 0 || (destIndex + len > destLen)) {
+            DeoptimizeNode.deopt(DeoptimizationAction.None, DeoptimizationReason.BoundsCheckException);
+        }
+    }
+
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/GeneratedFoldPlugin.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/GeneratedFoldPlugin.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/GeneratedPlugin.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/GeneratedPlugin.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -73,6 +73,9 @@
         out.printf("\n");
         out.printf("    @Override\n");
         out.printf("    public boolean execute(GraphBuilderContext b, ResolvedJavaMethod targetMethod, InvocationPlugin.Receiver receiver, ValueNode[] args) {\n");
+        out.printf("        if (!b.isPluginEnabled(this)) {\n");
+        out.printf("            return false;\n");
+        out.printf("        }\n");
         InjectedDependencies deps = createExecute(processor, out);
         out.printf("    }\n");
         out.printf("    @Override\n");
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArraysSubstitutionsTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArraysSubstitutionsTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnExceptionTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnExceptionTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnIntegerExactTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnIntegerExactTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DerivedOopTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DerivedOopTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/FoldTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/FoldTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerExactExceptionTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerExactExceptionTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerExactFoldTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerExactFoldTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InvokerSignatureMismatchTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InvokerSignatureMismatchTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -27,69 +27,47 @@
 import static org.graalvm.compiler.test.SubprocessUtil.getVMCommandLine;
 import static org.graalvm.compiler.test.SubprocessUtil.withoutDebuggerArguments;
 
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.List;
+
+import org.graalvm.compiler.core.test.CustomizedBytecodePatternTest;
+import org.graalvm.compiler.serviceprovider.JavaVersionUtil;
+import org.graalvm.compiler.test.SubprocessUtil;
+import org.graalvm.compiler.test.SubprocessUtil.Subprocess;
 import org.junit.Test;
 import org.objectweb.asm.ClassWriter;
 import org.objectweb.asm.MethodVisitor;
 import org.objectweb.asm.Type;
 
-import java.io.File;
-import java.lang.invoke.MethodHandles;
-import java.util.List;
+public class InvokerSignatureMismatchTest extends CustomizedBytecodePatternTest {
 
-import org.graalvm.compiler.core.test.CustomizedBytecodePatternTest;
-import org.graalvm.compiler.test.SubprocessUtil;
-import org.graalvm.compiler.test.SubprocessUtil.Subprocess;
-
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-
-public class InvokerSignatureMismatchTest {
-
+    @SuppressWarnings("try")
     @Test
     public void test() throws Throwable {
         List<String> args = withoutDebuggerArguments(getVMCommandLine());
-        String classPath = System.getProperty("java.class.path");
-        classPath = classPath + File.pathSeparator + TestISMBL.class.getProtectionDomain().getCodeSource().getLocation().getPath();
-        args.add("-Xbootclasspath/a:" + classPath);
-        args.add("-XX:-TieredCompilation");
-        args.add("-XX:+EnableJVMCI");
-        args.add("-XX:+UseJVMCICompiler");
-
-        args.add(TestISMBL.class.getName());
-        Subprocess proc = SubprocessUtil.java(args);
-        if (proc.exitCode != 0) {
-            System.out.println(proc);
-        }
-    }
-}
-
-class TestISMBL extends CustomizedBytecodePatternTest {
+        try (TemporaryDirectory temp = new TemporaryDirectory(null, getClass().getSimpleName())) {
+            if (JavaVersionUtil.JAVA_SPEC > 8) {
+                args.add("--class-path=" + temp);
+                args.add("--patch-module=java.base=" + temp);
+            } else {
+                args.add("-Xbootclasspath/a:" + temp);
+            }
+            args.add("-XX:-TieredCompilation");
+            args.add("-XX:+UnlockExperimentalVMOptions");
+            args.add("-XX:+EnableJVMCI");
+            args.add("-XX:+UseJVMCICompiler");
 
-    public static void main(String[] args) {
-        try {
-            new TestISMBL().test();
-        } catch (Throwable e) {
-            e.printStackTrace();
-            System.exit(1);
-        }
-        System.exit(0);
-    }
+            Path invokeDir = Files.createDirectories(temp.path.resolve(Paths.get("java", "lang", "invoke")));
+            Files.write(temp.path.resolve("ISMTest.class"), generateClass("ISMTest"));
+            Files.write(invokeDir.resolve("MethodHandleHelper.class"), generateClass("java/lang/invoke/MethodHandleHelper"));
 
-    private void test() throws Throwable {
-        getClass("java/lang/invoke/MHHelper");
-        Class<?> testClass = getClass("ISMTest");
-
-        ResolvedJavaMethod mL = getResolvedJavaMethod(testClass, "mainLink");
-        ResolvedJavaMethod mI = getResolvedJavaMethod(testClass, "mainInvoke");
-        executeActual(mL, null, 100);
-        executeActual(mI, null, 100);
-    }
-
-    @Override
-    protected Class<?> getClass(String className) throws ClassNotFoundException {
-        if (className.equals("java/lang/invoke/MHHelper")) {
-            return super.getClassBL(className, MethodHandles.lookup());
-        } else {
-            return super.getClass(className);
+            args.add("ISMTest");
+            Subprocess proc = SubprocessUtil.java(args);
+            if (proc.exitCode != 0) {
+                throw new AssertionError(proc.toString());
+            }
         }
     }
 
@@ -99,7 +77,7 @@
         ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
         cw.visit(52, ACC_SUPER | ACC_PUBLIC, className, null, "java/lang/Object", null);
 
-        if (className.equals("java/lang/invoke/MHHelper")) {
+        if (className.equals("java/lang/invoke/MethodHandleHelper")) {
             MethodVisitor internalMemberName = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "internalMemberName", "(Ljava/lang/invoke/MethodHandle;)Ljava/lang/Object;", null, exceptions);
             internalMemberName.visitCode();
             internalMemberName.visitVarInsn(ALOAD, 0);
@@ -149,12 +127,12 @@
             MethodVisitor mainLink = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "mainLink", "(I)I", null, exceptions);
             mainLink.visitCode();
             mainLink.visitFieldInsn(GETSTATIC, className, "INT_MH", "Ljava/lang/invoke/MethodHandle;");
-            mainLink.visitMethodInsn(INVOKESTATIC, "java/lang/invoke/MHHelper", "internalMemberName", "(Ljava/lang/invoke/MethodHandle;)Ljava/lang/Object;", false);
+            mainLink.visitMethodInsn(INVOKESTATIC, "java/lang/invoke/MethodHandleHelper", "internalMemberName", "(Ljava/lang/invoke/MethodHandle;)Ljava/lang/Object;", false);
             mainLink.visitVarInsn(ASTORE, 1);
             mainLink.visitVarInsn(ILOAD, 0);
             mainLink.visitInsn(I2F);
             mainLink.visitVarInsn(ALOAD, 1);
-            mainLink.visitMethodInsn(INVOKESTATIC, "java/lang/invoke/MHHelper", "linkToStatic", "(FLjava/lang/Object;)I", false);
+            mainLink.visitMethodInsn(INVOKESTATIC, "java/lang/invoke/MethodHandleHelper", "linkToStatic", "(FLjava/lang/Object;)I", false);
             mainLink.visitInsn(IRETURN);
             mainLink.visitMaxs(1, 1);
             mainLink.visitEnd();
@@ -164,7 +142,7 @@
             mainInvoke.visitFieldInsn(GETSTATIC, className, "INT_MH", "Ljava/lang/invoke/MethodHandle;");
             mainInvoke.visitVarInsn(ILOAD, 0);
             mainInvoke.visitInsn(I2F);
-            mainInvoke.visitMethodInsn(INVOKESTATIC, "java/lang/invoke/MHHelper", "invokeBasicI", "(Ljava/lang/invoke/MethodHandle;F)I", false);
+            mainInvoke.visitMethodInsn(INVOKESTATIC, "java/lang/invoke/MethodHandleHelper", "invokeBasicI", "(Ljava/lang/invoke/MethodHandle;F)I", false);
             mainInvoke.visitInsn(IRETURN);
             mainInvoke.visitMaxs(1, 1);
             mainInvoke.visitEnd();
@@ -177,6 +155,19 @@
             bodyI.visitInsn(IRETURN);
             bodyI.visitMaxs(1, 1);
             bodyI.visitEnd();
+
+            MethodVisitor main = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "main", "([Ljava/lang/String;)V", null, exceptions);
+            main.visitCode();
+            main.visitIntInsn(SIPUSH, 100);
+            main.visitMethodInsn(INVOKESTATIC, "ISMTest", "mainLink", "(I)I", false);
+            main.visitInsn(POP);
+            main.visitIntInsn(SIPUSH, 100);
+            main.visitMethodInsn(INVOKESTATIC, "ISMTest", "mainInvoke", "(I)I", false);
+            main.visitInsn(POP);
+            main.visitInsn(RETURN);
+            main.visitMaxs(1, 1);
+            main.visitEnd();
+
         }
         cw.visitEnd();
         return cw.toByteArray();
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MethodSubstitutionTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MethodSubstitutionTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PEGraphDecoderTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PEGraphDecoderTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -26,6 +26,7 @@
 
 import static org.graalvm.compiler.nodes.graphbuilderconf.InlineInvokePlugin.InlineInfo.createStandardInlineInfo;
 
+import jdk.internal.vm.compiler.collections.EconomicMap;
 import org.graalvm.compiler.core.common.type.StampFactory;
 import org.graalvm.compiler.core.test.GraalCompilerTest;
 import org.graalvm.compiler.debug.DebugContext;
@@ -138,7 +139,7 @@
             registerPlugins(graphBuilderConfig.getPlugins().getInvocationPlugins());
             targetGraph = new StructuredGraph.Builder(getInitialOptions(), debug, AllowAssumptions.YES).method(testMethod).build();
             CachingPEGraphDecoder decoder = new CachingPEGraphDecoder(getTarget().arch, targetGraph, getProviders(), graphBuilderConfig, OptimisticOptimizations.NONE, AllowAssumptions.YES,
-                            null, null, new InlineInvokePlugin[]{new InlineAll()}, null, null, null, null, null);
+                            null, null, new InlineInvokePlugin[]{new InlineAll()}, null, null, null, null, null, null, EconomicMap.create());
 
             decoder.decode(testMethod, false, false);
             debug.dump(DebugContext.BASIC_LEVEL, targetGraph, "Target Graph");
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ReplacementsParseTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ReplacementsParseTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SnippetsTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SnippetsTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StandardMethodSubstitutionsTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StandardMethodSubstitutionsTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringCompareToAVX512Test.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,71 @@
+/*
+ * 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 org.graalvm.compiler.replacements.test;
+
+import org.graalvm.compiler.core.test.GraalCompilerTest;
+import org.junit.Test;
+
+// JDK-8228903
+public final class StringCompareToAVX512Test extends GraalCompilerTest {
+
+    public static int compareTo(String str1, String str2) {
+        return str1.compareTo(str2);
+    }
+
+    @Test
+    public void testLatin1VsUtf16BadStride() {
+        String latin1 = "000000001111111122222222333333334444444455555555666666667777777\u0099888888889";
+        String utf16 = "000000001111111122222222333333334444444455555555666666667777777\u0699888888889";
+        test("compareTo", latin1, utf16);
+        test("compareTo", utf16, latin1);
+    }
+
+    @Test
+    public void testLatin1VsUtf16BadStride2() {
+        String latin1 = "00000000111111112222222233333333444444445555555566666666777777778888888\u008799999999AAAAAAAAB";
+        String utf16 = "00000000111111112222222233333333444444445555555566666666777777778888888\u058799999999AAAAAAAAB";
+        test("compareTo", latin1, utf16);
+        test("compareTo", utf16, latin1);
+    }
+
+    @Test
+    public void testLatin1VsUtf16FalseEquality() {
+        // java.lang.AssertionError: expected:<-1536> but was:<0>
+        String latin1 = "00000000111111112222222233333333\u0099444444455555555";
+        String utf16 = "00000000111111112222222233333333\u0699xxxxxxxxxxxxxxx";
+        test("compareTo", latin1, utf16);
+        test("compareTo", utf16, latin1);
+    }
+
+    @Test
+    public void testLatin1BeyondRange() {
+        StringBuilder latin1Builder = new StringBuilder();
+        for (int j = 0; j <= 255; ++j) {
+            latin1Builder.append((char) j);
+        }
+        String latin1 = latin1Builder.toString();
+        test("compareTo", latin1, String.valueOf(latin1.toCharArray()));
+    }
+}
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringCompareToTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringCompareToTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringCompressInflateTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringCompressInflateTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfCharTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfCharTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -32,11 +32,8 @@
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
-@RunWith(value = Parameterized.class)
+@RunWith(Parameterized.class)
 public class StringIndexOfCharTest extends GraalCompilerTest {
-    @Parameterized.Parameter(value = 0) public String sourceString;
-    @Parameterized.Parameter(value = 1) public int constantChar;
-    @Parameterized.Parameter(value = 2) public int fromIndex;
 
     @Parameterized.Parameters(name = "{0},{1},{2}")
     public static Collection<Object[]> data() {
@@ -68,6 +65,16 @@
         return tests;
     }
 
+    private final String sourceString;
+    private final int constantChar;
+    private final int fromIndex;
+
+    public StringIndexOfCharTest(String sourceString, int constantChar, int fromIndex) {
+        this.sourceString = sourceString;
+        this.constantChar = constantChar;
+        this.fromIndex = fromIndex;
+    }
+
     public int testStringIndexOf(String a, int b) {
         return a.indexOf(b);
     }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfConstantTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfConstantTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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,6 +34,10 @@
 
 public class StringIndexOfConstantTest extends StringIndexOfTestBase {
 
+    public StringIndexOfConstantTest(String sourceString, String constantString) {
+        super(sourceString, constantString);
+    }
+
     /*
      * These test definitions could live in the superclass except that the mx junit individual test
      * runner can't find tests in superclasses.
@@ -87,6 +91,7 @@
     @Override
     protected InstalledCode getCode(final ResolvedJavaMethod installedCodeOwner, StructuredGraph graph0, boolean ignoreForceCompile, boolean ignoreInstallAsDefault, OptionValues options) {
         // Force recompile if constant binding should be done
-        return super.getCode(installedCodeOwner, graph0, /* forceCompile */true, /* installAsDefault */false, options);
+        return super.getCode(installedCodeOwner, graph0,
+                        /* forceCompile */ true, /* installAsDefault */ false, options);
     }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -27,11 +27,15 @@
 import org.junit.Test;
 
 public class StringIndexOfTest extends StringIndexOfTestBase {
+
+    public StringIndexOfTest(String sourceString, String constantString) {
+        super(sourceString, constantString);
+    }
+
     /*
      * These test definitions could live in the superclass except that the mx junit individual test
      * runner can't find tests in superclasses.
      */
-
     @Override
     @Test
     public void testStringIndexOfConstant() {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfTestBase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfTestBase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -26,19 +26,18 @@
 
 import static org.junit.Assume.assumeFalse;
 
+import java.util.ArrayList;
+import java.util.Collection;
+
 import org.graalvm.compiler.core.test.GraalCompilerTest;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
-import java.util.ArrayList;
-import java.util.Collection;
 import jdk.vm.ci.aarch64.AArch64;
 
 @RunWith(value = Parameterized.class)
 public abstract class StringIndexOfTestBase extends GraalCompilerTest {
-    @Parameterized.Parameter(value = 0) public String sourceString;
-    @Parameterized.Parameter(value = 1) public String constantString;
 
     @Parameterized.Parameters(name = "{0},{1}")
     public static Collection<Object[]> data() {
@@ -91,6 +90,14 @@
         }
     }
 
+    protected final String sourceString;
+    protected final String constantString;
+
+    public StringIndexOfTestBase(String sourceString, String constantString) {
+        this.sourceString = sourceString;
+        this.constantString = constantString;
+    }
+
     public int testStringIndexOf(String a, String b) {
         return a.indexOf(b);
     }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringSubstitutionTestBase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringSubstitutionTestBase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringSubstitutionsTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringSubstitutionsTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SubstitutionNodeSourcePositionTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SubstitutionNodeSourcePositionTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SubstitutionsTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SubstitutionsTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/ClassfileBytecodeProviderTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/ClassfileBytecodeProviderTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -87,6 +87,7 @@
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
 
+import org.graalvm.compiler.test.ModuleSupport;
 import org.graalvm.compiler.test.SubprocessUtil;
 import org.junit.Assert;
 import org.junit.Assume;
@@ -146,6 +147,12 @@
      */
     private static final int CLASSES_PER_JAR = 250;
 
+    /**
+     * Magic token to denote the classes in the Java runtime image (i.e. in the {@code jrt:/} file
+     * system).
+     */
+    public static final String JRT_CLASS_PATH_ENTRY = "<jrt>";
+
     @Test
     public void test() {
         RuntimeProvider rt = Graal.getRequiredCapability(RuntimeProvider.class);
@@ -153,42 +160,62 @@
         MetaAccessProvider metaAccess = providers.getMetaAccess();
 
         Assume.assumeTrue(VerifyPhase.class.desiredAssertionStatus());
-
-        String propertyName = JavaVersionUtil.JAVA_SPEC <= 8 ? "sun.boot.class.path" : "jdk.module.path";
-        String bootclasspath = System.getProperty(propertyName);
-        Assert.assertNotNull("Cannot find value of " + propertyName, bootclasspath);
+        String bootclasspath;
+        if (JavaVersionUtil.JAVA_SPEC <= 8) {
+            String propertyName = "sun.boot.class.path";
+            bootclasspath = System.getProperty(propertyName);
+            Assert.assertNotNull("Cannot find value of " + propertyName, bootclasspath);
+        } else {
+            bootclasspath = JRT_CLASS_PATH_ENTRY;
+        }
 
         for (String path : bootclasspath.split(File.pathSeparator)) {
             if (shouldProcess(path)) {
                 try {
-                    final ZipFile zipFile = new ZipFile(new File(path));
-                    int index = 0;
-                    int step = zipFile.size() > CLASSES_PER_JAR ? zipFile.size() / CLASSES_PER_JAR : 1;
-                    for (final Enumeration<? extends ZipEntry> entry = zipFile.entries(); entry.hasMoreElements();) {
-                        final ZipEntry zipEntry = entry.nextElement();
-                        if ((index % step) == 0) {
-                            String name = zipEntry.getName();
-                            if (name.endsWith(".class") && !name.equals("module-info.class") && !name.startsWith("META-INF/versions/")) {
-                                String className = name.substring(0, name.length() - ".class".length()).replace('/', '.');
-                                if (isInNativeImage(className)) {
-                                    /*
-                                     * Native image requires non-graalsdk classes to be present in
-                                     * the classpath.
-                                     */
-                                    continue;
-                                }
-                                if (isGSON(className)) {
-                                    /* uses old class format */
-                                    continue;
-                                }
-                                try {
-                                    checkClass(metaAccess, getSnippetReflection(), className);
-                                } catch (ClassNotFoundException e) {
-                                    throw new AssertionError(e);
+                    if (path.equals(JRT_CLASS_PATH_ENTRY)) {
+                        for (String className : ModuleSupport.getJRTGraalClassNames()) {
+                            if (isGSON(className)) {
+                                /*
+                                 * GSON classes are compiled with old JDK
+                                 */
+                                continue;
+                            }
+                            try {
+                                checkClass(metaAccess, getSnippetReflection(), className);
+                            } catch (ClassNotFoundException e) {
+                                throw new AssertionError(e);
+                            }
+                        }
+                    } else {
+                        final ZipFile zipFile = new ZipFile(new File(path));
+                        int index = 0;
+                        int step = zipFile.size() > CLASSES_PER_JAR ? zipFile.size() / CLASSES_PER_JAR : 1;
+                        for (final Enumeration<? extends ZipEntry> entry = zipFile.entries(); entry.hasMoreElements();) {
+                            final ZipEntry zipEntry = entry.nextElement();
+                            if ((index % step) == 0) {
+                                String name = zipEntry.getName();
+                                if (name.endsWith(".class") && !name.equals("module-info.class") && !name.startsWith("META-INF/versions/")) {
+                                    String className = name.substring(0, name.length() - ".class".length()).replace('/', '.');
+                                    if (isInNativeImage(className)) {
+                                        /*
+                                         * Native image requires non-graalsdk classes to be present
+                                         * in the classpath.
+                                         */
+                                        continue;
+                                    }
+                                    if (isGSON(className)) {
+                                        /* uses old class format */
+                                        continue;
+                                    }
+                                    try {
+                                        checkClass(metaAccess, getSnippetReflection(), className);
+                                    } catch (ClassNotFoundException e) {
+                                        throw new AssertionError(e);
+                                    }
                                 }
                             }
+                            index++;
                         }
-                        index++;
                     }
                 } catch (IOException ex) {
                     Assert.fail(ex.toString());
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/RedefineIntrinsicTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/RedefineIntrinsicTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -55,6 +55,7 @@
 import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration;
 import org.graalvm.compiler.replacements.test.ReplacementsTest;
 import org.graalvm.compiler.serviceprovider.JavaVersionUtil;
+import org.graalvm.compiler.test.SubprocessUtil;
 import org.graalvm.compiler.test.SubprocessUtil.Subprocess;
 import org.junit.Assert;
 import org.junit.Test;
@@ -116,6 +117,7 @@
         } else {
             List<String> vmArgs = withoutDebuggerArguments(getVMCommandLine());
             vmArgs.add("-D" + recursionPropName + "=true");
+            vmArgs.addAll(SubprocessUtil.getPackageOpeningOptions());
             vmArgs.add("-Djdk.attach.allowAttachSelf=true");
             Subprocess proc = java(vmArgs, "com.oracle.mxtool.junit.MxJUnitWrapper", getClass().getName());
             if (proc.exitCode != 0) {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraySubstitutions.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraySubstitutions.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -29,6 +29,7 @@
 import org.graalvm.compiler.api.replacements.ClassSubstitution;
 import org.graalvm.compiler.api.replacements.MethodSubstitution;
 import org.graalvm.compiler.nodes.DeoptimizeNode;
+import org.graalvm.compiler.nodes.extended.BranchProbabilityNode;
 import org.graalvm.compiler.nodes.java.ArrayLengthNode;
 
 import jdk.vm.ci.meta.DeoptimizationAction;
@@ -44,7 +45,7 @@
 
     @MethodSubstitution
     public static int getLength(Object array) {
-        if (!array.getClass().isArray()) {
+        if (BranchProbabilityNode.probability(BranchProbabilityNode.DEOPT_PROBABILITY, !array.getClass().isArray())) {
             DeoptimizeNode.deopt(DeoptimizationAction.None, DeoptimizationReason.RuntimeConstraint);
         }
         return ArrayLengthNode.arrayLength(array);
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/CachingPEGraphDecoder.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/CachingPEGraphDecoder.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -71,17 +71,17 @@
     public CachingPEGraphDecoder(Architecture architecture, StructuredGraph graph, Providers providers, GraphBuilderConfiguration graphBuilderConfig, OptimisticOptimizations optimisticOpts,
                     AllowAssumptions allowAssumptions, LoopExplosionPlugin loopExplosionPlugin, InvocationPlugins invocationPlugins, InlineInvokePlugin[] inlineInvokePlugins,
                     ParameterPlugin parameterPlugin,
-                    NodePlugin[] nodePlugins, ResolvedJavaMethod callInlinedMethod, SourceLanguagePositionProvider sourceLanguagePositionProvider,
-                    BasePhase<? super CoreProviders> postParsingPhase) {
+                    NodePlugin[] nodePlugins, ResolvedJavaMethod callInlinedMethod, ResolvedJavaMethod callInlinedAgnosticMethod, SourceLanguagePositionProvider sourceLanguagePositionProvider,
+                    BasePhase<? super CoreProviders> postParsingPhase, EconomicMap<ResolvedJavaMethod, EncodedGraph> graphCache) {
         super(architecture, graph, providers, loopExplosionPlugin,
-                        invocationPlugins, inlineInvokePlugins, parameterPlugin, nodePlugins, callInlinedMethod, sourceLanguagePositionProvider);
+                        invocationPlugins, inlineInvokePlugins, parameterPlugin, nodePlugins, callInlinedMethod, callInlinedAgnosticMethod, sourceLanguagePositionProvider);
 
         this.providers = providers;
         this.graphBuilderConfig = graphBuilderConfig;
         this.optimisticOpts = optimisticOpts;
         this.allowAssumptions = allowAssumptions;
+        this.graphCache = graphCache;
         this.postParsingPhase = postParsingPhase;
-        this.graphCache = EconomicMap.create();
     }
 
     protected GraphBuilderPhase.Instance createGraphBuilderPhaseInstance(IntrinsicContext initialIntrinsicContext) {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ConstantBindingParameterPlugin.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ConstantBindingParameterPlugin.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ConstantStringIndexOfSnippets.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ConstantStringIndexOfSnippets.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/DefaultJavaLoweringProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/DefaultJavaLoweringProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,11 +43,13 @@
 import java.util.BitSet;
 import java.util.List;
 
+import jdk.vm.ci.meta.JavaConstant;
 import org.graalvm.compiler.api.directives.GraalDirectives;
 import org.graalvm.compiler.api.replacements.Snippet;
 import org.graalvm.compiler.api.replacements.SnippetReflectionProvider;
 import org.graalvm.compiler.core.common.LIRKind;
 import org.graalvm.compiler.core.common.spi.ForeignCallsProvider;
+import org.graalvm.compiler.core.common.type.AbstractPointerStamp;
 import org.graalvm.compiler.core.common.type.IntegerStamp;
 import org.graalvm.compiler.core.common.type.ObjectStamp;
 import org.graalvm.compiler.core.common.type.Stamp;
@@ -60,14 +62,20 @@
 import org.graalvm.compiler.nodeinfo.InputType;
 import org.graalvm.compiler.nodes.CompressionNode.CompressionOp;
 import org.graalvm.compiler.nodes.ConstantNode;
+import org.graalvm.compiler.nodes.EndNode;
 import org.graalvm.compiler.nodes.FieldLocationIdentity;
 import org.graalvm.compiler.nodes.FixedNode;
+import org.graalvm.compiler.nodes.FixedWithNextNode;
+import org.graalvm.compiler.nodes.IfNode;
 import org.graalvm.compiler.nodes.LogicNode;
+import org.graalvm.compiler.nodes.MergeNode;
 import org.graalvm.compiler.nodes.NamedLocationIdentity;
 import org.graalvm.compiler.nodes.NodeView;
+import org.graalvm.compiler.nodes.PhiNode;
 import org.graalvm.compiler.nodes.PiNode;
 import org.graalvm.compiler.nodes.StructuredGraph;
 import org.graalvm.compiler.nodes.ValueNode;
+import org.graalvm.compiler.nodes.ValuePhiNode;
 import org.graalvm.compiler.nodes.calc.AddNode;
 import org.graalvm.compiler.nodes.calc.ConditionalNode;
 import org.graalvm.compiler.nodes.calc.IntegerBelowNode;
@@ -91,6 +99,7 @@
 import org.graalvm.compiler.nodes.extended.JavaWriteNode;
 import org.graalvm.compiler.nodes.extended.LoadArrayComponentHubNode;
 import org.graalvm.compiler.nodes.extended.LoadHubNode;
+import org.graalvm.compiler.nodes.extended.LoadHubOrNullNode;
 import org.graalvm.compiler.nodes.extended.MembarNode;
 import org.graalvm.compiler.nodes.extended.RawLoadNode;
 import org.graalvm.compiler.nodes.extended.RawStoreNode;
@@ -210,6 +219,8 @@
                 lowerArrayLengthNode((ArrayLengthNode) n, tool);
             } else if (n instanceof LoadHubNode) {
                 lowerLoadHubNode((LoadHubNode) n, tool);
+            } else if (n instanceof LoadHubOrNullNode) {
+                lowerLoadHubOrNullNode((LoadHubOrNullNode) n, tool);
             } else if (n instanceof LoadArrayComponentHubNode) {
                 lowerLoadArrayComponentHubNode((LoadArrayComponentHubNode) n);
             } else if (n instanceof MonitorEnterNode) {
@@ -558,6 +569,36 @@
         loadHub.replaceAtUsagesAndDelete(hub);
     }
 
+    protected void lowerLoadHubOrNullNode(LoadHubOrNullNode loadHubOrNullNode, LoweringTool tool) {
+        StructuredGraph graph = loadHubOrNullNode.graph();
+        if (tool.getLoweringStage() != LoweringTool.StandardLoweringStage.LOW_TIER) {
+            return;
+        }
+        if (graph.getGuardsStage().allowsFloatingGuards()) {
+            return;
+        }
+        final FixedWithNextNode predecessor = tool.lastFixedNode();
+        final ValueNode value = loadHubOrNullNode.getValue();
+        AbstractPointerStamp stamp = (AbstractPointerStamp) value.stamp(NodeView.DEFAULT);
+        final LogicNode isNull = graph.addOrUniqueWithInputs(IsNullNode.create(value));
+        final EndNode trueEnd = graph.add(new EndNode());
+        final EndNode falseEnd = graph.add(new EndNode());
+        final IfNode ifNode = graph.add(new IfNode(isNull, trueEnd, falseEnd, 0.5));
+        final MergeNode merge = graph.add(new MergeNode());
+        merge.addForwardEnd(trueEnd);
+        merge.addForwardEnd(falseEnd);
+        final AbstractPointerStamp hubStamp = (AbstractPointerStamp) loadHubOrNullNode.stamp(NodeView.DEFAULT);
+        ValueNode nullHub = ConstantNode.forConstant(hubStamp.asAlwaysNull(), JavaConstant.NULL_POINTER, tool.getMetaAccess(), graph);
+        final ValueNode nonNullValue = graph.addOrUniqueWithInputs(PiNode.create(value, stamp.asNonNull(), ifNode.falseSuccessor()));
+        ValueNode hub = createReadHub(graph, nonNullValue, tool);
+        ValueNode[] values = new ValueNode[]{nullHub, hub};
+        final PhiNode hubPhi = graph.unique(new ValuePhiNode(hubStamp, merge, values));
+        final FixedNode oldNext = predecessor.next();
+        predecessor.setNext(ifNode);
+        merge.setNext(oldNext);
+        loadHubOrNullNode.replaceAtUsagesAndDelete(hubPhi);
+    }
+
     protected void lowerLoadArrayComponentHubNode(LoadArrayComponentHubNode loadHub) {
         StructuredGraph graph = loadHub.graph();
         ValueNode hub = createReadArrayComponentHub(graph, loadHub.getValue(), loadHub);
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/GraphKit.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/GraphKit.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InlineDuringParsingPlugin.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InlineDuringParsingPlugin.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntrinsicGraphBuilder.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntrinsicGraphBuilder.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/MethodHandlePlugin.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/MethodHandlePlugin.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -98,7 +98,7 @@
                     inlineEverything = args.length != argumentsList.size();
                 }
                 ResolvedJavaMethod targetMethod = callTarget.targetMethod();
-                if (inlineEverything && !targetMethod.hasBytecodes()) {
+                if (inlineEverything && !targetMethod.hasBytecodes() && !b.getReplacements().hasSubstitution(targetMethod, b.bci())) {
                     // we need to force-inline but we can not, leave the invoke as-is
                     return false;
                 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/PEGraphDecoder.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/PEGraphDecoder.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -274,7 +274,7 @@
                     int count = 0;
                     PEGraphDecoder.PEMethodScope scope = methodScope;
                     while (scope != null) {
-                        if (scope.method.equals(callInlinedMethod)) {
+                        if (scope.method.equals(callInlinedMethod) || scope.method.equals(callInlinedAgnosticMethod)) {
                             count++;
                         }
                         scope = scope.caller;
@@ -301,7 +301,7 @@
          */
         @Override
         public boolean canDeferPlugin(GeneratedInvocationPlugin plugin) {
-            return plugin.getSource().equals(Fold.class) || plugin.getSource().equals(Node.NodeIntrinsic.class);
+            return plugin.isGeneratedFromFoldOrNodeIntrinsic();
         }
 
         @Override
@@ -585,18 +585,20 @@
     private final EconomicMap<SpecialCallTargetCacheKey, Object> specialCallTargetCache;
     private final EconomicMap<ResolvedJavaMethod, Object> invocationPluginCache;
     private final ResolvedJavaMethod callInlinedMethod;
+    private final ResolvedJavaMethod callInlinedAgnosticMethod;
     protected final SourceLanguagePositionProvider sourceLanguagePositionProvider;
 
     public PEGraphDecoder(Architecture architecture, StructuredGraph graph, CoreProviders providers, LoopExplosionPlugin loopExplosionPlugin, InvocationPlugins invocationPlugins,
                     InlineInvokePlugin[] inlineInvokePlugins,
                     ParameterPlugin parameterPlugin,
-                    NodePlugin[] nodePlugins, ResolvedJavaMethod callInlinedMethod, SourceLanguagePositionProvider sourceLanguagePositionProvider) {
+                    NodePlugin[] nodePlugins, ResolvedJavaMethod callInlinedMethod, ResolvedJavaMethod callInlinedAgnosticMethod, SourceLanguagePositionProvider sourceLanguagePositionProvider) {
         super(architecture, graph, providers, true);
         this.loopExplosionPlugin = loopExplosionPlugin;
         this.invocationPlugins = invocationPlugins;
         this.inlineInvokePlugins = inlineInvokePlugins;
         this.parameterPlugin = parameterPlugin;
         this.nodePlugins = nodePlugins;
+        this.callInlinedAgnosticMethod = callInlinedAgnosticMethod;
         this.specialCallTargetCache = EconomicMap.create(Equivalence.DEFAULT);
         this.invocationPluginCache = EconomicMap.create(Equivalence.DEFAULT);
         this.callInlinedMethod = callInlinedMethod;
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsImpl.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsImpl.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounter.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounter.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounterNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounterNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetTemplate.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetTemplate.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/TargetGraphBuilderPlugins.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,35 @@
+/*
+ * 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 org.graalvm.compiler.replacements;
+
+import org.graalvm.compiler.bytecode.BytecodeProvider;
+import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins;
+
+import jdk.vm.ci.code.Architecture;
+
+public interface TargetGraphBuilderPlugins {
+    void register(Plugins plugins, BytecodeProvider replacementsBytecodeProvider, Architecture arch, boolean explicitUnsafeNullChecks, boolean registerMathPlugins, boolean emitJDK9StringSubstitutions,
+                    boolean useFMAIntrinsics);
+}
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/arraycopy/ArrayCopyCallNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/arraycopy/ArrayCopyCallNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/arraycopy/ArrayCopySnippets.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/arraycopy/ArrayCopySnippets.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -25,10 +25,12 @@
 package org.graalvm.compiler.replacements.arraycopy;
 
 import static jdk.vm.ci.services.Services.IS_BUILDING_NATIVE_IMAGE;
+import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC;
 import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.FREQUENT_PROBABILITY;
 import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.LIKELY_PROBABILITY;
 import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.NOT_FREQUENT_PROBABILITY;
 import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.SLOW_PATH_PROBABILITY;
+import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.DEOPT_PROBABILITY;
 import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.probability;
 
 import java.util.EnumMap;
@@ -210,7 +212,7 @@
             Object nonNullDest = PiNode.asNonNullObject(dest);
             Pointer srcKlass = loadHub(nonNullSrc);
             Pointer destKlass = loadHub(nonNullDest);
-            if (probability(LIKELY_PROBABILITY, srcKlass == destKlass)) {
+            if (probability(LIKELY_PROBABILITY, srcKlass == destKlass) || probability(LIKELY_PROBABILITY, nonNullDest.getClass() == Object[].class)) {
                 // no storecheck required.
                 counters.objectCheckcastSameTypeCounter.inc();
                 counters.objectCheckcastSameTypeCopiedCounter.add(length);
@@ -222,15 +224,7 @@
                 counters.objectCheckcastDifferentTypeCounter.inc();
                 counters.objectCheckcastDifferentTypeCopiedCounter.add(length);
 
-                int copiedElements = CheckcastArrayCopyCallNode.checkcastArraycopy(nonNullSrc, srcPos, nonNullDest, destPos, length, superCheckOffset, destElemKlass, false);
-                if (probability(SLOW_PATH_PROBABILITY, copiedElements != 0)) {
-                    /*
-                     * the stub doesn't throw the ArrayStoreException, but returns the number of
-                     * copied elements (xor'd with -1).
-                     */
-                    copiedElements ^= -1;
-                    System.arraycopy(nonNullSrc, srcPos + copiedElements, nonNullDest, destPos + copiedElements, length - copiedElements);
-                }
+                System.arraycopy(nonNullSrc, srcPos, nonNullDest, destPos, length);
             }
         }
     }
@@ -261,12 +255,27 @@
         }
     }
 
+    /**
+     * Writing this as individual if statements to avoid a merge without a frame state.
+     */
     private static void checkLimits(Object src, int srcPos, Object dest, int destPos, int length, Counters counters) {
-        if (probability(SLOW_PATH_PROBABILITY, srcPos < 0) ||
-                        probability(SLOW_PATH_PROBABILITY, destPos < 0) ||
-                        probability(SLOW_PATH_PROBABILITY, length < 0) ||
-                        probability(SLOW_PATH_PROBABILITY, srcPos > ArrayLengthNode.arrayLength(src) - length) ||
-                        probability(SLOW_PATH_PROBABILITY, destPos > ArrayLengthNode.arrayLength(dest) - length)) {
+        if (probability(DEOPT_PROBABILITY, srcPos < 0)) {
+            counters.checkAIOOBECounter.inc();
+            DeoptimizeNode.deopt(DeoptimizationAction.None, DeoptimizationReason.RuntimeConstraint);
+        }
+        if (probability(DEOPT_PROBABILITY, destPos < 0)) {
+            counters.checkAIOOBECounter.inc();
+            DeoptimizeNode.deopt(DeoptimizationAction.None, DeoptimizationReason.RuntimeConstraint);
+        }
+        if (probability(DEOPT_PROBABILITY, length < 0)) {
+            counters.checkAIOOBECounter.inc();
+            DeoptimizeNode.deopt(DeoptimizationAction.None, DeoptimizationReason.RuntimeConstraint);
+        }
+        if (probability(DEOPT_PROBABILITY, srcPos > ArrayLengthNode.arrayLength(src) - length)) {
+            counters.checkAIOOBECounter.inc();
+            DeoptimizeNode.deopt(DeoptimizationAction.None, DeoptimizationReason.RuntimeConstraint);
+        }
+        if (probability(DEOPT_PROBABILITY, destPos > ArrayLengthNode.arrayLength(dest) - length)) {
             counters.checkAIOOBECounter.inc();
             DeoptimizeNode.deopt(DeoptimizationAction.None, DeoptimizationReason.RuntimeConstraint);
         }
@@ -279,13 +288,13 @@
         } else if (arrayTypeCheck == ArrayCopyTypeCheck.HUB_BASED_ARRAY_TYPE_CHECK) {
             Pointer srcHub = loadHub(nonNullSrc);
             Pointer destHub = loadHub(nonNullDest);
-            if (probability(SLOW_PATH_PROBABILITY, srcHub != destHub)) {
+            if (probability(DEOPT_PROBABILITY, srcHub != destHub)) {
                 DeoptimizeNode.deopt(DeoptimizationAction.None, DeoptimizationReason.RuntimeConstraint);
             }
         } else if (arrayTypeCheck == ArrayCopyTypeCheck.LAYOUT_HELPER_BASED_ARRAY_TYPE_CHECK) {
             Pointer srcHub = loadHub(nonNullSrc);
             Pointer destHub = loadHub(nonNullDest);
-            if (probability(SLOW_PATH_PROBABILITY, getReadLayoutHelper(srcHub) != getReadLayoutHelper(destHub))) {
+            if (probability(DEOPT_PROBABILITY, getReadLayoutHelper(srcHub) != getReadLayoutHelper(destHub))) {
                 DeoptimizeNode.deopt(DeoptimizationAction.None, DeoptimizationReason.RuntimeConstraint);
             }
         } else {
@@ -413,6 +422,10 @@
                     snippetInfo = arraycopyGenericSnippet;
                     // no need for additional type check to avoid duplicated work
                     arrayTypeCheck = ArrayCopyTypeCheck.NO_ARRAY_TYPE_CHECK;
+                } else if (GeneratePIC.getValue(options)) {
+                    // use generic copying for AOT compilation
+                    snippetInfo = arraycopyGenericSnippet;
+                    arrayTypeCheck = ArrayCopyTypeCheck.NO_ARRAY_TYPE_CHECK;
                 } else if (srcComponentType != null && destComponentType != null) {
                     if (!srcComponentType.isPrimitive() && !destComponentType.isPrimitive()) {
                         // it depends on the array content if the copy succeeds - we need
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecodeProvider.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecodeProvider.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayEqualsNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayEqualsNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -232,12 +232,7 @@
                 return;
             }
         }
-
-        int constantLength = -1;
-        if (length.isConstant()) {
-            constantLength = length.asJavaConstant().asInt();
-        }
-        Value result = gen.getLIRGeneratorTool().emitArrayEquals(kind, gen.operand(array1), gen.operand(array2), gen.operand(length), constantLength, false);
+        Value result = gen.getLIRGeneratorTool().emitArrayEquals(kind, gen.operand(array1), gen.operand(array2), gen.operand(length), false);
         gen.setResult(this, result);
     }
 
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayRegionEqualsNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayRegionEqualsNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -110,16 +110,11 @@
                 return;
             }
         }
-
-        int constantLength = -1;
-        if (length.isConstant()) {
-            constantLength = length.asJavaConstant().asInt();
-        }
         Value result;
         if (kind1 == kind2) {
-            result = gen.getLIRGeneratorTool().emitArrayEquals(kind1, gen.operand(array1), gen.operand(array2), gen.operand(length), constantLength, true);
+            result = gen.getLIRGeneratorTool().emitArrayEquals(kind1, gen.operand(array1), gen.operand(array2), gen.operand(length), true);
         } else {
-            result = gen.getLIRGeneratorTool().emitArrayEquals(kind1, kind2, gen.operand(array1), gen.operand(array2), gen.operand(length), constantLength, true);
+            result = gen.getLIRGeneratorTool().emitArrayEquals(kind1, kind2, gen.operand(array1), gen.operand(array2), gen.operand(length), true);
         }
         gen.setResult(this, result);
     }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicArrayCopyNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicArrayCopyNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -144,7 +144,8 @@
     }
 
     private static boolean checkBounds(int position, int length, VirtualObjectNode virtualObject) {
-        return position >= 0 && position + length <= virtualObject.entryCount();
+        assert length >= 0;
+        return position >= 0 && position <= virtualObject.entryCount() - length;
     }
 
     private static boolean checkEntryTypes(int srcPos, int length, VirtualObjectNode src, ResolvedJavaType destComponentType, VirtualizerTool tool) {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicObjectCloneNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicObjectCloneNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MethodHandleNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MethodHandleNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReadRegisterNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReadRegisterNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/WriteRegisterNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/WriteRegisterNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ZeroMemoryNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ZeroMemoryNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -60,7 +60,7 @@
 
     @Override
     public void generate(NodeLIRBuilderTool gen) {
-        gen.getLIRGeneratorTool().getArithmetic().emitZeroMemory(gen.operand(getAddress()), gen.operand(length));
+        gen.getLIRGeneratorTool().emitZeroMemory(gen.operand(getAddress()), gen.operand(length));
     }
 
     @Override
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -33,6 +33,7 @@
 import org.graalvm.compiler.core.common.type.IntegerStamp;
 import org.graalvm.compiler.core.common.type.Stamp;
 import org.graalvm.compiler.core.common.type.StampFactory;
+import org.graalvm.compiler.graph.IterableNodeType;
 import org.graalvm.compiler.graph.NodeClass;
 import org.graalvm.compiler.graph.spi.CanonicalizerTool;
 import org.graalvm.compiler.nodeinfo.InputType;
@@ -53,7 +54,7 @@
  * case the addition would overflow the 32 bit range.
  */
 @NodeInfo(cycles = CYCLES_2, size = SIZE_2)
-public final class IntegerAddExactNode extends AddNode implements GuardedNode, IntegerExactArithmeticNode {
+public final class IntegerAddExactNode extends AddNode implements GuardedNode, IntegerExactArithmeticNode, IterableNodeType {
     public static final NodeClass<IntegerAddExactNode> TYPE = NodeClass.create(IntegerAddExactNode.class);
 
     @Input(InputType.Guard) protected GuardingNode guard;
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticSplitNode.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticSplitNode.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/GraalServices.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/GraalServices.java	Wed Sep 25 22:40:41 2019 +0200
@@ -89,13 +89,8 @@
             synchronized (servicesCache) {
                 ArrayList<S> providersList = new ArrayList<>();
                 for (S provider : providers) {
-                    /*
-                     * When building libgraal, we want providers that comes from the Graal community
-                     * and enterprise modules but not those available on the native-image class
-                     * path.
-                     */
                     Module module = provider.getClass().getModule();
-                    if (module.isNamed()) {
+                    if (isHotSpotGraalModule(module.getName())) {
                         providersList.add(provider);
                     }
                 }
@@ -108,8 +103,29 @@
         return providers;
     }
 
+    /**
+     * Determines if the module named by {@code name} is part of Graal when it is configured as a
+     * HotSpot JIT compiler.
+     */
+    private static boolean isHotSpotGraalModule(String name) {
+        if (name != null) {
+            return name.equals("jdk.internal.vm.compiler") ||
+                            name.equals("jdk.internal.vm.compiler.management") ||
+                            name.equals("com.oracle.graal.graal_enterprise");
+        }
+        return false;
+    }
+
     protected static <S> Iterable<S> load0(Class<S> service) {
-        Iterable<S> iterable = ServiceLoader.load(service);
+        Module module = GraalServices.class.getModule();
+        // Graal cannot know all the services used by another module
+        // (e.g. enterprise) so dynamically register the service use now.
+        if (!module.canUse(service)) {
+            module.addUses(service);
+        }
+
+        ModuleLayer layer = module.getLayer();
+        Iterable<S> iterable = ServiceLoader.load(layer, service);
         return new Iterable<>() {
             @Override
             public Iterator<S> iterator() {
@@ -220,6 +236,10 @@
      * trusted code.
      */
     public static boolean isToStringTrusted(Class<?> c) {
+        if (IS_IN_NATIVE_IMAGE) {
+            return true;
+        }
+
         Module module = c.getModule();
         Module jvmciModule = JVMCI_MODULE;
         assert jvmciModule.getPackages().contains("jdk.vm.ci.runtime");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/SpeculationEncodingAdapter.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,121 @@
+/*
+ * 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 org.graalvm.compiler.serviceprovider;
+
+import java.util.ArrayList;
+
+import jdk.vm.ci.code.BytecodePosition;
+
+class SpeculationEncodingAdapter implements SpeculationReasonGroup.SpeculationContextObject.Visitor {
+    private ArrayList<Object> objects;
+
+    SpeculationEncodingAdapter() {
+        this.objects = null;
+    }
+
+    Object[] flatten(Object[] context) {
+        boolean flatten = false;
+        for (Object c : context) {
+            if (c instanceof SpeculationReasonGroup.SpeculationContextObject || (c != null && c.getClass() == BytecodePosition.class)) {
+                // Needs extra work to flatten the representation
+                flatten = true;
+                break;
+            }
+        }
+        if (!flatten) {
+            return context;
+        }
+        objects = new ArrayList<>();
+        for (Object c : context) {
+            if (c instanceof SpeculationReasonGroup.SpeculationContextObject) {
+                SpeculationReasonGroup.SpeculationContextObject sco = (SpeculationReasonGroup.SpeculationContextObject) c;
+                // These are compiler objects which all have the same class
+                // loader so the class name uniquely identifies the class.
+                objects.add(c.getClass().getName());
+                sco.accept(this);
+            } else if (c != null && c.getClass() == BytecodePosition.class) {
+                BytecodePosition p = (BytecodePosition) c;
+                objects.add(c.getClass().getName());
+                while (p != null) {
+                    visitInt(p.getBCI());
+                    objects.add(p.getMethod());
+                    p = p.getCaller();
+                }
+            } else {
+                objects.add(c);
+            }
+        }
+        return objects.toArray();
+    }
+
+    @Override
+    public void visitBoolean(boolean v) {
+        objects.add((byte) (v ? 1 : 0));
+    }
+
+    @Override
+    public void visitByte(byte v) {
+        objects.add(v);
+    }
+
+    @Override
+    public void visitChar(char v) {
+        objects.add(v);
+    }
+
+    @Override
+    public void visitShort(short v) {
+        objects.add(v);
+    }
+
+    @Override
+    public void visitInt(int v) {
+        objects.add(v);
+    }
+
+    @Override
+    public void visitLong(long v) {
+        objects.add(v);
+    }
+
+    @Override
+    public void visitFloat(float v) {
+        objects.add(Float.floatToRawIntBits(v));
+    }
+
+    @Override
+    public void visitDouble(double v) {
+        objects.add(Double.doubleToRawLongBits(v));
+    }
+
+    @Override
+    public void visitObject(Object v) {
+        if (v == null) {
+            objects.add(0);
+        } else {
+            objects.add(v);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/UnencodedSpeculationReason.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,63 @@
+/*
+ * 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 org.graalvm.compiler.serviceprovider;
+
+import java.util.Arrays;
+
+import jdk.vm.ci.meta.SpeculationLog.SpeculationReason;
+
+/**
+ * An implementation of {@link SpeculationReason} based on direct, unencoded values.
+ */
+public final class UnencodedSpeculationReason implements SpeculationReason {
+    final int groupId;
+    final String groupName;
+    final Object[] context;
+
+    UnencodedSpeculationReason(int groupId, String groupName, Object[] context) {
+        this.groupId = groupId;
+        this.groupName = groupName;
+        this.context = context;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj instanceof UnencodedSpeculationReason) {
+            UnencodedSpeculationReason that = (UnencodedSpeculationReason) obj;
+            return this.groupId == that.groupId && Arrays.equals(this.context, that.context);
+        }
+        return false;
+    }
+
+    @Override
+    public int hashCode() {
+        return groupId + Arrays.hashCode(this.context);
+    }
+
+    @Override
+    public String toString() {
+        return String.format("%s@%d%s", groupName, groupId, Arrays.toString(context));
+    }
+}
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/ExportingClassLoader.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/ExportingClassLoader.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -24,23 +24,17 @@
 
 package org.graalvm.compiler.test;
 
-import org.graalvm.compiler.serviceprovider.JavaVersionUtil;
-
 /**
  * A class loader that exports all packages in the module defining the class loader to all classes
  * in the unnamed module associated with the loader.
  */
 public class ExportingClassLoader extends ClassLoader {
     public ExportingClassLoader() {
-        if (JavaVersionUtil.JAVA_SPEC > 8) {
-            JLModule.fromClass(getClass()).exportAllPackagesTo(JLModule.getUnnamedModuleFor(this));
-        }
+        ModuleSupport.exportAllPackagesTo(getClass(), this);
     }
 
     public ExportingClassLoader(ClassLoader parent) {
         super(parent);
-        if (JavaVersionUtil.JAVA_SPEC > 8) {
-            JLModule.fromClass(getClass()).exportAllPackagesTo(JLModule.getUnnamedModuleFor(this));
-        }
+        ModuleSupport.exportAllPackagesTo(getClass(), this);
     }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/GraalTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/GraalTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -35,8 +35,10 @@
 import java.nio.file.FileVisitResult;
 import java.nio.file.Files;
 import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.nio.file.SimpleFileVisitor;
 import java.nio.file.attribute.BasicFileAttributes;
+import java.nio.file.attribute.FileAttribute;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -458,7 +460,7 @@
         Runtime.getRuntime().addShutdownHook(new Thread("GlobalMetricsPrinter") {
             @Override
             public void run() {
-                globalMetrics.print(new OptionValues(OptionValues.newOptionMap()));
+                // globalMetrics.print(new OptionValues(OptionValues.newOptionMap()));
             }
         });
     }
@@ -506,6 +508,30 @@
         return createTimeout(milliseconds, TimeUnit.MILLISECONDS);
     }
 
+    public static class TemporaryDirectory implements AutoCloseable {
+
+        public final Path path;
+        private IOException closeException;
+
+        public TemporaryDirectory(Path dir, String prefix, FileAttribute<?>... attrs) throws IOException {
+            path = Files.createTempDirectory(dir == null ? Paths.get(".") : dir, prefix, attrs);
+        }
+
+        @Override
+        public void close() {
+            closeException = removeDirectory(path);
+        }
+
+        public IOException getCloseException() {
+            return closeException;
+        }
+
+        @Override
+        public String toString() {
+            return path.toString();
+        }
+    }
+
     /**
      * Tries to recursively remove {@code directory}. If it fails with an {@link IOException}, the
      * exception's {@code toString()} is printed to {@link System#err} and the exception is
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/JLModule.java	Mon Sep 23 09:16:05 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,221 +0,0 @@
-/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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 org.graalvm.compiler.test;
-
-import java.lang.reflect.AccessibleObject;
-import java.lang.reflect.Method;
-import java.util.Set;
-
-import org.graalvm.compiler.serviceprovider.JavaVersionUtil;
-
-/**
- * Facade for the {@code java.lang.Module} class introduced in JDK9 that allows tests to be
- * developed against JDK8 but use module logic if deployed on JDK9.
- */
-public class JLModule {
-
-    static {
-        if (JavaVersionUtil.JAVA_SPEC <= 8) {
-            throw new AssertionError("Use of " + JLModule.class + " only allowed if " + GraalTest.class.getName() + ".JDK8OrEarlier is false");
-        }
-    }
-
-    private final Object realModule;
-
-    public JLModule(Object module) {
-        this.realModule = module;
-    }
-
-    private static final Class<?> moduleClass;
-    private static final Method getModuleMethod;
-    private static final Method getUnnamedModuleMethod;
-    private static final Method getPackagesMethod;
-    private static final Method isExportedMethod;
-    private static final Method isExported2Method;
-    private static final Method addExportsMethod;
-    /**
-     * {@code jdk.internal.module.Modules.addExports(Module, String, Module)}.
-     */
-    private static final Method modulesAddExportsMethod;
-
-    /**
-     * {@code jdk.internal.module.Modules.addOpens(Module, String, Module)}.
-     */
-    private static final Method modulesAddOpensMethod;
-
-    static {
-        try {
-            moduleClass = Class.forName("java.lang.Module");
-            Class<?> modulesClass = Class.forName("jdk.internal.module.Modules");
-            getModuleMethod = Class.class.getMethod("getModule");
-            getUnnamedModuleMethod = ClassLoader.class.getMethod("getUnnamedModule");
-            getPackagesMethod = moduleClass.getMethod("getPackages");
-            isExportedMethod = moduleClass.getMethod("isExported", String.class);
-            isExported2Method = moduleClass.getMethod("isExported", String.class, moduleClass);
-            addExportsMethod = moduleClass.getMethod("addExports", String.class, moduleClass);
-            modulesAddExportsMethod = modulesClass.getDeclaredMethod("addExports", moduleClass, String.class, moduleClass);
-            modulesAddOpensMethod = modulesClass.getDeclaredMethod("addOpens", moduleClass, String.class, moduleClass);
-        } catch (Exception e) {
-            throw new AssertionError(e);
-        }
-    }
-
-    public static JLModule fromClass(Class<?> cls) {
-        try {
-            return new JLModule(getModuleMethod.invoke(cls));
-        } catch (Exception e) {
-            throw new AssertionError(e);
-        }
-    }
-
-    public static JLModule getUnnamedModuleFor(ClassLoader cl) {
-        try {
-            return new JLModule(getUnnamedModuleMethod.invoke(cl));
-        } catch (Exception e) {
-            throw new AssertionError(e);
-        }
-    }
-
-    /**
-     * Exports all packages in this module to a given module.
-     */
-    public void exportAllPackagesTo(JLModule module) {
-        if (this != module) {
-            for (String pkg : getPackages()) {
-                // Export all JVMCI packages dynamically instead
-                // of requiring a long list of -XaddExports
-                // options on the JVM command line.
-                if (!isExported(pkg, module)) {
-                    addExports(pkg, module);
-                }
-            }
-        }
-    }
-
-    @SuppressWarnings("unchecked")
-    public Set<String> getPackages() {
-        try {
-            return (Set<String>) getPackagesMethod.invoke(realModule);
-        } catch (Exception e) {
-            throw new AssertionError(e);
-        }
-    }
-
-    public boolean isExported(String pn) {
-        try {
-            return (Boolean) isExportedMethod.invoke(realModule, pn);
-        } catch (Exception e) {
-            throw new AssertionError(e);
-        }
-    }
-
-    public boolean isExported(String pn, JLModule other) {
-        try {
-            return (Boolean) isExported2Method.invoke(realModule, pn, other.realModule);
-        } catch (Exception e) {
-            throw new AssertionError(e);
-        }
-    }
-
-    public void addExports(String pn, JLModule other) {
-        try {
-            addExportsMethod.invoke(realModule, pn, other.realModule);
-        } catch (Exception e) {
-            throw new AssertionError(e);
-        }
-    }
-
-    private static Object unbox(Object obj) {
-        if (obj instanceof JLModule) {
-            return ((JLModule) obj).realModule;
-        }
-        return obj;
-    }
-
-    /**
-     * Updates module m1 to export a package to module m2. Same as m1.addExports(pn, m2) but without
-     * a caller check
-     */
-    public static void uncheckedAddExports(Object m1, String pn, Object m2) {
-        try {
-            modulesAddExportsMethod.invoke(null, unbox(m1), pn, unbox(m2));
-        } catch (Exception e) {
-            throw new AssertionError(e);
-        }
-    }
-
-    /**
-     * Opens all packages in {@code moduleMember}'s module for deep reflection (i.e., allow
-     * {@link AccessibleObject#setAccessible(boolean)} to be called for any class/method/field) by
-     * {@code requestor}'s module.
-     */
-    public static void openAllPackagesForReflectionTo(Class<?> moduleMember, Class<?> requestor) {
-        try {
-            Object moduleToOpen = getModuleMethod.invoke(moduleMember);
-            Object requestorModule = getModuleMethod.invoke(requestor);
-            if (moduleToOpen != requestorModule) {
-                String[] packages = (String[]) getPackagesMethod.invoke(moduleToOpen);
-                for (String pkg : packages) {
-                    modulesAddOpensMethod.invoke(moduleToOpen, pkg, requestorModule);
-                }
-            }
-        } catch (Exception e) {
-            throw new AssertionError(e);
-        }
-    }
-
-    /**
-     * Opens {@code declaringClass}'s package to allow a method declared in {@code accessor} to call
-     * {@link AccessibleObject#setAccessible(boolean)} on an {@link AccessibleObject} representing a
-     * field or method declared by {@code declaringClass}.
-     */
-    public static void openForReflectionTo(Class<?> declaringClass, Class<?> accessor) {
-        try {
-            Object moduleToOpen = getModuleMethod.invoke(declaringClass);
-            Object accessorModule = getModuleMethod.invoke(accessor);
-            if (moduleToOpen != accessorModule) {
-                modulesAddOpensMethod.invoke(null, moduleToOpen, declaringClass.getPackage().getName(), accessorModule);
-            }
-        } catch (Exception e) {
-            throw new AssertionError(e);
-        }
-    }
-
-    /**
-     * Exports the package named {@code packageName} declared in {@code moduleMember}'s module to
-     * {@code requestor}'s module.
-     */
-    public static void exportPackageTo(Class<?> moduleMember, String packageName, Class<?> requestor) {
-        try {
-            Object moduleToExport = getModuleMethod.invoke(moduleMember);
-            Object requestorModule = getModuleMethod.invoke(requestor);
-            if (moduleToExport != requestorModule) {
-                modulesAddExportsMethod.invoke(null, moduleToExport, packageName, requestorModule);
-            }
-        } catch (Exception e) {
-            throw new AssertionError(e);
-        }
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/ModuleSupport.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,129 @@
+/*
+ * 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 org.graalvm.compiler.test;
+
+import java.io.IOException;
+import java.lang.module.ModuleDescriptor.Requires;
+import java.net.URI;
+import java.nio.file.FileSystem;
+import java.nio.file.FileSystems;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.graalvm.compiler.debug.DebugOptions;
+
+import jdk.internal.module.Modules;
+
+public class ModuleSupport {
+
+    public static void exportPackageTo(Class<?> moduleMember, String packageName, Class<?> requestor) {
+        Module moduleToExport = moduleMember.getModule();
+        Module requestorModule = requestor.getModule();
+        if (moduleToExport != requestorModule) {
+            Modules.addExports(moduleToExport, packageName, requestorModule);
+        }
+    }
+
+    public static void exportAllPackagesTo(Class<?> moduleMember, Class<?> requestor) {
+        Module moduleToExport = moduleMember.getModule();
+        Module requestorModule = requestor.getModule();
+        if (moduleToExport != requestorModule) {
+            for (String packageName : moduleToExport.getPackages()) {
+                Modules.addExports(moduleToExport, packageName, requestorModule);
+            }
+        }
+    }
+
+    public static void exportAllPackagesTo(Class<?> moduleMember, ClassLoader cl) {
+        Module moduleToExport = moduleMember.getModule();
+        Module unnamedModule = cl.getUnnamedModule();
+        for (String packageName : moduleToExport.getPackages()) {
+            Modules.addExports(moduleToExport, packageName, unnamedModule);
+        }
+    }
+
+    @SuppressWarnings("unused")
+    public static void exportAndOpenAllPackagesToUnnamed(String name) {
+        Module module = ModuleLayer.boot().findModule(name).orElseThrow();
+        Set<String> packages = module.getPackages();
+        for (String pkg : packages) {
+            Modules.addExportsToAllUnnamed(module, pkg);
+            Modules.addOpensToAllUnnamed(module, pkg);
+        }
+    }
+
+    public static List<String> getJRTGraalClassNames() throws IOException {
+        List<String> classNames = new ArrayList<>();
+        FileSystem fs = FileSystems.newFileSystem(URI.create("jrt:/"), Collections.emptyMap());
+        Module graalModule = DebugOptions.class.getModule();
+        Set<String> graalModuleSet = new HashSet<>();
+        graalModuleSet.add(graalModule.getName());
+        for (Module module : graalModule.getLayer().modules()) {
+            if (requires(module, graalModule)) {
+                graalModuleSet.add(module.getName());
+            }
+        }
+
+        Path top = fs.getPath("/modules/");
+        Files.find(top, Integer.MAX_VALUE,
+                        (path, attrs) -> attrs.isRegularFile()).forEach(p -> {
+                            int nameCount = p.getNameCount();
+                            if (nameCount > 2) {
+                                String base = p.getName(nameCount - 1).toString();
+                                if (base.endsWith(".class") && !base.equals("module-info.class")) {
+                                    String module = p.getName(1).toString();
+                                    if (graalModuleSet.contains(module)) {
+                                        // Strip module prefix and convert to dotted
+                                        // form
+                                        String className = p.subpath(2, nameCount).toString().replace('/', '.');
+                                        // Strip ".class" suffix
+                                        className = className.replace('/', '.').substring(0, className.length() - ".class".length());
+                                        classNames.add(className);
+                                    }
+                                }
+                            }
+                        });
+        return classNames;
+    }
+
+    private static boolean requires(Module module, Module graalModule) {
+        ModuleLayer graalLayer = graalModule.getLayer();
+        for (Requires r : module.getDescriptor().requires()) {
+            if (r.name().equals(graalModule.getName())) {
+                return true;
+            }
+            Module dep = graalLayer.findModule(r.name()).get();
+            if (requires(dep, graalModule)) {
+                return true;
+            }
+        }
+        return false;
+    }
+}
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/SubprocessUtil.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/SubprocessUtil.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -34,6 +34,7 @@
 import java.util.Formatter;
 import java.util.List;
 import java.util.Map;
+import java.util.function.Predicate;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -102,6 +103,26 @@
     }
 
     /**
+     * Gets the command line options to do the same package opening and exporting specified by the
+     * {@code --open-packages} option to the {@code mx unittest} command.
+     *
+     * Properties defined in {@code com.oracle.mxtool.junit.MxJUnitWrapper}.
+     */
+    public static List<String> getPackageOpeningOptions() {
+        List<String> result = new ArrayList<>();
+        String[] actions = {"opens", "exports"};
+        for (String action : actions) {
+            String opens = System.getProperty("com.oracle.mxtool.junit." + action);
+            if (opens != null && !opens.isEmpty()) {
+                for (String value : opens.split(System.lineSeparator())) {
+                    result.add("--add-" + action + "=" + value);
+                }
+            }
+        }
+        return result;
+    }
+
+    /**
      * Gets the command line used to start the current Java VM, including all VM arguments, but not
      * including the main class or any Java arguments. This can be used to spawn an identical VM,
      * but running different Java code.
@@ -117,10 +138,30 @@
     }
 
     /**
-     * Detects whether a java agent is attached.
+     * Detects whether a Java agent matching {@code agentPredicate} is specified in the VM
+     * arguments.
+     *
+     * @param agentPredicate a predicate that is given the value of a {@code -javaagent} VM argument
+     */
+    public static boolean isJavaAgentAttached(Predicate<String> agentPredicate) {
+        return SubprocessUtil.getVMCommandLine().stream().//
+                        filter(args -> args.startsWith("-javaagent:")).//
+                        map(s -> s.substring("-javaagent:".length())).//
+                        anyMatch(agentPredicate);
+    }
+
+    /**
+     * Detects whether a Java agent is specified in the VM arguments.
      */
     public static boolean isJavaAgentAttached() {
-        return SubprocessUtil.getVMCommandLine().stream().anyMatch(args -> args.startsWith("-javaagent"));
+        return isJavaAgentAttached(javaAgentValue -> true);
+    }
+
+    /**
+     * Detects whether the JaCoCo Java agent is specified in the VM arguments.
+     */
+    public static boolean isJaCoCoAttached() {
+        return isJavaAgentAttached(s -> s.toLowerCase().contains("jacoco"));
     }
 
     /**
@@ -278,7 +319,11 @@
         while (i < commandLine.size()) {
             String s = commandLine.get(i);
             if (s.charAt(0) != '-') {
-                return i;
+                // https://bugs.openjdk.java.net/browse/JDK-8027634
+                if (isJava8OrEarlier || s.charAt(0) != '@') {
+                    return i;
+                }
+                i++;
             } else if (hasArg(s)) {
                 i += 2;
             } else {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EarlyReadEliminationPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EarlyReadEliminationPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsClosure.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsClosure.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -357,6 +357,12 @@
                     lastMergedState = mergeProcessor.newState;
                     for (Block block : loop.getBlocks()) {
                         blockEffects.get(block).clear();
+                        if (block.isLoopHeader()) {
+                            final GraphEffectList loopEffects = loopMergeEffects.get(block.getLoop());
+                            if (loopEffects != null) {
+                                loopEffects.clear();
+                            }
+                        }
                     }
                 }
             }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsPhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsPhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/GraphEffectList.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/GraphEffectList.java	Wed Sep 25 22:40:41 2019 +0200
@@ -132,7 +132,7 @@
      */
     public void initializePhiInput(PhiNode node, int index, ValueNode value) {
         add("set phi input", (graph, obsoleteNodes) -> {
-            assert node.isAlive() && index >= 0;
+            assert node.isAlive() && index >= 0 : node;
             node.initializeValueAt(index, graph.addOrUniqueWithInputs(value));
         });
     }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationClosure.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationClosure.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeClosure.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeClosure.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapePhase.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapePhase.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualizerToolImpl.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualizerToolImpl.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Word.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Word.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordOperationPlugin.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordOperationPlugin.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordTypes.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordTypes.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphOutput.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphOutput.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphProtocol.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphProtocol.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/ProtocolImpl.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/ProtocolImpl.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/package-info.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/package-info.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,6 +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
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.util.test/src/org/graalvm/util/test/CollectionSizeTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.util.test/src/org/graalvm/util/test/CollectionSizeTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java	Wed Sep 25 22:40:41 2019 +0200
@@ -110,7 +110,8 @@
 
         String tagText =  ch.getText(itt.getSearchTerm());
         if (tagText.charAt(0) == '"' && tagText.charAt(tagText.length() - 1) == '"') {
-            tagText = tagText.substring(1, tagText.length() - 1);
+            tagText = tagText.substring(1, tagText.length() - 1)
+                             .replaceAll("\\s+", " ");
         }
         String desc = ch.getText(itt.getDescription());
 
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Links.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Links.java	Wed Sep 25 22:40:41 2019 +0200
@@ -312,7 +312,7 @@
      * @return a valid HTML name
      */
     public String getName(String name) {
-        return name.replaceAll(" +", "");
+        return name.replaceAll("\\s+", "");
     }
 
 }
--- a/src/jdk.jcmd/linux/classes/sun/tools/ProcessHelper.java	Mon Sep 23 09:16:05 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,149 +0,0 @@
-/*
- * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.tools;
-
-import java.io.IOException;
-import java.io.UncheckedIOException;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.jar.Attributes;
-import java.util.jar.JarFile;
-import java.util.stream.Stream;
-
-/**
- * A helper class that retrieves the main class name for
- * a running Java process using the proc filesystem (procfs)
- */
-public class ProcessHelper implements sun.tools.common.ProcessHelper {
-
-
-    private static final String CMD_PREFIX = "cmd:";
-    private static final ProcessHelper INSTANCE = new ProcessHelper();
-
-    public static ProcessHelper getInstance() {
-        return INSTANCE;
-    }
-
-    /**
-     * Gets the main class name for the given Java process by parsing the
-     * process command line. If the application was started with the <em>-jar</em>
-     * option this method returns the name of the jar file. If the application
-     * was started with <em>-m</em> or <em>--module</em> option, the method returns
-     * the module name and the main class name.
-     * @param pid - process ID (pid)
-     * @return the main class name or null if the process no longer exists or
-     * was started with a native launcher (e.g. jcmd etc)
-     */
-
-    public String getMainClass(String pid) {
-        String cmdLine = getCommandLine(pid);
-        if (cmdLine == null) {
-            return null;
-        }
-        if (cmdLine.startsWith(CMD_PREFIX)) {
-            cmdLine = cmdLine.substring(CMD_PREFIX.length());
-        }
-        String[] parts = cmdLine.split("\0");
-        String mainClass = null;
-
-        if(parts.length == 0) {
-            return null;
-        }
-
-        // Check the executable
-        String[] executablePath = parts[0].split("/");
-        if (executablePath.length > 0) {
-            String binaryName = executablePath[executablePath.length - 1];
-            if (!"java".equals(binaryName)) {
-                // Skip the process if it is not started with java launcher
-                return null;
-            }
-        }
-
-        // To be consistent with the behavior on other platforms, if -jar, -m, or --module
-        // options are used then just return the value (the path to the jar file or module
-        // name with a main class). Otherwise, the main class name is the first part that
-        // is not a Java option (doesn't start with '-' and is not a classpath or a module
-        // whitespace option).
-
-        for (int i = 1; i < parts.length && mainClass == null; i++) {
-            if (i < parts.length - 1) {
-                if (parts[i].equals("-m") || parts[i].equals("--module") || parts[i].equals("-jar")) {
-                    return parts[i + 1];
-                }
-            }
-
-            if (parts[i].startsWith("--module=")) {
-                return parts[i].substring("--module=".length());
-            }
-
-            // If this is a classpath or a module whitespace option then skip the next part
-            // (the classpath or the option value itself)
-            if (parts[i].equals("-cp") || parts[i].equals("-classpath") ||  parts[i].equals("--class-path") ||
-                    isModuleWhiteSpaceOption(parts[i])) {
-                i++;
-                continue;
-            }
-            // Skip all other Java options
-            if (parts[i].startsWith("-")) {
-                continue;
-            }
-
-            // If it is a source-file mode then return null
-            if (parts[i].endsWith(".java")) {
-                return null;
-            }
-
-            mainClass = parts[i];
-        }
-        return mainClass;
-
-    }
-
-    private static String getCommandLine(String pid) {
-        try (Stream<String> lines =
-                     Files.lines(Paths.get("/proc/" + pid + "/cmdline"))) {
-            return lines.findFirst().orElse(null);
-        } catch (IOException | UncheckedIOException e) {
-            return null;
-        }
-    }
-
-    private static boolean isModuleWhiteSpaceOption(String option) {
-        return option.equals("-p") ||
-                option.equals("--module-path") ||
-                option.equals("--upgrade-module-path") ||
-                option.equals("--add-modules") ||
-                option.equals("--limit-modules") ||
-                option.equals("--add-exports") ||
-                option.equals("--add-opens") ||
-                option.equals("--add-reads") ||
-                option.equals("--patch-module");
-    }
-
-}
-
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.jcmd/linux/classes/sun/tools/common/ProcessHelper.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.tools.common;
+
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.stream.Stream;
+
+/**
+ * A helper class that retrieves the main class name for
+ * a running Java process using the proc filesystem (procfs)
+ */
+final class ProcessHelper {
+
+    private static final String CMD_PREFIX = "cmd:";
+
+    /**
+     * Gets the main class name for the given Java process by parsing the
+     * process command line. If the application was started with the <em>-jar</em>
+     * option this method returns the name of the jar file. If the application
+     * was started with <em>-m</em> or <em>--module</em> option, the method returns
+     * the module name and the main class name.
+     * @param pid - process ID (pid)
+     * @return the main class name or null if the process no longer exists or
+     * was started with a native launcher (e.g. jcmd etc)
+     */
+    static String getMainClass(String pid) {
+        String cmdLine = getCommandLine(pid);
+        if (cmdLine == null) {
+            return null;
+        }
+        if (cmdLine.startsWith(CMD_PREFIX)) {
+            cmdLine = cmdLine.substring(CMD_PREFIX.length());
+        }
+        String[] parts = cmdLine.split("\0");
+        String mainClass = null;
+
+        if (parts.length == 0) {
+            return null;
+        }
+
+        // Check the executable
+        String[] executablePath = parts[0].split("/");
+        if (executablePath.length > 0) {
+            String binaryName = executablePath[executablePath.length - 1];
+            if (!"java".equals(binaryName)) {
+                // Skip the process if it is not started with java launcher
+                return null;
+            }
+        }
+
+        // To be consistent with the behavior on other platforms, if -jar, -m, or --module
+        // options are used then just return the value (the path to the jar file or module
+        // name with a main class). Otherwise, the main class name is the first part that
+        // is not a Java option (doesn't start with '-' and is not a classpath or a module
+        // whitespace option).
+
+        for (int i = 1; i < parts.length && mainClass == null; i++) {
+            if (i < parts.length - 1) {
+                if (parts[i].equals("-m") || parts[i].equals("--module") || parts[i].equals("-jar")) {
+                    return parts[i + 1];
+                }
+            }
+
+            if (parts[i].startsWith("--module=")) {
+                return parts[i].substring("--module=".length());
+            }
+
+            // If this is a classpath or a module whitespace option then skip the next part
+            // (the classpath or the option value itself)
+            if (parts[i].equals("-cp") || parts[i].equals("-classpath") ||  parts[i].equals("--class-path") ||
+                    isModuleWhiteSpaceOption(parts[i])) {
+                i++;
+                continue;
+            }
+            // Skip all other Java options
+            if (parts[i].startsWith("-")) {
+                continue;
+            }
+
+            // If it is a source-file mode then return null
+            if (parts[i].endsWith(".java")) {
+                return null;
+            }
+
+            mainClass = parts[i];
+        }
+        return mainClass;
+    }
+
+    private static String getCommandLine(String pid) {
+        try (Stream<String> lines =
+                     Files.lines(Paths.get("/proc/" + pid + "/cmdline"))) {
+            return lines.findFirst().orElse(null);
+        } catch (IOException | UncheckedIOException e) {
+            return null;
+        }
+    }
+
+    private static boolean isModuleWhiteSpaceOption(String option) {
+        return option.equals("-p") ||
+               option.equals("--module-path") ||
+               option.equals("--upgrade-module-path") ||
+               option.equals("--add-modules") ||
+               option.equals("--limit-modules") ||
+               option.equals("--add-exports") ||
+               option.equals("--add-opens") ||
+               option.equals("--add-reads") ||
+               option.equals("--patch-module");
+    }
+}
--- a/src/jdk.jcmd/share/classes/sun/tools/common/ProcessArgumentMatcher.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.jcmd/share/classes/sun/tools/common/ProcessArgumentMatcher.java	Wed Sep 25 22:40:41 2019 +0200
@@ -79,15 +79,10 @@
 
     private static boolean check(VirtualMachineDescriptor vmd, String excludeClass, String partialMatch) {
 
-        String mainClass = null;
+        // Try to get the main class name using (platform specific) ProcessHelper
+        String mainClass = ProcessHelper.getMainClass(vmd.id());
 
-        // Get the main class name using platform specific helper
-        ProcessHelper helper = ProcessHelper.platformProcessHelper();
-        if (helper != null) {
-            mainClass = helper.getMainClass(vmd.id());
-        }
-
-        // If the main class name is still unset then retrieve it with the attach mechanism
+        // If the main class name could not be retrieved by ProcessHelper, get it with the attach mechanism
         if (mainClass == null) {
             try {
                 VmIdentifier vmId = new VmIdentifier(vmd.id());
--- a/src/jdk.jcmd/share/classes/sun/tools/common/ProcessHelper.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.jcmd/share/classes/sun/tools/common/ProcessHelper.java	Wed Sep 25 22:40:41 2019 +0200
@@ -25,33 +25,12 @@
 
 package sun.tools.common;
 
-import java.lang.reflect.Method;
-
 /**
  * A helper class to retrieve the main class name for a running
- * Java process.
+ * Java process. Default implementation returns null. Platform specific
+ * implementation currently available for Linux only.
  */
-
-public interface ProcessHelper {
-
-    /**
-     * Returns an instance of the ProcessHelper class.
-     *
-     * @return ProcessHelper object or null if not supported on this platform.
-     */
-    public static ProcessHelper platformProcessHelper() {
-        try {
-            Class<?> c = Class.forName("sun.tools.ProcessHelper");
-            @SuppressWarnings("unchecked")
-            Method m = c.getMethod("getInstance");
-            return (ProcessHelper) m.invoke(null);
-        } catch (ClassNotFoundException e) {
-            return null;
-        } catch (ReflectiveOperationException e) {
-            throw new InternalError(e);
-        }
-    }
-
+final class ProcessHelper {
 
     /**
      * Returns the main class name for the given Java process
@@ -59,6 +38,7 @@
      * @param pid - process ID (pid)
      * @return main class name or null if the main class could not be retrieved
      */
-
-    String getMainClass(String pid);
+    static String getMainClass(String pid) {
+        return null;
+    }
 }
--- a/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsClient.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsClient.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -29,7 +29,9 @@
 import java.net.DatagramSocket;
 import java.net.DatagramPacket;
 import java.net.InetAddress;
+import java.net.InetSocketAddress;
 import java.net.Socket;
+import java.net.SocketTimeoutException;
 import java.security.SecureRandom;
 import javax.naming.*;
 
@@ -82,7 +84,7 @@
     private static final SecureRandom random = JCAUtil.getSecureRandom();
     private InetAddress[] servers;
     private int[] serverPorts;
-    private int timeout;                // initial timeout on UDP queries in ms
+    private int timeout;                // initial timeout on UDP and TCP queries in ms
     private int retries;                // number of UDP retries
 
     private final Object udpSocketLock = new Object();
@@ -100,7 +102,7 @@
     /*
      * Each server is of the form "server[:port]".  IPv6 literal host names
      * include delimiting brackets.
-     * "timeout" is the initial timeout interval (in ms) for UDP queries,
+     * "timeout" is the initial timeout interval (in ms) for queries,
      * and "retries" gives the number of retries per server.
      */
     public DnsClient(String[] servers, int timeout, int retries)
@@ -237,6 +239,7 @@
 
                             // Try each server, starting with the one that just
                             // provided the truncated message.
+                            int retryTimeout = (timeout * (1 << retry));
                             for (int j = 0; j < servers.length; j++) {
                                 int ij = (i + j) % servers.length;
                                 if (doNotRetry[ij]) {
@@ -244,7 +247,7 @@
                                 }
                                 try {
                                     Tcp tcp =
-                                        new Tcp(servers[ij], serverPorts[ij]);
+                                        new Tcp(servers[ij], serverPorts[ij], retryTimeout);
                                     byte[] msg2;
                                     try {
                                         msg2 = doTcpQuery(tcp, pkt);
@@ -327,7 +330,7 @@
         // Try each name server.
         for (int i = 0; i < servers.length; i++) {
             try {
-                Tcp tcp = new Tcp(servers[i], serverPorts[i]);
+                Tcp tcp = new Tcp(servers[i], serverPorts[i], timeout);
                 byte[] msg;
                 try {
                     msg = doTcpQuery(tcp, pkt);
@@ -462,11 +465,11 @@
      */
     private byte[] continueTcpQuery(Tcp tcp) throws IOException {
 
-        int lenHi = tcp.in.read();      // high-order byte of response length
+        int lenHi = tcp.read();      // high-order byte of response length
         if (lenHi == -1) {
             return null;        // EOF
         }
-        int lenLo = tcp.in.read();      // low-order byte of response length
+        int lenLo = tcp.read();      // low-order byte of response length
         if (lenLo == -1) {
             throw new IOException("Corrupted DNS response: bad length");
         }
@@ -474,7 +477,7 @@
         byte[] msg = new byte[len];
         int pos = 0;                    // next unfilled position in msg
         while (len > 0) {
-            int n = tcp.in.read(msg, pos, len);
+            int n = tcp.read(msg, pos, len);
             if (n == -1) {
                 throw new IOException(
                         "Corrupted DNS response: too little data");
@@ -682,20 +685,62 @@
 
 class Tcp {
 
-    private Socket sock;
-    java.io.InputStream in;
-    java.io.OutputStream out;
+    private final Socket sock;
+    private final java.io.InputStream in;
+    final java.io.OutputStream out;
+    private int timeoutLeft;
 
-    Tcp(InetAddress server, int port) throws IOException {
-        sock = new Socket(server, port);
-        sock.setTcpNoDelay(true);
-        out = new java.io.BufferedOutputStream(sock.getOutputStream());
-        in = new java.io.BufferedInputStream(sock.getInputStream());
+    Tcp(InetAddress server, int port, int timeout) throws IOException {
+        sock = new Socket();
+        try {
+            long start = System.currentTimeMillis();
+            sock.connect(new InetSocketAddress(server, port), timeout);
+            timeoutLeft = (int) (timeout - (System.currentTimeMillis() - start));
+            if (timeoutLeft <= 0)
+                throw new SocketTimeoutException();
+
+            sock.setTcpNoDelay(true);
+            out = new java.io.BufferedOutputStream(sock.getOutputStream());
+            in = new java.io.BufferedInputStream(sock.getInputStream());
+        } catch (Exception e) {
+            try {
+                sock.close();
+            } catch (IOException ex) {
+                e.addSuppressed(ex);
+            }
+            throw e;
+        }
     }
 
     void close() throws IOException {
         sock.close();
     }
+
+    private interface SocketReadOp {
+        int read() throws IOException;
+    }
+
+    private int readWithTimeout(SocketReadOp reader) throws IOException {
+        if (timeoutLeft <= 0)
+            throw new SocketTimeoutException();
+
+        sock.setSoTimeout(timeoutLeft);
+        long start = System.currentTimeMillis();
+        try {
+            return reader.read();
+        }
+        finally {
+            timeoutLeft -= System.currentTimeMillis() - start;
+        }
+    }
+
+    int read() throws IOException {
+        return readWithTimeout(() -> in.read());
+    }
+
+    int read(byte b[], int off, int len) throws IOException {
+        return readWithTimeout(() -> in.read(b, off, len));
+    }
 }
 
 /*
--- a/src/jdk.naming.dns/share/classes/module-info.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.naming.dns/share/classes/module-info.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, 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
@@ -26,7 +26,38 @@
 /**
  * Provides the implementation of the DNS Java Naming provider.
  *
+ * <h2>Environment Properties</h2>
+ *
+ * <p> The following JNDI environment properties may be used when creating
+ * the initial context.
+ *
+ * <ul>
+ *    <li>com.sun.jndi.dns.timeout.initial</li>
+ *    <li>com.sun.jndi.dns.timeout.retries</li>
+ *  </ul>
+ *
+ * <p> These properties are used to alter the timeout-related defaults that the
+ * DNS provider uses when submitting queries. The DNS provider submits queries
+ * using the following exponential backoff algorithm. The provider submits a
+ * query to a DNS server and waits for a response to arrive within a timeout
+ * period (1 second by default). If it receives no response within the timeout
+ * period, it queries the next server, and so on. If the provider receives no
+ * response from any server, it doubles the timeout period and repeats the
+ * process of submitting the query to each server, up to a maximum number of
+ * retries (4 by default).
+ *
+ * <p> The {@code com.sun.jndi.dns.timeout.initial} property, if set, specifies
+ * the number of milliseconds to use as the initial timeout period (i.e., before
+ * any doubling). If this property has not been set, the default initial timeout
+ * is 1000 milliseconds.
+ *
+ * <p> The {@code com.sun.jndi.dns.timeout.retries} property, if set, specifies
+ * the number of times to retry each server using the exponential backoff
+ * algorithm described previously. If this property has not been set, the
+ * default number of retries is 4.
+ *
  * @provides javax.naming.spi.InitialContextFactory
+ *
  * @moduleGraph
  * @since 9
  */
--- a/src/jdk.security.auth/share/classes/com/sun/security/auth/module/NTSystem.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.security.auth/share/classes/com/sun/security/auth/module/NTSystem.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, 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
@@ -35,12 +35,14 @@
     private native void getCurrent(boolean debug);
     private native long getImpersonationToken0();
 
+    // Warning: the next 6 fields are used by nt.c
     private String userName;
     private String domain;
     private String domainSID;
     private String userSID;
     private String[] groupIDs;
     private String primaryGroupID;
+
     private long   impersonationToken;
 
     /**
--- a/src/jdk.security.auth/share/classes/com/sun/security/auth/module/UnixSystem.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/src/jdk.security.auth/share/classes/com/sun/security/auth/module/UnixSystem.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, 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
@@ -33,6 +33,7 @@
 
     private native void getUnixInfo();
 
+    // Warning: the following 4 fields are used by Unix.c
     protected String username;
     protected long uid;
     protected long gid;
--- a/test/hotspot/jtreg/ProblemList-graal.txt	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/hotspot/jtreg/ProblemList-graal.txt	Wed Sep 25 22:40:41 2019 +0200
@@ -43,8 +43,6 @@
 
 compiler/unsafe/UnsafeGetConstantField.java                     8181833   generic-all
 compiler/unsafe/UnsafeGetStableArrayElement.java                8181833   generic-all
-compiler/unsafe/UnsafeOffHeapBooleanTest.java                   8181833   generic-all
-compiler/unsafe/UnsafeOnHeapBooleanTest.java                    8181833   generic-all
 
 compiler/whitebox/ClearMethodStateTest.java                     8181831   generic-all
 compiler/whitebox/EnqueueMethodForCompilationTest.java          8181831   generic-all
--- a/test/hotspot/jtreg/compiler/escapeAnalysis/TestSelfArrayCopy.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/hotspot/jtreg/compiler/escapeAnalysis/TestSelfArrayCopy.java	Wed Sep 25 22:40:41 2019 +0200
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8229016
+ * @bug 8229016 8231055
  * @summary Test correct elimination of array allocation with arraycopy to itself.
  * @library /test/lib
  * @run main/othervm -Xbatch -XX:CompileCommand=compileonly,compiler.escapeAnalysis.TestSelfArrayCopy::test
@@ -39,7 +39,7 @@
     private static final int rI1 = Utils.getRandomInstance().nextInt();
     private static final int rI2 = Utils.getRandomInstance().nextInt();
 
-    private static int test() {
+    private static int test1() {
         // Non-escaping allocation
         Integer[] array = {rI1, rI2};
         // Arraycopy with src == dst
@@ -51,14 +51,40 @@
         return array[0] + array[1];
     }
 
+    private static int test2() {
+        // Non-escaping allocation
+        Integer[] array = {rI1, rI2};
+        // Arraycopy with src == dst
+        System.arraycopy(array, 0, array, 1, 1);
+        if (b) {
+            // Uncommon trap
+            System.out.println(array[0]);
+        }
+        return array[0] + array[1];
+    }
+
     public static void main(String[] args) {
-        int expected = rI1 + rI2;
+        int expected1 = rI1 + rI2;
+        int expected2 = rI1 + rI1;
         // Trigger compilation
         for (int i = 0; i < 20_000; ++i) {
-            int result = test();
-            if (result != expected) {
-                throw new RuntimeException("Incorrect result: " + result + " != " + expected);
+            int result = test1();
+            if (result != expected1) {
+                throw new RuntimeException("Incorrect result: " + result + " != " + expected1);
+            }
+            result = test2();
+            if (result != expected2) {
+                throw new RuntimeException("Incorrect result: " + result + " != " + expected2);
             }
         }
+        b = true;
+        int result = test1();
+        if (result != expected1) {
+            throw new RuntimeException("Incorrect result: " + result + " != " + expected1);
+        }
+        result = test2();
+        if (result != expected2) {
+            throw new RuntimeException("Incorrect result: " + result + " != " + expected2);
+        }
     }
 }
--- a/test/hotspot/jtreg/compiler/linkage/TestLinkageErrorInGenerateOopMap.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/hotspot/jtreg/compiler/linkage/TestLinkageErrorInGenerateOopMap.java	Wed Sep 25 22:40:41 2019 +0200
@@ -47,6 +47,8 @@
                               "-XX:-BytecodeVerificationLocal",
                               "-XX:-TieredCompilation",
                               "-XX:CompileCommand=dontinline,compiler/linkage/OSRWithBadOperandStack.m*",
+                              "-XX:-CreateCoredumpOnCrash",
+                              "-Xmx64m",
                               "compiler.linkage.TestLinkageErrorInGenerateOopMap", "run"};
             ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(flags);
             OutputAnalyzer out = new OutputAnalyzer(pb.start());
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/loopstripmining/AntiDependentLoadInOuterStripMinedLoop.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2019, Red Hat, Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8229483
+ * @summary Sinking load out of loop may trigger: assert(found_sfpt) failed: no node in loop that's not input to safepoint
+ *
+ * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:LoopMaxUnroll=0 AntiDependentLoadInOuterStripMinedLoop
+ *
+ */
+
+public class AntiDependentLoadInOuterStripMinedLoop {
+    private static int field;
+    private static volatile int barrier;
+
+    public static void main(String[] args) {
+        int[] array = new int[1];
+        A a = new A();
+        for (int i = 0; i < 20_000; i++) {
+            test1(array);
+            test2(a, array);
+            test2_helper(array, 0, 0);
+        }
+    }
+
+    private static int test1(int[] array) {
+        int res = 1;
+
+        for (int i = 0; i < 10; i++) {
+            barrier = 1;
+            // field load doesn't float higher than here
+
+            for (int j = 0; j < 2000; j++) {
+                array[0] = j;  // seen as anti dependence by C2 during loop opts, sunk out of loop
+                res *= j;
+            }
+        }
+
+        return field + res + field * 2;
+    }
+
+    private static int test2(A a, int[] array) {
+        int ignore = a.field;
+        int res = 1;
+
+        int k = 0;
+        for (k = 0; k < 2; k++) {
+        }
+
+        for (int i = 0; i < 10; i++) {
+            barrier = 1;
+
+            for (int j = 0; j < 2000; j++) {
+                test2_helper(array, k, j);
+                res *= j;
+            }
+        }
+
+        return a.field + res + a.field * 2;
+    }
+
+    private static void test2_helper(int[] array, int k, int j) {
+        if (k == 2) {
+            array[0] = j;
+        }
+    }
+
+    private static class A {
+        public int field;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/loopstripmining/DeadNodesInOuterLoopAtLoopCloning.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2019, Red Hat, Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8230061
+ * @summary loop unrolling breaks when outer strip mined loop contains dead node
+ *
+ * @run main/othervm -Xmx1G DeadNodesInOuterLoopAtLoopCloning
+ *
+ */
+
+public class DeadNodesInOuterLoopAtLoopCloning {
+
+    public static final int N = 400;
+
+    public static long instanceCount=-2288355609708559532L;
+
+    public static double checkSum(double[] a) {
+        double sum = 0;
+        for (int j = 0; j < a.length; j++) {
+            sum += (a[j] / (j + 1) + a[j] % (j + 1));
+        }
+        return sum;
+    }
+
+    public static int iMeth(double d1) {
+
+        int i4=6022, i5=-211, i6=-15841, iArr[]=new int[N];
+        double d2=-8.78129, dArr[]=new double[N];
+
+        i5 = 1;
+        do {
+            i6 = 1;
+            while (++i6 < 5) {
+                i4 = -933;
+                i4 *= i4;
+                dArr[i5 + 1] = i4;
+                i4 -= i4;
+                d2 = 1;
+                do {
+                    iArr[(int)(d2 + 1)] += (int)instanceCount;
+                    try {
+                        i4 = (i4 % -51430);
+                        i4 = (iArr[i6] % 31311);
+                        iArr[i6 + 1] = (24197 / i5);
+                    } catch (ArithmeticException a_e) {}
+                    i4 -= (int)instanceCount;
+                    i4 <<= i5;
+                    i4 &= 12;
+                } while (++d2 < 1);
+            }
+        } while (++i5 < 320);
+        long meth_res = Double.doubleToLongBits(checkSum(dArr));
+        return (int)meth_res;
+    }
+
+    public static void main(String[] strArr) {
+        DeadNodesInOuterLoopAtLoopCloning _instance = new DeadNodesInOuterLoopAtLoopCloning();
+        for (int i = 0; i < 10 * 320; i++ ) {
+            _instance.iMeth(0.8522);
+        }
+    }
+}
--- a/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java	Wed Sep 25 22:40:41 2019 +0200
@@ -128,8 +128,7 @@
         new LogMessageWithLevel("CLDG Roots", Level.TRACE),
         new LogMessageWithLevel("JVMTI Roots", Level.TRACE),
         new LogMessageWithLevel("CM RefProcessor Roots", Level.TRACE),
-        new LogMessageWithLevel("Wait For Strong CLD", Level.TRACE),
-        new LogMessageWithLevel("Weak CLD Roots", Level.TRACE),
+        new LogMessageWithLevel("Wait For Strong Roots", Level.TRACE),
         // Redirty Cards
         new LogMessageWithLevel("Redirty Cards", Level.DEBUG),
         new LogMessageWithLevel("Parallel Redirty", Level.TRACE),
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/compiler/TestClone.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,239 @@
+/*
+ * Copyright (c) 2019, Red Hat, Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test TestClone
+ * @summary Test clone barriers work correctly
+ * @key gc
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
+ *
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:+UseShenandoahGC
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:+UseShenandoahGC
+ *                   -Xint
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:+UseShenandoahGC
+ *                   -XX:-TieredCompilation
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:+UseShenandoahGC
+ *                   -XX:TieredStopAtLevel=1
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:+UseShenandoahGC
+ *                   -XX:TieredStopAtLevel=4
+ *                   TestClone
+ */
+
+/*
+ * @test TestClone
+ * @summary Test clone barriers work correctly
+ * @key gc
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
+ *
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:+UseShenandoahGC
+ *                   -XX:+ShenandoahVerify
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:+UseShenandoahGC
+ *                   -XX:+ShenandoahVerify
+ *                   -Xint
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:+UseShenandoahGC
+ *                   -XX:+ShenandoahVerify
+ *                   -XX:-TieredCompilation
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:+UseShenandoahGC
+ *                   -XX:+ShenandoahVerify
+ *                   -XX:TieredStopAtLevel=1
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:+UseShenandoahGC
+ *                   -XX:+ShenandoahVerify
+ *                   -XX:TieredStopAtLevel=4
+ *                   TestClone
+ */
+
+/*
+ * @test TestClone
+ * @summary Test clone barriers work correctly
+ * @key gc
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
+ *
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
+ *                   -Xint
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
+ *                   -XX:-TieredCompilation
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
+ *                   -XX:TieredStopAtLevel=1
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
+ *                   -XX:TieredStopAtLevel=4
+ *                   TestClone
+ */
+
+/*
+ * @test TestClone
+ * @summary Test clone barriers work correctly
+ * @key gc
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled & (vm.bits == "64")
+ *
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:-UseCompressedOops
+ *                   -XX:+UseShenandoahGC
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:-UseCompressedOops
+ *                   -XX:+UseShenandoahGC
+ *                   -Xint
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:-UseCompressedOops
+ *                   -XX:+UseShenandoahGC
+ *                   -XX:-TieredCompilation
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:-UseCompressedOops
+ *                   -XX:+UseShenandoahGC
+ *                   -XX:TieredStopAtLevel=1
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:-UseCompressedOops
+ *                   -XX:+UseShenandoahGC
+ *                   -XX:TieredStopAtLevel=4
+ *                   TestClone
+ */
+
+/*
+ * @test TestClone
+ * @summary Test clone barriers work correctly
+ * @key gc
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled & (vm.bits == "64")
+ *
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:-UseCompressedOops
+ *                   -XX:+UseShenandoahGC
+ *                   -XX:+ShenandoahVerify
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:-UseCompressedOops
+ *                   -XX:+UseShenandoahGC
+ *                   -XX:+ShenandoahVerify
+ *                   -Xint
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:-UseCompressedOops
+ *                   -XX:+UseShenandoahGC
+ *                   -XX:+ShenandoahVerify
+ *                   -XX:-TieredCompilation
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:-UseCompressedOops
+ *                   -XX:+UseShenandoahGC
+ *                   -XX:+ShenandoahVerify
+ *                   -XX:TieredStopAtLevel=1
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:-UseCompressedOops
+ *                   -XX:+UseShenandoahGC
+ *                   -XX:+ShenandoahVerify
+ *                   -XX:TieredStopAtLevel=4
+ *                   TestClone
+ */
+
+/*
+ * @test TestClone
+ * @summary Test clone barriers work correctly
+ * @key gc
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled & (vm.bits == "64")
+ *
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:-UseCompressedOops
+ *                   -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:-UseCompressedOops
+ *                   -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
+ *                   -Xint
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:-UseCompressedOops
+ *                   -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
+ *                   -XX:-TieredCompilation
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:-UseCompressedOops
+ *                   -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
+ *                   -XX:TieredStopAtLevel=1
+ *                   TestClone
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xms1g -Xmx1g
+ *                   -XX:-UseCompressedOops
+ *                   -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
+ *                   -XX:TieredStopAtLevel=4
+ *                   TestClone
+ */
+
+
+public class TestClone {
+
+    public static void main(String[] args) throws Exception {
+        for (int i = 0; i < 10000; i++) {
+            Object[] src = new Object[i];
+            for (int c = 0; c < src.length; c++) {
+                src[c] = new Object();
+            }
+            testWith(src);
+        }
+    }
+
+    static void testWith(Object[] src) {
+        Object[] dst = src.clone();
+        int srcLen = src.length;
+        int dstLen = dst.length;
+        if (srcLen != dstLen) {
+            throw new IllegalStateException("Lengths do not match: " + srcLen + " vs " + dstLen);
+        }
+        for (int c = 0; c < src.length; c++) {
+            Object s = src[c];
+            Object d = dst[c];
+            if (s != d) {
+                throw new IllegalStateException("Elements do not match at " + c + ": " + s + " vs " + d);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/CheckUnhandledOops/TestVerifyOops.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,36 @@
+/*
+ * 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 8231058
+ * @requires vm.debug & (os.arch != "sparc") & (os.arch != "sparcv9")
+ * @run main/othervm -XX:+VerifyOops TestVerifyOops
+ */
+
+public class TestVerifyOops {
+
+    public static void main(String[] args) {
+        System.out.println("Test passed");
+    }
+}
--- a/test/hotspot/jtreg/runtime/InvocationTests/invocationC1Tests.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/hotspot/jtreg/runtime/InvocationTests/invocationC1Tests.java	Wed Sep 25 22:40:41 2019 +0200
@@ -49,8 +49,9 @@
         System.out.println("\nC1 invocation tests, Tests: " + whichTests +
                            ", class file version: " + classFileVersion);
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(false, "-Xmx128M",
-            "-Xcomp", "-XX:TieredStopAtLevel=1", whichTests,
-            "--classfile_version=" + classFileVersion);
+            "-Xcomp", "-XX:TieredStopAtLevel=1",
+            "--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED",
+            whichTests, "--classfile_version=" + classFileVersion);
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
         try {
             output.shouldContain("EXECUTION STATUS: PASSED");
--- a/test/hotspot/jtreg/runtime/InvocationTests/invocationGraalTests.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/hotspot/jtreg/runtime/InvocationTests/invocationGraalTests.java	Wed Sep 25 22:40:41 2019 +0200
@@ -51,6 +51,7 @@
                            ", class file version: " + classFileVersion);
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(false, "-Xmx128M",
             "-XX:+UnlockExperimentalVMOptions", "-XX:+EnableJVMCI", "-XX:+UseJVMCICompiler",
+            "--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED",
             whichTests, "--classfile_version=" + classFileVersion);
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
         try {
--- a/test/hotspot/jtreg/runtime/InvocationTests/invokeinterfaceTests.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/hotspot/jtreg/runtime/InvocationTests/invokeinterfaceTests.java	Wed Sep 25 22:40:41 2019 +0200
@@ -48,6 +48,7 @@
         System.out.println("\ninvokeinterface invocation tests, option: " + option +
                            ", class file version: " + classFileVersion);
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(false, "-Xmx128M", option,
+            "--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED",
             "invokeinterface.Generator", "--classfile_version=" + classFileVersion);
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
         try {
--- a/test/hotspot/jtreg/runtime/InvocationTests/invokespecialTests.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/hotspot/jtreg/runtime/InvocationTests/invokespecialTests.java	Wed Sep 25 22:40:41 2019 +0200
@@ -47,6 +47,7 @@
         System.out.println("\ninvokespecial invocation tests, option: " + option +
                            ", class file version: " + classFileVersion);
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(false, "-Xmx128M", option,
+            "--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED",
             "invokespecial.Generator", "--classfile_version=" + classFileVersion);
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
         try {
--- a/test/hotspot/jtreg/runtime/InvocationTests/invokevirtualTests.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/hotspot/jtreg/runtime/InvocationTests/invokevirtualTests.java	Wed Sep 25 22:40:41 2019 +0200
@@ -47,6 +47,7 @@
         System.out.println("\ninvokevirtual invocation tests, option: " + option +
                            ", class file version: " + classFileVersion);
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(false, "-Xmx128M", option,
+            "--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED",
             "invokevirtual.Generator", "--classfile_version=" + classFileVersion);
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
         try {
--- a/test/hotspot/jtreg/runtime/Unsafe/InternalErrorTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/hotspot/jtreg/runtime/Unsafe/InternalErrorTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -28,6 +28,7 @@
  * @summary Check that SIGBUS errors caused by memory accesses in Unsafe_CopyMemory()
  * and UnsafeCopySwapMemory() get converted to java.lang.InternalError exceptions.
  * @modules java.base/jdk.internal.misc
+ *          java.base/java.nio:+open
  *
  * @library /test/lib
  * @build sun.hotspot.WhiteBox
--- a/test/hotspot/jtreg/runtime/cds/appcds/ParallelLoadTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/hotspot/jtreg/runtime/cds/appcds/ParallelLoadTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -33,29 +33,52 @@
  * @run driver ParallelLoadTest
  */
 
+import java.io.File;
+
 public class ParallelLoadTest {
     public static final int MAX_CLASSES = 40;
 
+    /* For easy stress testing, do this:
+
+       i=0; while jtreg -DParallelLoadTest.app.loops=100 -DParallelLoadTest.boot.loops=100 \
+           ParallelLoadTest.java; do i=$(expr $i + 1); echo =====$i; done
+
+     */
+
+    private static final int APP_LOOPS  = Integer.parseInt(System.getProperty("ParallelLoadTest.app.loops", "1"));
+    private static final int BOOT_LOOPS = Integer.parseInt(System.getProperty("ParallelLoadTest.boot.loops", "1"));
+
     public static void main(String[] args) throws Exception {
-        JarBuilder.build("parallel_load", getClassList(true));
-        String appJar = TestCommon.getTestJar("parallel_load.jar");
-        TestCommon.test(appJar, getClassList(false), "ParallelLoad");
+        JarBuilder.build("parallel_load_app", "ParallelLoad", "ParallelLoadThread", "ParallelLoadWatchdog");
+        JarBuilder.build("parallel_load_classes", getClassList());
+        String appJar     = TestCommon.getTestJar("parallel_load_app.jar");
+        String classesJar = TestCommon.getTestJar("parallel_load_classes.jar");
+
+        // (1) Load the classes from app class loader
+        String CP = appJar + File.pathSeparator + classesJar;
+        TestCommon.testDump(CP, getClassList());
+        for (int i = 0; i < APP_LOOPS; i++) {
+            TestCommon.run("-cp", CP,  "ParallelLoad").assertNormalExit();
+        }
+
+        // (2) Load the classes from boot class loader
+        String bootcp = "-Xbootclasspath/a:" + classesJar;
+        TestCommon.testDump(appJar, getClassList(), bootcp);
+        for (int i = 0; i < BOOT_LOOPS; i++) {
+            TestCommon.run(bootcp, "-cp", appJar,
+                           // "-Xlog:class+load=debug",
+                           "ParallelLoad").assertNormalExit();
+        }
     }
 
-    private static String[] getClassList(boolean includeWatchdog) {
-        int extra = includeWatchdog ? 3 : 2;
-        String[] classList = new String[MAX_CLASSES + extra];
+    private static String[] getClassList() {
+        String[] classList = new String[MAX_CLASSES];
 
         int i;
-        for (i=0; i<MAX_CLASSES; i++) {
+        for (i = 0; i < MAX_CLASSES; i++) {
             classList[i] = "ParallelClass" + i;
         }
 
-        classList[i++] = "ParallelLoad";
-        classList[i++] = "ParallelLoadThread";
-        if (includeWatchdog)
-            classList[i++] = "ParallelLoadWatchdog";
-
         return classList;
     }
 }
--- a/test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java	Wed Sep 25 22:40:41 2019 +0200
@@ -218,7 +218,7 @@
                 if (!mainModuleSpecified && !patchModuleSpecified) {
                     // If you have an empty classpath, you cannot specify a classlist!
                     if (opts.classList != null && opts.classList.length > 0) {
-                        throw new RuntimeException("test.dynamic.dump not supported empty classpath with non-empty classlist");
+                        throw new RuntimeException("test.dynamic.dump is not supported with an empty classpath while the classlist is not empty");
                     }
                     cmd.add("-version");
                 }
@@ -242,7 +242,12 @@
         if (opts.appJarDir != null) {
             pb.directory(new File(opts.appJarDir));
         }
-        return executeAndLog(pb, "dump");
+
+        OutputAnalyzer output = executeAndLog(pb, "dump");
+        if (DYNAMIC_DUMP && isUnableToMap(output)) {
+            throw new SkippedException(UnableToMapMsg);
+        }
+        return output;
     }
 
     // This allows you to run the AppCDS tests with JFR enabled at runtime (though not at
@@ -462,9 +467,6 @@
                                           String... suffix) throws Exception {
         OutputAnalyzer output = dump(appJar, classList, suffix);
         if (DYNAMIC_DUMP) {
-            if (isUnableToMap(output)) {
-                throw new SkippedException(UnableToMapMsg);
-            }
             output.shouldContain("Written dynamic archive");
         } else {
             output.shouldContain("Loading classes to share");
@@ -477,9 +479,6 @@
                                           String... suffix) throws Exception {
         OutputAnalyzer output = dump(appJarDir, appJar, classList, suffix);
         if (DYNAMIC_DUMP) {
-            if (isUnableToMap(output)) {
-                throw new SkippedException(UnableToMapMsg);
-            }
             output.shouldContain("Written dynamic archive");
         } else {
             output.shouldContain("Loading classes to share");
--- a/test/hotspot/jtreg/runtime/cds/appcds/test-classes/ParallelLoad.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/hotspot/jtreg/runtime/cds/appcds/test-classes/ParallelLoad.java	Wed Sep 25 22:40:41 2019 +0200
@@ -25,6 +25,7 @@
 import java.io.*;
 import java.net.*;
 import java.lang.reflect.Field;
+import java.util.concurrent.atomic.AtomicInteger;
 
 
 // This test helper is parameterized by:
@@ -78,7 +79,7 @@
             if ("FINGERPRINT_MODE".equals(args[1])) {
                 mode = FINGERPRINT_MODE;
                 classLoaders = new ClassLoader[NUM_THREADS];
-                for (int i=0; i<NUM_THREADS; i++) {
+                for (int i = 0; i < NUM_THREADS; i++) {
                     URL url = new File(customJar).toURI().toURL();
                     URL[] urls = new URL[] {url};
                     classLoaders[i] = new URLClassLoader(urls);
@@ -93,7 +94,7 @@
         System.out.println("Start Parallel Load ...");
 
         Thread thread[] = new Thread[NUM_THREADS];
-        for (int i=0; i<NUM_THREADS; i++) {
+        for (int i = 0; i < NUM_THREADS; i++) {
             Thread t = new ParallelLoadThread(i);
             t.start();
             thread[i] = t;
@@ -103,7 +104,7 @@
         watchdog.setDaemon(true);
         watchdog.start();
 
-        for (int i=0; i<NUM_THREADS; i++) {
+        for (int i = 0; i < NUM_THREADS; i++) {
             thread[i].join();
         }
         System.out.println("Parallel Load ... done");
@@ -128,8 +129,13 @@
 
 
 class ParallelLoadThread extends Thread {
-    static int num_ready[] = new int[ParallelLoad.MAX_CLASSES];
-    static Object lock = new Object();
+    static AtomicInteger num_ready[];
+    static {
+        num_ready = new AtomicInteger[ParallelLoad.MAX_CLASSES];
+        for (int i = 0; i < ParallelLoad.MAX_CLASSES; i++) {
+            num_ready[i] = new AtomicInteger();
+        }
+    }
     static String transformMode =
         System.getProperty("appcds.parallel.transform.mode", "none");
 
@@ -153,35 +159,36 @@
     }
 
     private void run0() throws Throwable {
-        for (int i=0; i<ParallelLoad.MAX_CLASSES; i++) {
-            synchronized(lock) {
-                num_ready[i] ++;
-                while (num_ready[i] < ParallelLoad.NUM_THREADS) {
-                    lock.wait();
-                }
-                lock.notifyAll();
+        for (int i = 0;  i < ParallelLoad.MAX_CLASSES; i++) {
+            String className = "ParallelClass" + i;
+            if (transformMode.equals("cflh")) {
+                className = "ParallelClassTr" + i;
             }
-            log("this = %s %d", this, i);
-            String className = "ParallelClass" + i;
-            if (transformMode.equals("cflh"))
-                className = "ParallelClassTr" + i;
-
             Class clazz = null;
 
-            switch (ParallelLoad.loaderType) {
-            case ParallelLoad.SYSTEM_LOADER:
-                clazz = Class.forName(className);
-                break;
-            case ParallelLoad.SINGLE_CUSTOM_LOADER:
-                clazz = ParallelLoad.classLoaders[0].loadClass(className);
-                break;
-            case ParallelLoad.MULTI_CUSTOM_LOADER:
-                clazz = ParallelLoad.classLoaders[thread_id].loadClass(className);
-                break;
+            // Spin until every thread is ready to proceed
+            num_ready[i].incrementAndGet();
+            while (num_ready[i].intValue() < ParallelLoad.NUM_THREADS) {
+                ;
             }
 
-            log("clazz = %s", clazz);
-            testTransformation(clazz);
+            {   // Avoid logging in this block so the threads can proceed without
+                // waiting for the stdout lock, etc.
+                switch (ParallelLoad.loaderType) {
+                case ParallelLoad.SYSTEM_LOADER:
+                    clazz = Class.forName(className);
+                    break;
+                case ParallelLoad.SINGLE_CUSTOM_LOADER:
+                    clazz = ParallelLoad.classLoaders[0].loadClass(className);
+                    break;
+                case ParallelLoad.MULTI_CUSTOM_LOADER:
+                    clazz = ParallelLoad.classLoaders[thread_id].loadClass(className);
+                    break;
+                }
+                testTransformation(clazz);
+            }
+
+            log("thread[%d] t = %s, c = %s, l = %s", thread_id, this, clazz, clazz.getClassLoader());
         }
     }
 
--- a/test/jdk/ProblemList.txt	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/jdk/ProblemList.txt	Wed Sep 25 22:40:41 2019 +0200
@@ -768,7 +768,6 @@
 javax/swing/JFileChooser/8021253/bug8021253.java 8169954 windows-all,linux-all,macosx-all
 javax/swing/JFileChooser/8062561/bug8062561.java 8196466 linux-all,macosx-all
 javax/swing/JInternalFrame/Test6325652.java 8224977 macosx-all
-javax/swing/JInternalFrame/8145896/TestJInternalFrameMaximize.java 8194944 macosx-all
 javax/swing/JLabel/6596966/bug6596966.java 8040914 macosx-all
 javax/swing/JPopupMenu/4870644/bug4870644.java 8194130 macosx-all,linux-all
 javax/swing/JPopupMenu/4966112/bug4966112.java 8064915 macosx-all
@@ -885,7 +884,6 @@
 jdk/jfr/event/io/EvilInstrument.java                            8221331    generic-all
 jdk/jfr/event/runtime/TestNetworkUtilizationEvent.java          8228990,8229370    generic-all
 jdk/jfr/event/compiler/TestCodeSweeper.java                     8225209    generic-all
-jdk/jfr/jcmd/TestJcmdConfigure.java                             8231317    windows-x64
 
 ############################################################################
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/com/sun/jndi/dns/ConfigTests/TcpTimeout.dns	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,45 @@
+#
+# 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.
+#
+
+################################################################################
+# Capture file for TcpTimeout.java
+#
+# NOTE: This hexadecimal dump of DNS protocol messages was generated by
+#       running the GetEnv application program against a real DNS
+#       server along with DNSTracer
+#
+################################################################################
+
+# DNS Request
+
+0000: 32 72 01 00 00 01 00 00   00 00 00 00 05 68 6F 73  2r...........hos
+0010: 74 31 07 64 6F 6D 61 69   6E 31 03 63 6F 6D 00 00  t1.domain1.com..
+0020: FF 00 FF                                           ...
+
+
+# DNS Response
+
+0000: 32 72 82 00 00 01 00 06   00 01 00 01 05 68 6F 73  2r...........hos
+0010: 74 31 07 64 6F 6D 61 69   6E 31 03 63 6F 6D 00 00  t1.domain1.com..
+0020: FF 00 01 C0 0C 00 10 00   01 00 00 8C A0 00 15 14  ................
+0030: 41 20 76 65 72 79 20 70   6F 70 75 6C 61 72 20 68  A very popular h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/com/sun/jndi/dns/ConfigTests/TcpTimeout.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,151 @@
+/*
+ * 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.
+ */
+
+import jtreg.SkippedException;
+
+import javax.naming.directory.InitialDirContext;
+import java.io.IOException;
+import java.net.BindException;
+import java.net.InetAddress;
+import java.net.ServerSocket;
+
+import static java.util.concurrent.TimeUnit.NANOSECONDS;
+import static jdk.test.lib.Utils.adjustTimeout;
+
+/*
+ * @test
+ * @bug 8228580
+ * @summary Tests that we get a DNS response when the UDP DNS server returns a
+ *          truncated response and the TCP DNS server does not respond at all
+ *          after connect.
+ * @library ../lib/
+ * @library /test/lib
+ * @modules java.base/sun.security.util
+ * @run main TcpTimeout
+ * @run main TcpTimeout -Dcom.sun.jndi.dns.timeout.initial=5000
+ */
+
+public class TcpTimeout extends DNSTestBase {
+    private TcpDnsServer tcpDnsServer;
+
+    /* The acceptable variation in timeout measurement. */
+    private static final long TOLERANCE = adjustTimeout(5_000);
+
+    /* The acceptable variation of early returns from timed socket operations. */
+    private static final long PREMATURE_RETURN = adjustTimeout(100);
+
+    public static void main(String[] args) throws Exception {
+        new TcpTimeout().run(args);
+    }
+
+    @Override
+    public void runTest() throws Exception {
+        /* The default timeout value is 1 second, as stated in the
+           jdk.naming.dns module docs. */
+        long timeout = 1_000;
+        var envTimeout = env().get("com.sun.jndi.dns.timeout.initial");
+        if (envTimeout != null)
+            timeout = Long.parseLong(String.valueOf(envTimeout));
+
+        setContext(new InitialDirContext(env()));
+
+        long startNanos = System.nanoTime();
+
+        /* perform query */
+        var attrs = context().getAttributes("host1");
+
+        long elapsed = NANOSECONDS.toMillis(System.nanoTime() - startNanos);
+        if (elapsed < timeout - PREMATURE_RETURN || elapsed > timeout + TOLERANCE) {
+            throw new RuntimeException(String.format(
+                    "elapsed=%s, timeout=%s, TOLERANCE=%s, PREMATURE_RETURN=%s",
+                    elapsed, timeout, TOLERANCE, PREMATURE_RETURN));
+        }
+
+        DNSTestUtils.debug(attrs);
+
+        /* Note that the returned attributes are truncated and the response
+        is not valid. */
+        var txtAttr = attrs.get("TXT");
+        if (txtAttr == null)
+            throw new RuntimeException("TXT attribute missing.");
+    }
+
+    @Override
+    public void initTest(String[] args) {
+        /* We need to bind the TCP server on the same port the UDP server is
+        listening to. This may not be possible if that port is in use. Retry
+        MAX_RETRIES times relying on UDP port randomness. */
+        final int MAX_RETRIES = 5;
+        for (int i = 0; i < MAX_RETRIES; i++) {
+            super.initTest(args);
+            var udpServer = (Server) env().get(DNSTestUtils.TEST_DNS_SERVER_THREAD);
+            int port = udpServer.getPort();
+            try {
+                tcpDnsServer = new TcpDnsServer(port);
+                break; // success
+            } catch (BindException be) {
+                DNSTestUtils.debug("Failed to bind server socket on port " + port
+                                           + ", retry no. " + (i + 1) + ", " + be.getMessage());
+            } catch (Exception ex) {
+                throw new RuntimeException("Unexpected exception during initTest", ex);
+            } finally {
+                if (tcpDnsServer == null) { // cleanup behind exceptions
+                    super.cleanupTest();
+                }
+            }
+        }
+
+        if (tcpDnsServer == null) {
+            throw new SkippedException("Cannot start TCP server after "
+                                               + MAX_RETRIES
+                                               + " tries, skip the test");
+        }
+    }
+
+    @Override
+    public void cleanupTest() {
+        super.cleanupTest();
+        if (tcpDnsServer != null)
+            tcpDnsServer.stopServer();
+    }
+
+    /**
+     * A TCP server that accepts a connection and does nothing else: causes read
+     * timeout on client side.
+     */
+    private static class TcpDnsServer {
+        final ServerSocket serverSocket;
+
+        TcpDnsServer(int port) throws IOException {
+            serverSocket = new ServerSocket(port, 0, InetAddress.getLoopbackAddress());
+            System.out.println("TcpDnsServer: listening on port " + port);
+        }
+
+        void stopServer() {
+            try {
+                if (serverSocket != null)
+                    serverSocket.close();
+            } catch (Exception ignored) { }
+        }
+    }
+}
--- a/test/jdk/java/net/httpclient/websocket/Abort.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/jdk/java/net/httpclient/websocket/Abort.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -29,7 +29,6 @@
  *       Abort
  */
 
-import org.testng.annotations.AfterTest;
 import org.testng.annotations.Test;
 
 import java.io.IOException;
@@ -56,38 +55,35 @@
     private static final Class<IllegalArgumentException> IAE = IllegalArgumentException.class;
     private static final Class<IOException> IOE = IOException.class;
 
-    private DummyWebSocketServer server;
-    private WebSocket webSocket;
-
-    @AfterTest
-    public void cleanup() {
-        server.close();
-        webSocket.abort();
-    }
 
     @Test
     public void onOpenThenAbort() throws Exception {
         int[] bytes = new int[]{
                 0x88, 0x00, // opcode=close
         };
-        server = Support.serverWithCannedData(bytes);
-        server.open();
-        // messages are available
-        MockListener listener = new MockListener() {
-            @Override
-            protected void onOpen0(WebSocket webSocket) {
-                // unbounded request
-                webSocket.request(Long.MAX_VALUE);
+        try (var server = Support.serverWithCannedData(bytes)) {
+            server.open();
+            // messages are available
+            MockListener listener = new MockListener() {
+                @Override
+                protected void onOpen0(WebSocket webSocket) {
+                    // unbounded request
+                    webSocket.request(Long.MAX_VALUE);
+                    webSocket.abort();
+                }
+            };
+            var webSocket = newHttpClient().newWebSocketBuilder()
+                    .buildAsync(server.getURI(), listener)
+                    .join();
+            try {
+                TimeUnit.SECONDS.sleep(5);
+                List<MockListener.Invocation> inv = listener.invocationsSoFar();
+                // no more invocations after onOpen as WebSocket was aborted
+                assertEquals(inv, List.of(MockListener.Invocation.onOpen(webSocket)));
+            } finally {
                 webSocket.abort();
             }
-        };
-        webSocket = newHttpClient().newWebSocketBuilder()
-                .buildAsync(server.getURI(), listener)
-                .join();
-        TimeUnit.SECONDS.sleep(5);
-        List<MockListener.Invocation> inv = listener.invocationsSoFar();
-        // no more invocations after onOpen as WebSocket was aborted
-        assertEquals(inv, List.of(MockListener.Invocation.onOpen(webSocket)));
+        }
     }
 
     @Test
@@ -96,33 +92,38 @@
                 0x81, 0x00, // opcode=text, fin=true
                 0x88, 0x00, // opcode=close
         };
-        server = Support.serverWithCannedData(bytes);
-        server.open();
-        MockListener listener = new MockListener() {
-            @Override
-            protected void onOpen0(WebSocket webSocket) {
-                // unbounded request
-                webSocket.request(Long.MAX_VALUE);
-            }
+        try (var server = Support.serverWithCannedData(bytes)) {
+            server.open();
+            MockListener listener = new MockListener() {
+                @Override
+                protected void onOpen0(WebSocket webSocket) {
+                    // unbounded request
+                    webSocket.request(Long.MAX_VALUE);
+                }
 
-            @Override
-            protected CompletionStage<?> onText0(WebSocket webSocket,
-                                                 CharSequence message,
-                                                 boolean last) {
+                @Override
+                protected CompletionStage<?> onText0(WebSocket webSocket,
+                                                     CharSequence message,
+                                                     boolean last) {
+                    webSocket.abort();
+                    return super.onText0(webSocket, message, last);
+                }
+            };
+            var webSocket = newHttpClient().newWebSocketBuilder()
+                    .buildAsync(server.getURI(), listener)
+                    .join();
+            try {
+                TimeUnit.SECONDS.sleep(5);
+                List<MockListener.Invocation> inv = listener.invocationsSoFar();
+                // no more invocations after onOpen, onBinary as WebSocket was aborted
+                List<MockListener.Invocation> expected = List.of(
+                        MockListener.Invocation.onOpen(webSocket),
+                        MockListener.Invocation.onText(webSocket, "", true));
+                assertEquals(inv, expected);
+            } finally {
                 webSocket.abort();
-                return super.onText0(webSocket, message, last);
             }
-        };
-        webSocket = newHttpClient().newWebSocketBuilder()
-                .buildAsync(server.getURI(), listener)
-                .join();
-        TimeUnit.SECONDS.sleep(5);
-        List<MockListener.Invocation> inv = listener.invocationsSoFar();
-        // no more invocations after onOpen, onBinary as WebSocket was aborted
-        List<MockListener.Invocation> expected = List.of(
-                MockListener.Invocation.onOpen(webSocket),
-                MockListener.Invocation.onText(webSocket, "", true));
-        assertEquals(inv, expected);
+        }
     }
 
     @Test
@@ -131,33 +132,38 @@
                 0x82, 0x00, // opcode=binary, fin=true
                 0x88, 0x00, // opcode=close
         };
-        server = Support.serverWithCannedData(bytes);
-        server.open();
-        MockListener listener = new MockListener() {
-            @Override
-            protected void onOpen0(WebSocket webSocket) {
-                // unbounded request
-                webSocket.request(Long.MAX_VALUE);
-            }
+        try (var server = Support.serverWithCannedData(bytes)) {
+            server.open();
+            MockListener listener = new MockListener() {
+                @Override
+                protected void onOpen0(WebSocket webSocket) {
+                    // unbounded request
+                    webSocket.request(Long.MAX_VALUE);
+                }
 
-            @Override
-            protected CompletionStage<?> onBinary0(WebSocket webSocket,
-                                                   ByteBuffer message,
-                                                   boolean last) {
+                @Override
+                protected CompletionStage<?> onBinary0(WebSocket webSocket,
+                                                       ByteBuffer message,
+                                                       boolean last) {
+                    webSocket.abort();
+                    return super.onBinary0(webSocket, message, last);
+                }
+            };
+            var webSocket = newHttpClient().newWebSocketBuilder()
+                    .buildAsync(server.getURI(), listener)
+                    .join();
+            try {
+                TimeUnit.SECONDS.sleep(5);
+                List<MockListener.Invocation> inv = listener.invocationsSoFar();
+                // no more invocations after onOpen, onBinary as WebSocket was aborted
+                List<MockListener.Invocation> expected = List.of(
+                        MockListener.Invocation.onOpen(webSocket),
+                        MockListener.Invocation.onBinary(webSocket, ByteBuffer.allocate(0), true));
+                assertEquals(inv, expected);
+            } finally {
                 webSocket.abort();
-                return super.onBinary0(webSocket, message, last);
             }
-        };
-        webSocket = newHttpClient().newWebSocketBuilder()
-                .buildAsync(server.getURI(), listener)
-                .join();
-        TimeUnit.SECONDS.sleep(5);
-        List<MockListener.Invocation> inv = listener.invocationsSoFar();
-        // no more invocations after onOpen, onBinary as WebSocket was aborted
-        List<MockListener.Invocation> expected = List.of(
-                MockListener.Invocation.onOpen(webSocket),
-                MockListener.Invocation.onBinary(webSocket, ByteBuffer.allocate(0), true));
-        assertEquals(inv, expected);
+        }
     }
 
     @Test
@@ -166,32 +172,37 @@
                 0x89, 0x00, // opcode=ping
                 0x88, 0x00, // opcode=close
         };
-        server = Support.serverWithCannedData(bytes);
-        server.open();
-        MockListener listener = new MockListener() {
-            @Override
-            protected void onOpen0(WebSocket webSocket) {
-                // unbounded request
-                webSocket.request(Long.MAX_VALUE);
-            }
+        try (var server = Support.serverWithCannedData(bytes)) {
+            server.open();
+            MockListener listener = new MockListener() {
+                @Override
+                protected void onOpen0(WebSocket webSocket) {
+                    // unbounded request
+                    webSocket.request(Long.MAX_VALUE);
+                }
 
-            @Override
-            protected CompletionStage<?> onPing0(WebSocket webSocket,
-                                                 ByteBuffer message) {
+                @Override
+                protected CompletionStage<?> onPing0(WebSocket webSocket,
+                                                     ByteBuffer message) {
+                    webSocket.abort();
+                    return super.onPing0(webSocket, message);
+                }
+            };
+            var webSocket = newHttpClient().newWebSocketBuilder()
+                    .buildAsync(server.getURI(), listener)
+                    .join();
+            try {
+                TimeUnit.SECONDS.sleep(5);
+                List<MockListener.Invocation> inv = listener.invocationsSoFar();
+                // no more invocations after onOpen, onPing as WebSocket was aborted
+                List<MockListener.Invocation> expected = List.of(
+                        MockListener.Invocation.onOpen(webSocket),
+                        MockListener.Invocation.onPing(webSocket, ByteBuffer.allocate(0)));
+                assertEquals(inv, expected);
+            } finally {
                 webSocket.abort();
-                return super.onPing0(webSocket, message);
             }
-        };
-        webSocket = newHttpClient().newWebSocketBuilder()
-                .buildAsync(server.getURI(), listener)
-                .join();
-        TimeUnit.SECONDS.sleep(5);
-        List<MockListener.Invocation> inv = listener.invocationsSoFar();
-        // no more invocations after onOpen, onPing as WebSocket was aborted
-        List<MockListener.Invocation> expected = List.of(
-                MockListener.Invocation.onOpen(webSocket),
-                MockListener.Invocation.onPing(webSocket, ByteBuffer.allocate(0)));
-        assertEquals(inv, expected);
+        }
     }
 
     @Test
@@ -200,32 +211,37 @@
                 0x8a, 0x00, // opcode=pong
                 0x88, 0x00, // opcode=close
         };
-        server = Support.serverWithCannedData(bytes);
-        server.open();
-        MockListener listener = new MockListener() {
-            @Override
-            protected void onOpen0(WebSocket webSocket) {
-                // unbounded request
-                webSocket.request(Long.MAX_VALUE);
-            }
+        try (var server = Support.serverWithCannedData(bytes)) {
+            server.open();
+            MockListener listener = new MockListener() {
+                @Override
+                protected void onOpen0(WebSocket webSocket) {
+                    // unbounded request
+                    webSocket.request(Long.MAX_VALUE);
+                }
 
-            @Override
-            protected CompletionStage<?> onPong0(WebSocket webSocket,
-                                                 ByteBuffer message) {
+                @Override
+                protected CompletionStage<?> onPong0(WebSocket webSocket,
+                                                     ByteBuffer message) {
+                    webSocket.abort();
+                    return super.onPong0(webSocket, message);
+                }
+            };
+            var webSocket = newHttpClient().newWebSocketBuilder()
+                    .buildAsync(server.getURI(), listener)
+                    .join();
+            try {
+                TimeUnit.SECONDS.sleep(5);
+                List<MockListener.Invocation> inv = listener.invocationsSoFar();
+                // no more invocations after onOpen, onPong as WebSocket was aborted
+                List<MockListener.Invocation> expected = List.of(
+                        MockListener.Invocation.onOpen(webSocket),
+                        MockListener.Invocation.onPong(webSocket, ByteBuffer.allocate(0)));
+                assertEquals(inv, expected);
+            } finally {
                 webSocket.abort();
-                return super.onPong0(webSocket, message);
             }
-        };
-        webSocket = newHttpClient().newWebSocketBuilder()
-                .buildAsync(server.getURI(), listener)
-                .join();
-        TimeUnit.SECONDS.sleep(5);
-        List<MockListener.Invocation> inv = listener.invocationsSoFar();
-        // no more invocations after onOpen, onPong as WebSocket was aborted
-        List<MockListener.Invocation> expected = List.of(
-                MockListener.Invocation.onOpen(webSocket),
-                MockListener.Invocation.onPong(webSocket, ByteBuffer.allocate(0)));
-        assertEquals(inv, expected);
+        }
     }
 
     @Test
@@ -234,33 +250,38 @@
                 0x88, 0x00, // opcode=close
                 0x8a, 0x00, // opcode=pong
         };
-        server = Support.serverWithCannedData(bytes);
-        server.open();
-        MockListener listener = new MockListener() {
-            @Override
-            protected void onOpen0(WebSocket webSocket) {
-                // unbounded request
-                webSocket.request(Long.MAX_VALUE);
-            }
+        try (var server = Support.serverWithCannedData(bytes)) {
+            server.open();
+            MockListener listener = new MockListener() {
+                @Override
+                protected void onOpen0(WebSocket webSocket) {
+                    // unbounded request
+                    webSocket.request(Long.MAX_VALUE);
+                }
 
-            @Override
-            protected CompletionStage<?> onClose0(WebSocket webSocket,
-                                                  int statusCode,
-                                                  String reason) {
+                @Override
+                protected CompletionStage<?> onClose0(WebSocket webSocket,
+                                                      int statusCode,
+                                                      String reason) {
+                    webSocket.abort();
+                    return super.onClose0(webSocket, statusCode, reason);
+                }
+            };
+            var webSocket = newHttpClient().newWebSocketBuilder()
+                    .buildAsync(server.getURI(), listener)
+                    .join();
+            try {
+                TimeUnit.SECONDS.sleep(5);
+                List<MockListener.Invocation> inv = listener.invocationsSoFar();
+                // no more invocations after onOpen, onClose
+                List<MockListener.Invocation> expected = List.of(
+                        MockListener.Invocation.onOpen(webSocket),
+                        MockListener.Invocation.onClose(webSocket, 1005, ""));
+                assertEquals(inv, expected);
+            } finally {
                 webSocket.abort();
-                return super.onClose0(webSocket, statusCode, reason);
             }
-        };
-        webSocket = newHttpClient().newWebSocketBuilder()
-                .buildAsync(server.getURI(), listener)
-                .join();
-        TimeUnit.SECONDS.sleep(5);
-        List<MockListener.Invocation> inv = listener.invocationsSoFar();
-        // no more invocations after onOpen, onClose
-        List<MockListener.Invocation> expected = List.of(
-                MockListener.Invocation.onOpen(webSocket),
-                MockListener.Invocation.onClose(webSocket, 1005, ""));
-        assertEquals(inv, expected);
+        }
     }
 
     @Test
@@ -271,32 +292,37 @@
         int[] bytes = new int[badPingHeader.length + 128 + closeMessage.length];
         System.arraycopy(badPingHeader, 0, bytes, 0, badPingHeader.length);
         System.arraycopy(closeMessage, 0, bytes, badPingHeader.length + 128, closeMessage.length);
-        server = Support.serverWithCannedData(bytes);
-        server.open();
-        MockListener listener = new MockListener() {
-            @Override
-            protected void onOpen0(WebSocket webSocket) {
-                // unbounded request
-                webSocket.request(Long.MAX_VALUE);
-            }
+        try (var server = Support.serverWithCannedData(bytes)) {
+            server.open();
+            MockListener listener = new MockListener() {
+                @Override
+                protected void onOpen0(WebSocket webSocket) {
+                    // unbounded request
+                    webSocket.request(Long.MAX_VALUE);
+                }
 
-            @Override
-            protected void onError0(WebSocket webSocket, Throwable error) {
+                @Override
+                protected void onError0(WebSocket webSocket, Throwable error) {
+                    webSocket.abort();
+                    super.onError0(webSocket, error);
+                }
+            };
+            var webSocket = newHttpClient().newWebSocketBuilder()
+                    .buildAsync(server.getURI(), listener)
+                    .join();
+            try {
+                TimeUnit.SECONDS.sleep(5);
+                List<MockListener.Invocation> inv = listener.invocationsSoFar();
+                // no more invocations after onOpen, onError
+                List<MockListener.Invocation> expected = List.of(
+                        MockListener.Invocation.onOpen(webSocket),
+                        MockListener.Invocation.onError(webSocket, ProtocolException.class));
+                System.out.println("actual invocations:" + Arrays.toString(inv.toArray()));
+                assertEquals(inv, expected);
+            } finally {
                 webSocket.abort();
-                super.onError0(webSocket, error);
             }
-        };
-        webSocket = newHttpClient().newWebSocketBuilder()
-                .buildAsync(server.getURI(), listener)
-                .join();
-        TimeUnit.SECONDS.sleep(5);
-        List<MockListener.Invocation> inv = listener.invocationsSoFar();
-        // no more invocations after onOpen, onError
-        List<MockListener.Invocation> expected = List.of(
-                MockListener.Invocation.onOpen(webSocket),
-                MockListener.Invocation.onError(webSocket, ProtocolException.class));
-        System.out.println("actual invocations:" + Arrays.toString(inv.toArray()));
-        assertEquals(inv, expected);
+        }
     }
 
     @Test
@@ -352,65 +378,70 @@
                 0x82, 0x00, // opcode=binary, fin=true
                 0x88, 0x00, // opcode=close
         };
-        server = Support.serverWithCannedData(bytes);
-        server.open();
+        try (var server = Support.serverWithCannedData(bytes)) {
+            server.open();
 
-        WebSocket ws = newHttpClient()
-                .newWebSocketBuilder()
-                .buildAsync(server.getURI(), listener)
-                .join();
-        for (int i = 0; i < 3; i++) {
-            System.out.printf("iteration #%s%n", i);
-            // after the first abort() each consecutive one must be a no-op,
-            // moreover, query methods should continue to return consistent
-            // values
-            for (int j = 0; j < 3; j++) {
-                System.out.printf("abort #%s%n", j);
+            WebSocket ws = newHttpClient()
+                    .newWebSocketBuilder()
+                    .buildAsync(server.getURI(), listener)
+                    .join();
+            try {
+                for (int i = 0; i < 3; i++) {
+                    System.out.printf("iteration #%s%n", i);
+                    // after the first abort() each consecutive one must be a no-op,
+                    // moreover, query methods should continue to return consistent
+                    // values
+                    for (int j = 0; j < 3; j++) {
+                        System.out.printf("abort #%s%n", j);
+                        ws.abort();
+                        assertTrue(ws.isInputClosed());
+                        assertTrue(ws.isOutputClosed());
+                        assertEquals(ws.getSubprotocol(), "");
+                    }
+                    // at this point valid requests MUST be a no-op:
+                    for (int j = 0; j < 3; j++) {
+                        System.out.printf("request #%s%n", j);
+                        ws.request(1);
+                        ws.request(2);
+                        ws.request(8);
+                        ws.request(Integer.MAX_VALUE);
+                        ws.request(Long.MAX_VALUE);
+                        // invalid requests MUST throw IAE:
+                        assertThrows(IAE, () -> ws.request(Integer.MIN_VALUE));
+                        assertThrows(IAE, () -> ws.request(Long.MIN_VALUE));
+                        assertThrows(IAE, () -> ws.request(-1));
+                        assertThrows(IAE, () -> ws.request(0));
+                    }
+                }
+                // even though there is a bunch of messages readily available on the
+                // wire we shouldn't have received any of them as we aborted before
+                // the first request
+                try {
+                    messageReceived.get(5, TimeUnit.SECONDS);
+                    fail();
+                } catch (TimeoutException expected) {
+                    System.out.println("Finished waiting");
+                }
+                for (int i = 0; i < 3; i++) {
+                    System.out.printf("send #%s%n", i);
+                    Support.assertFails(IOE, ws.sendText("text!", false));
+                    Support.assertFails(IOE, ws.sendText("text!", true));
+                    Support.assertFails(IOE, ws.sendBinary(ByteBuffer.allocate(16), false));
+                    Support.assertFails(IOE, ws.sendBinary(ByteBuffer.allocate(16), true));
+                    Support.assertFails(IOE, ws.sendPing(ByteBuffer.allocate(16)));
+                    Support.assertFails(IOE, ws.sendPong(ByteBuffer.allocate(16)));
+                    Support.assertFails(IOE, ws.sendClose(NORMAL_CLOSURE, "a reason"));
+                    assertThrows(NPE, () -> ws.sendText(null, false));
+                    assertThrows(NPE, () -> ws.sendText(null, true));
+                    assertThrows(NPE, () -> ws.sendBinary(null, false));
+                    assertThrows(NPE, () -> ws.sendBinary(null, true));
+                    assertThrows(NPE, () -> ws.sendPing(null));
+                    assertThrows(NPE, () -> ws.sendPong(null));
+                    assertThrows(NPE, () -> ws.sendClose(NORMAL_CLOSURE, null));
+                }
+            } finally {
                 ws.abort();
-                assertTrue(ws.isInputClosed());
-                assertTrue(ws.isOutputClosed());
-                assertEquals(ws.getSubprotocol(), "");
             }
-            // at this point valid requests MUST be a no-op:
-            for (int j = 0; j < 3; j++) {
-                System.out.printf("request #%s%n", j);
-                ws.request(1);
-                ws.request(2);
-                ws.request(8);
-                ws.request(Integer.MAX_VALUE);
-                ws.request(Long.MAX_VALUE);
-                // invalid requests MUST throw IAE:
-                assertThrows(IAE, () -> ws.request(Integer.MIN_VALUE));
-                assertThrows(IAE, () -> ws.request(Long.MIN_VALUE));
-                assertThrows(IAE, () -> ws.request(-1));
-                assertThrows(IAE, () -> ws.request(0));
-            }
-        }
-        // even though there is a bunch of messages readily available on the
-        // wire we shouldn't have received any of them as we aborted before
-        // the first request
-        try {
-            messageReceived.get(5, TimeUnit.SECONDS);
-            fail();
-        } catch (TimeoutException expected) {
-            System.out.println("Finished waiting");
-        }
-        for (int i = 0; i < 3; i++) {
-            System.out.printf("send #%s%n", i);
-            Support.assertFails(IOE, ws.sendText("text!", false));
-            Support.assertFails(IOE, ws.sendText("text!", true));
-            Support.assertFails(IOE, ws.sendBinary(ByteBuffer.allocate(16), false));
-            Support.assertFails(IOE, ws.sendBinary(ByteBuffer.allocate(16), true));
-            Support.assertFails(IOE, ws.sendPing(ByteBuffer.allocate(16)));
-            Support.assertFails(IOE, ws.sendPong(ByteBuffer.allocate(16)));
-            Support.assertFails(IOE, ws.sendClose(NORMAL_CLOSURE, "a reason"));
-            assertThrows(NPE, () -> ws.sendText(null, false));
-            assertThrows(NPE, () -> ws.sendText(null, true));
-            assertThrows(NPE, () -> ws.sendBinary(null, false));
-            assertThrows(NPE, () -> ws.sendBinary(null, true));
-            assertThrows(NPE, () -> ws.sendPing(null));
-            assertThrows(NPE, () -> ws.sendPong(null));
-            assertThrows(NPE, () -> ws.sendClose(NORMAL_CLOSURE, null));
         }
     }
 }
--- a/test/jdk/java/net/httpclient/websocket/AutomaticPong.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/jdk/java/net/httpclient/websocket/AutomaticPong.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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,8 +28,6 @@
  *      -Djdk.internal.httpclient.websocket.debug=true
  *       AutomaticPong
  */
-
-import org.testng.annotations.AfterTest;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
@@ -46,16 +44,6 @@
 import static org.testng.Assert.fail;
 
 public class AutomaticPong {
-
-    private DummyWebSocketServer server;
-    private WebSocket webSocket;
-
-    @AfterTest
-    public void cleanup() {
-        server.close();
-        webSocket.abort();
-    }
-
     /*
      * The sendClose method has been invoked and a Ping comes from the server.
      * Naturally, the client cannot reply with a Pong (the output has been
@@ -72,32 +60,36 @@
                 0x89, 0x06, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x3f, // ping hello?
                 0x88, 0x00,                                     // close
         };
-        server = Support.serverWithCannedData(bytes);
-        server.open();
-        MockListener listener = new MockListener() {
-            @Override
-            protected void onOpen0(WebSocket webSocket) {
-                /* request nothing */
+        try (var server = Support.serverWithCannedData(bytes)) {
+            server.open();
+            MockListener listener = new MockListener() {
+                @Override
+                protected void onOpen0(WebSocket webSocket) {
+                    /* request nothing */
+                }
+            };
+            var webSocket = newHttpClient()
+                    .newWebSocketBuilder()
+                    .buildAsync(server.getURI(), listener)
+                    .join();
+            try {
+                webSocket.sendClose(WebSocket.NORMAL_CLOSURE, "ok").join();
+                // now request all messages available
+                webSocket.request(Long.MAX_VALUE);
+                List<MockListener.Invocation> actual = listener.invocations();
+                ByteBuffer hello = ByteBuffer.wrap("hello?".getBytes(StandardCharsets.UTF_8));
+                ByteBuffer empty = ByteBuffer.allocate(0);
+                List<MockListener.Invocation> expected = List.of(
+                        MockListener.Invocation.onOpen(webSocket),
+                        MockListener.Invocation.onPing(webSocket, empty),
+                        MockListener.Invocation.onPing(webSocket, hello),
+                        MockListener.Invocation.onClose(webSocket, 1005, "")
+                );
+                assertEquals(actual, expected);
+            } finally {
+                webSocket.abort();
             }
-        };
-        webSocket = newHttpClient()
-                .newWebSocketBuilder()
-                .buildAsync(server.getURI(), listener)
-                .join();
-
-        webSocket.sendClose(WebSocket.NORMAL_CLOSURE, "ok").join();
-        // now request all messages available
-        webSocket.request(Long.MAX_VALUE);
-        List<MockListener.Invocation> actual = listener.invocations();
-        ByteBuffer hello = ByteBuffer.wrap("hello?".getBytes(StandardCharsets.UTF_8));
-        ByteBuffer empty = ByteBuffer.allocate(0);
-        List<MockListener.Invocation> expected = List.of(
-                MockListener.Invocation.onOpen(webSocket),
-                MockListener.Invocation.onPing(webSocket, empty),
-                MockListener.Invocation.onPing(webSocket, hello),
-                MockListener.Invocation.onClose(webSocket, 1005, "")
-        );
-        assertEquals(actual, expected);
+        }
     }
 
     /*
@@ -131,84 +123,100 @@
         .write(buffer);
         buffer.putChar((char) 1000);
         buffer.flip();
-        server = Support.serverWithCannedData(buffer.array());
-        server.open();
-        MockListener listener = new MockListener();
-        webSocket = newHttpClient()
-                .newWebSocketBuilder()
-                .buildAsync(server.getURI(), listener)
-                .join();
-        List<MockListener.Invocation> inv = listener.invocations();
-        assertEquals(inv.size(), nPings + 2); // n * onPing + onOpen + onClose
+        try (var server = Support.serverWithCannedData(buffer.array())) {
+            server.open();
+            MockListener listener = new MockListener();
+            var webSocket = newHttpClient()
+                    .newWebSocketBuilder()
+                    .buildAsync(server.getURI(), listener)
+                    .join();
+            try {
+                List<MockListener.Invocation> inv = listener.invocations();
+                assertEquals(inv.size(), nPings + 2); // n * onPing + onOpen + onClose
+
+                ByteBuffer data = server.read();
+                Frame.Reader reader = new Frame.Reader();
+
+                Frame.Consumer consumer = new Frame.Consumer() {
 
-        ByteBuffer data = server.read();
-        Frame.Reader reader = new Frame.Reader();
+                    ByteBuffer number = ByteBuffer.allocate(4);
+                    Frame.Masker masker = new Frame.Masker();
+                    int i = -1;
+                    boolean closed;
+
+                    @Override
+                    public void fin(boolean value) {
+                        assertTrue(value);
+                    }
 
-        Frame.Consumer consumer = new Frame.Consumer() {
+                    @Override
+                    public void rsv1(boolean value) {
+                        assertFalse(value);
+                    }
+
+                    @Override
+                    public void rsv2(boolean value) {
+                        assertFalse(value);
+                    }
+
+                    @Override
+                    public void rsv3(boolean value) {
+                        assertFalse(value);
+                    }
 
-            ByteBuffer number = ByteBuffer.allocate(4);
-            Frame.Masker masker = new Frame.Masker();
-            int i = -1;
-            boolean closed;
+                    @Override
+                    public void opcode(Frame.Opcode value) {
+                        if (value == Frame.Opcode.CLOSE) {
+                            closed = true;
+                            return;
+                        }
+                        assertEquals(value, Frame.Opcode.PONG);
+                    }
 
-            @Override
-            public void fin(boolean value) { assertTrue(value); }
+                    @Override
+                    public void mask(boolean value) {
+                        assertTrue(value);
+                    }
 
-            @Override
-            public void rsv1(boolean value) { assertFalse(value); }
+                    @Override
+                    public void payloadLen(long value) {
+                        if (!closed)
+                            assertEquals(value, 4);
+                    }
+
+                    @Override
+                    public void maskingKey(int value) {
+                        masker.mask(value);
+                    }
 
-            @Override
-            public void rsv2(boolean value) { assertFalse(value); }
-
-            @Override
-            public void rsv3(boolean value) { assertFalse(value); }
+                    @Override
+                    public void payloadData(ByteBuffer src) {
+                        masker.transferMasking(src, number);
+                        if (closed) {
+                            return;
+                        }
+                        number.flip();
+                        int n = number.getInt();
+                        System.out.printf("pong number=%s%n", n);
+                        number.clear();
+                        // a Pong with the number less than the maximum of Pongs already
+                        // received MUST never be received
+                        if (i >= n) {
+                            fail(String.format("i=%s, n=%s", i, n));
+                        }
+                        i = n;
+                    }
 
-            @Override
-            public void opcode(Frame.Opcode value) {
-                if (value == Frame.Opcode.CLOSE) {
-                    closed = true;
-                    return;
+                    @Override
+                    public void endFrame() {
+                    }
+                };
+                while (data.hasRemaining()) {
+                    reader.readFrame(data, consumer);
                 }
-                assertEquals(value, Frame.Opcode.PONG);
-            }
-
-            @Override
-            public void mask(boolean value) { assertTrue(value); }
-
-            @Override
-            public void payloadLen(long value) {
-                if (!closed)
-                    assertEquals(value, 4);
-            }
-
-            @Override
-            public void maskingKey(int value) {
-                masker.mask(value);
+            } finally {
+                webSocket.abort();
             }
-
-            @Override
-            public void payloadData(ByteBuffer src) {
-                masker.transferMasking(src, number);
-                if (closed) {
-                    return;
-                }
-                number.flip();
-                int n = number.getInt();
-                System.out.printf("pong number=%s%n", n);
-                number.clear();
-                // a Pong with the number less than the maximum of Pongs already
-                // received MUST never be received
-                if (i >= n) {
-                    fail(String.format("i=%s, n=%s", i, n));
-                }
-                i = n;
-            }
-
-            @Override
-            public void endFrame() { }
-        };
-        while (data.hasRemaining()) {
-            reader.readFrame(data, consumer);
         }
     }
 
--- a/test/jdk/java/net/httpclient/websocket/SendTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/jdk/java/net/httpclient/websocket/SendTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -29,7 +29,6 @@
  *       SendTest
  */
 
-import org.testng.annotations.AfterTest;
 import org.testng.annotations.Test;
 
 import java.io.IOException;
@@ -46,40 +45,35 @@
 
     private static final Class<NullPointerException> NPE = NullPointerException.class;
 
-    private DummyWebSocketServer server;
-    private WebSocket webSocket;
-
-    @AfterTest
-    public void cleanup() {
-        server.close();
-        webSocket.abort();
-    }
-
     @Test
     public void sendMethodsThrowNPE() throws IOException {
-        server = new DummyWebSocketServer();
-        server.open();
-        webSocket = newBuilder().proxy(NO_PROXY).build().newWebSocketBuilder()
-                .buildAsync(server.getURI(), new WebSocket.Listener() { })
-                .join();
+        try (var server = new DummyWebSocketServer()) {
+            server.open();
+            var webSocket = newBuilder().proxy(NO_PROXY).build().newWebSocketBuilder()
+                    .buildAsync(server.getURI(), new WebSocket.Listener() { })
+                    .join();
+            try {
+                assertThrows(NPE, () -> webSocket.sendText(null, false));
+                assertThrows(NPE, () -> webSocket.sendText(null, true));
+                assertThrows(NPE, () -> webSocket.sendBinary(null, false));
+                assertThrows(NPE, () -> webSocket.sendBinary(null, true));
+                assertThrows(NPE, () -> webSocket.sendPing(null));
+                assertThrows(NPE, () -> webSocket.sendPong(null));
+                assertThrows(NPE, () -> webSocket.sendClose(NORMAL_CLOSURE, null));
 
-        assertThrows(NPE, () -> webSocket.sendText(null, false));
-        assertThrows(NPE, () -> webSocket.sendText(null, true));
-        assertThrows(NPE, () -> webSocket.sendBinary(null, false));
-        assertThrows(NPE, () -> webSocket.sendBinary(null, true));
-        assertThrows(NPE, () -> webSocket.sendPing(null));
-        assertThrows(NPE, () -> webSocket.sendPong(null));
-        assertThrows(NPE, () -> webSocket.sendClose(NORMAL_CLOSURE, null));
+                webSocket.abort();
 
-        webSocket.abort();
-
-        assertThrows(NPE, () -> webSocket.sendText(null, false));
-        assertThrows(NPE, () -> webSocket.sendText(null, true));
-        assertThrows(NPE, () -> webSocket.sendBinary(null, false));
-        assertThrows(NPE, () -> webSocket.sendBinary(null, true));
-        assertThrows(NPE, () -> webSocket.sendPing(null));
-        assertThrows(NPE, () -> webSocket.sendPong(null));
-        assertThrows(NPE, () -> webSocket.sendClose(NORMAL_CLOSURE, null));
+                assertThrows(NPE, () -> webSocket.sendText(null, false));
+                assertThrows(NPE, () -> webSocket.sendText(null, true));
+                assertThrows(NPE, () -> webSocket.sendBinary(null, false));
+                assertThrows(NPE, () -> webSocket.sendBinary(null, true));
+                assertThrows(NPE, () -> webSocket.sendPing(null));
+                assertThrows(NPE, () -> webSocket.sendPong(null));
+                assertThrows(NPE, () -> webSocket.sendClose(NORMAL_CLOSURE, null));
+            } finally {
+                webSocket.abort();
+            }
+        }
     }
 
     // TODO: request in onClose/onError
@@ -88,14 +82,20 @@
 
     @Test
     public void sendCloseCompleted() throws IOException {
-        server = new DummyWebSocketServer();
-        server.open();
-        webSocket = newBuilder().proxy(NO_PROXY).build().newWebSocketBuilder()
-                .buildAsync(server.getURI(), new WebSocket.Listener() { })
-                .join();
-        webSocket.sendClose(NORMAL_CLOSURE, "").join();
-        assertTrue(webSocket.isOutputClosed());
-        assertEquals(webSocket.getSubprotocol(), "");
-        webSocket.request(1); // No exceptions must be thrown
+        try (var server = new DummyWebSocketServer()) {
+            server.open();
+            var webSocket = newBuilder().proxy(NO_PROXY).build().newWebSocketBuilder()
+                    .buildAsync(server.getURI(), new WebSocket.Listener() { })
+                    .join();
+            try {
+                webSocket.sendClose(NORMAL_CLOSURE, "").join();
+                assertTrue(webSocket.isOutputClosed());
+                assertEquals(webSocket.getSubprotocol(), "");
+                webSocket.request(1); // No exceptions must be thrown
+            } finally {
+                webSocket.abort();
+            }
+        }
     }
 }
+
--- a/test/jdk/java/net/httpclient/websocket/WebSocketTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/jdk/java/net/httpclient/websocket/WebSocketTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -29,7 +29,6 @@
  *       WebSocketTest
  */
 
-import org.testng.annotations.AfterTest;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
@@ -73,150 +72,150 @@
         Support.assertCompletesExceptionally(clazz, stage);
     }
 
-    private DummyWebSocketServer server;
-    private WebSocket webSocket;
-
-    @AfterTest
-    public void cleanup() {
-        System.out.println("AFTER TEST");
-        if (server != null)
-            server.close();
-        if (webSocket != null)
-            webSocket.abort();
-    }
-
     @Test
     public void illegalArgument() throws IOException {
-        server = new DummyWebSocketServer();
-        server.open();
-        webSocket = newBuilder().proxy(NO_PROXY).build()
-                .newWebSocketBuilder()
-                .buildAsync(server.getURI(), new WebSocket.Listener() { })
-                .join();
+        try (var server = new DummyWebSocketServer()) {
+            server.open();
+            var webSocket = newBuilder().proxy(NO_PROXY).build()
+                    .newWebSocketBuilder()
+                    .buildAsync(server.getURI(), new WebSocket.Listener() { })
+                    .join();
+            try {
+                assertFails(IAE, webSocket.sendPing(ByteBuffer.allocate(126)));
+                assertFails(IAE, webSocket.sendPing(ByteBuffer.allocate(127)));
+                assertFails(IAE, webSocket.sendPing(ByteBuffer.allocate(128)));
+                assertFails(IAE, webSocket.sendPing(ByteBuffer.allocate(129)));
+                assertFails(IAE, webSocket.sendPing(ByteBuffer.allocate(256)));
 
-        assertFails(IAE, webSocket.sendPing(ByteBuffer.allocate(126)));
-        assertFails(IAE, webSocket.sendPing(ByteBuffer.allocate(127)));
-        assertFails(IAE, webSocket.sendPing(ByteBuffer.allocate(128)));
-        assertFails(IAE, webSocket.sendPing(ByteBuffer.allocate(129)));
-        assertFails(IAE, webSocket.sendPing(ByteBuffer.allocate(256)));
+                assertFails(IAE, webSocket.sendPong(ByteBuffer.allocate(126)));
+                assertFails(IAE, webSocket.sendPong(ByteBuffer.allocate(127)));
+                assertFails(IAE, webSocket.sendPong(ByteBuffer.allocate(128)));
+                assertFails(IAE, webSocket.sendPong(ByteBuffer.allocate(129)));
+                assertFails(IAE, webSocket.sendPong(ByteBuffer.allocate(256)));
 
-        assertFails(IAE, webSocket.sendPong(ByteBuffer.allocate(126)));
-        assertFails(IAE, webSocket.sendPong(ByteBuffer.allocate(127)));
-        assertFails(IAE, webSocket.sendPong(ByteBuffer.allocate(128)));
-        assertFails(IAE, webSocket.sendPong(ByteBuffer.allocate(129)));
-        assertFails(IAE, webSocket.sendPong(ByteBuffer.allocate(256)));
+                assertFails(IOE, webSocket.sendText(Support.incompleteString(), true));
+                assertFails(IOE, webSocket.sendText(Support.incompleteString(), false));
+                assertFails(IOE, webSocket.sendText(Support.malformedString(), true));
+                assertFails(IOE, webSocket.sendText(Support.malformedString(), false));
 
-        assertFails(IOE, webSocket.sendText(Support.incompleteString(), true));
-        assertFails(IOE, webSocket.sendText(Support.incompleteString(), false));
-        assertFails(IOE, webSocket.sendText(Support.malformedString(), true));
-        assertFails(IOE, webSocket.sendText(Support.malformedString(), false));
+                assertFails(IAE, webSocket.sendClose(NORMAL_CLOSURE, Support.stringWithNBytes(124)));
+                assertFails(IAE, webSocket.sendClose(NORMAL_CLOSURE, Support.stringWithNBytes(125)));
+                assertFails(IAE, webSocket.sendClose(NORMAL_CLOSURE, Support.stringWithNBytes(128)));
+                assertFails(IAE, webSocket.sendClose(NORMAL_CLOSURE, Support.stringWithNBytes(256)));
+                assertFails(IAE, webSocket.sendClose(NORMAL_CLOSURE, Support.stringWithNBytes(257)));
+                assertFails(IAE, webSocket.sendClose(NORMAL_CLOSURE, Support.stringWith2NBytes((123 / 2) + 1)));
+                assertFails(IAE, webSocket.sendClose(NORMAL_CLOSURE, Support.malformedString()));
+                assertFails(IAE, webSocket.sendClose(NORMAL_CLOSURE, Support.incompleteString()));
 
-        assertFails(IAE, webSocket.sendClose(NORMAL_CLOSURE, Support.stringWithNBytes(124)));
-        assertFails(IAE, webSocket.sendClose(NORMAL_CLOSURE, Support.stringWithNBytes(125)));
-        assertFails(IAE, webSocket.sendClose(NORMAL_CLOSURE, Support.stringWithNBytes(128)));
-        assertFails(IAE, webSocket.sendClose(NORMAL_CLOSURE, Support.stringWithNBytes(256)));
-        assertFails(IAE, webSocket.sendClose(NORMAL_CLOSURE, Support.stringWithNBytes(257)));
-        assertFails(IAE, webSocket.sendClose(NORMAL_CLOSURE, Support.stringWith2NBytes((123 / 2) + 1)));
-        assertFails(IAE, webSocket.sendClose(NORMAL_CLOSURE, Support.malformedString()));
-        assertFails(IAE, webSocket.sendClose(NORMAL_CLOSURE, Support.incompleteString()));
+                assertFails(IAE, webSocket.sendClose(-2, "a reason"));
+                assertFails(IAE, webSocket.sendClose(-1, "a reason"));
+                assertFails(IAE, webSocket.sendClose(0, "a reason"));
+                assertFails(IAE, webSocket.sendClose(1, "a reason"));
+                assertFails(IAE, webSocket.sendClose(500, "a reason"));
+                assertFails(IAE, webSocket.sendClose(998, "a reason"));
+                assertFails(IAE, webSocket.sendClose(999, "a reason"));
+                assertFails(IAE, webSocket.sendClose(1002, "a reason"));
+                assertFails(IAE, webSocket.sendClose(1003, "a reason"));
+                assertFails(IAE, webSocket.sendClose(1006, "a reason"));
+                assertFails(IAE, webSocket.sendClose(1007, "a reason"));
+                assertFails(IAE, webSocket.sendClose(1009, "a reason"));
+                assertFails(IAE, webSocket.sendClose(1010, "a reason"));
+                assertFails(IAE, webSocket.sendClose(1012, "a reason"));
+                assertFails(IAE, webSocket.sendClose(1013, "a reason"));
+                assertFails(IAE, webSocket.sendClose(1015, "a reason"));
+                assertFails(IAE, webSocket.sendClose(5000, "a reason"));
+                assertFails(IAE, webSocket.sendClose(32768, "a reason"));
+                assertFails(IAE, webSocket.sendClose(65535, "a reason"));
+                assertFails(IAE, webSocket.sendClose(65536, "a reason"));
+                assertFails(IAE, webSocket.sendClose(Integer.MAX_VALUE, "a reason"));
+                assertFails(IAE, webSocket.sendClose(Integer.MIN_VALUE, "a reason"));
 
-        assertFails(IAE, webSocket.sendClose(-2, "a reason"));
-        assertFails(IAE, webSocket.sendClose(-1, "a reason"));
-        assertFails(IAE, webSocket.sendClose(0, "a reason"));
-        assertFails(IAE, webSocket.sendClose(1, "a reason"));
-        assertFails(IAE, webSocket.sendClose(500, "a reason"));
-        assertFails(IAE, webSocket.sendClose(998, "a reason"));
-        assertFails(IAE, webSocket.sendClose(999, "a reason"));
-        assertFails(IAE, webSocket.sendClose(1002, "a reason"));
-        assertFails(IAE, webSocket.sendClose(1003, "a reason"));
-        assertFails(IAE, webSocket.sendClose(1006, "a reason"));
-        assertFails(IAE, webSocket.sendClose(1007, "a reason"));
-        assertFails(IAE, webSocket.sendClose(1009, "a reason"));
-        assertFails(IAE, webSocket.sendClose(1010, "a reason"));
-        assertFails(IAE, webSocket.sendClose(1012, "a reason"));
-        assertFails(IAE, webSocket.sendClose(1013, "a reason"));
-        assertFails(IAE, webSocket.sendClose(1015, "a reason"));
-        assertFails(IAE, webSocket.sendClose(5000, "a reason"));
-        assertFails(IAE, webSocket.sendClose(32768, "a reason"));
-        assertFails(IAE, webSocket.sendClose(65535, "a reason"));
-        assertFails(IAE, webSocket.sendClose(65536, "a reason"));
-        assertFails(IAE, webSocket.sendClose(Integer.MAX_VALUE, "a reason"));
-        assertFails(IAE, webSocket.sendClose(Integer.MIN_VALUE, "a reason"));
+                assertThrows(IAE, () -> webSocket.request(Integer.MIN_VALUE));
+                assertThrows(IAE, () -> webSocket.request(Long.MIN_VALUE));
+                assertThrows(IAE, () -> webSocket.request(-1));
+                assertThrows(IAE, () -> webSocket.request(0));
 
-        assertThrows(IAE, () -> webSocket.request(Integer.MIN_VALUE));
-        assertThrows(IAE, () -> webSocket.request(Long.MIN_VALUE));
-        assertThrows(IAE, () -> webSocket.request(-1));
-        assertThrows(IAE, () -> webSocket.request(0));
-
-        server.close();
+            } finally {
+                webSocket.abort();
+            }
+        }
     }
 
     @Test
     public void partialBinaryThenText() throws IOException {
-        server = new DummyWebSocketServer();
-        server.open();
-        webSocket = newBuilder().proxy(NO_PROXY).build().newWebSocketBuilder()
-                .buildAsync(server.getURI(), new WebSocket.Listener() { })
-                .join();
-        webSocket.sendBinary(ByteBuffer.allocate(16), false).join();
-        assertFails(ISE, webSocket.sendText("text", false));
-        assertFails(ISE, webSocket.sendText("text", true));
-        // Pings & Pongs are fine
-        webSocket.sendPing(ByteBuffer.allocate(125)).join();
-        webSocket.sendPong(ByteBuffer.allocate(125)).join();
-        server.close();
+        try (var server = new DummyWebSocketServer()) {
+            server.open();
+            var webSocket = newBuilder().proxy(NO_PROXY).build().newWebSocketBuilder()
+                    .buildAsync(server.getURI(), new WebSocket.Listener() { })
+                    .join();
+            try {
+                webSocket.sendBinary(ByteBuffer.allocate(16), false).join();
+                assertFails(ISE, webSocket.sendText("text", false));
+                assertFails(ISE, webSocket.sendText("text", true));
+                // Pings & Pongs are fine
+                webSocket.sendPing(ByteBuffer.allocate(125)).join();
+                webSocket.sendPong(ByteBuffer.allocate(125)).join();
+            } finally {
+                webSocket.abort();
+            }
+        }
     }
 
     @Test
     public void partialTextThenBinary() throws IOException {
-        server = new DummyWebSocketServer();
-        server.open();
-        webSocket = newBuilder().proxy(NO_PROXY).build().newWebSocketBuilder()
-                .buildAsync(server.getURI(), new WebSocket.Listener() { })
-                .join();
-
-        webSocket.sendText("text", false).join();
-        assertFails(ISE, webSocket.sendBinary(ByteBuffer.allocate(16), false));
-        assertFails(ISE, webSocket.sendBinary(ByteBuffer.allocate(16), true));
-        // Pings & Pongs are fine
-        webSocket.sendPing(ByteBuffer.allocate(125)).join();
-        webSocket.sendPong(ByteBuffer.allocate(125)).join();
-        server.close();
+        try (var server = new DummyWebSocketServer()) {
+            server.open();
+            var webSocket = newBuilder().proxy(NO_PROXY).build().newWebSocketBuilder()
+                    .buildAsync(server.getURI(), new WebSocket.Listener() { })
+                    .join();
+            try {
+                webSocket.sendText("text", false).join();
+                assertFails(ISE, webSocket.sendBinary(ByteBuffer.allocate(16), false));
+                assertFails(ISE, webSocket.sendBinary(ByteBuffer.allocate(16), true));
+                // Pings & Pongs are fine
+                webSocket.sendPing(ByteBuffer.allocate(125)).join();
+                webSocket.sendPong(ByteBuffer.allocate(125)).join();
+            } finally {
+                webSocket.abort();
+            }
+        }
     }
 
     @Test
     public void sendMethodsThrowIOE1() throws IOException {
-        server = new DummyWebSocketServer();
-        server.open();
-        webSocket = newBuilder().proxy(NO_PROXY).build()
-                .newWebSocketBuilder()
-                .buildAsync(server.getURI(), new WebSocket.Listener() { })
-                .join();
+        try (var server = new DummyWebSocketServer()) {
+            server.open();
+            var webSocket = newBuilder().proxy(NO_PROXY).build()
+                    .newWebSocketBuilder()
+                    .buildAsync(server.getURI(), new WebSocket.Listener() { })
+                    .join();
+            try {
+                webSocket.sendClose(NORMAL_CLOSURE, "ok").join();
 
-        webSocket.sendClose(NORMAL_CLOSURE, "ok").join();
-
-        assertFails(IOE, webSocket.sendClose(WebSocket.NORMAL_CLOSURE, "ok"));
+                assertFails(IOE, webSocket.sendClose(WebSocket.NORMAL_CLOSURE, "ok"));
 
-        assertFails(IOE, webSocket.sendText("", true));
-        assertFails(IOE, webSocket.sendText("", false));
-        assertFails(IOE, webSocket.sendText("abc", true));
-        assertFails(IOE, webSocket.sendText("abc", false));
-        assertFails(IOE, webSocket.sendBinary(ByteBuffer.allocate(0), true));
-        assertFails(IOE, webSocket.sendBinary(ByteBuffer.allocate(0), false));
-        assertFails(IOE, webSocket.sendBinary(ByteBuffer.allocate(1), true));
-        assertFails(IOE, webSocket.sendBinary(ByteBuffer.allocate(1), false));
+                assertFails(IOE, webSocket.sendText("", true));
+                assertFails(IOE, webSocket.sendText("", false));
+                assertFails(IOE, webSocket.sendText("abc", true));
+                assertFails(IOE, webSocket.sendText("abc", false));
+                assertFails(IOE, webSocket.sendBinary(ByteBuffer.allocate(0), true));
+                assertFails(IOE, webSocket.sendBinary(ByteBuffer.allocate(0), false));
+                assertFails(IOE, webSocket.sendBinary(ByteBuffer.allocate(1), true));
+                assertFails(IOE, webSocket.sendBinary(ByteBuffer.allocate(1), false));
 
-        assertFails(IOE, webSocket.sendPing(ByteBuffer.allocate(125)));
-        assertFails(IOE, webSocket.sendPing(ByteBuffer.allocate(124)));
-        assertFails(IOE, webSocket.sendPing(ByteBuffer.allocate(1)));
-        assertFails(IOE, webSocket.sendPing(ByteBuffer.allocate(0)));
+                assertFails(IOE, webSocket.sendPing(ByteBuffer.allocate(125)));
+                assertFails(IOE, webSocket.sendPing(ByteBuffer.allocate(124)));
+                assertFails(IOE, webSocket.sendPing(ByteBuffer.allocate(1)));
+                assertFails(IOE, webSocket.sendPing(ByteBuffer.allocate(0)));
 
-        assertFails(IOE, webSocket.sendPong(ByteBuffer.allocate(125)));
-        assertFails(IOE, webSocket.sendPong(ByteBuffer.allocate(124)));
-        assertFails(IOE, webSocket.sendPong(ByteBuffer.allocate(1)));
-        assertFails(IOE, webSocket.sendPong(ByteBuffer.allocate(0)));
-
-        server.close();
+                assertFails(IOE, webSocket.sendPong(ByteBuffer.allocate(125)));
+                assertFails(IOE, webSocket.sendPong(ByteBuffer.allocate(124)));
+                assertFails(IOE, webSocket.sendPong(ByteBuffer.allocate(1)));
+                assertFails(IOE, webSocket.sendPong(ByteBuffer.allocate(0)));
+            } finally {
+                webSocket.abort();
+            }
+        }
     }
 
     @DataProvider(name = "sequence")
@@ -251,150 +250,153 @@
     public void listenerSequentialOrder(int[] binary, long requestSize)
             throws IOException
     {
-
-        server = Support.serverWithCannedData(binary);
-        server.open();
+        try (var server = Support.serverWithCannedData(binary)) {
+            server.open();
 
-        CompletableFuture<Void> violation = new CompletableFuture<>();
+            CompletableFuture<Void> violation = new CompletableFuture<>();
 
-        MockListener listener = new MockListener(requestSize) {
+            MockListener listener = new MockListener(requestSize) {
 
-            final AtomicBoolean guard = new AtomicBoolean();
+                final AtomicBoolean guard = new AtomicBoolean();
 
-            private <T> T checkRunExclusively(Supplier<T> action) {
-                if (guard.getAndSet(true)) {
-                    violation.completeExceptionally(new RuntimeException());
-                }
-                try {
-                    return action.get();
-                } finally {
-                    if (!guard.getAndSet(false)) {
+                private <T> T checkRunExclusively(Supplier<T> action) {
+                    if (guard.getAndSet(true)) {
                         violation.completeExceptionally(new RuntimeException());
                     }
+                    try {
+                        return action.get();
+                    } finally {
+                        if (!guard.getAndSet(false)) {
+                            violation.completeExceptionally(new RuntimeException());
+                        }
+                    }
                 }
-            }
 
-            @Override
-            public void onOpen(WebSocket webSocket) {
-                checkRunExclusively(() -> {
-                    super.onOpen(webSocket);
-                    return null;
-                });
-            }
+                @Override
+                public void onOpen(WebSocket webSocket) {
+                    checkRunExclusively(() -> {
+                        super.onOpen(webSocket);
+                        return null;
+                    });
+                }
 
-            @Override
-            public CompletionStage<?> onText(WebSocket webSocket,
-                                             CharSequence data,
-                                             boolean last) {
-                return checkRunExclusively(
-                        () -> super.onText(webSocket, data, last));
-            }
+                @Override
+                public CompletionStage<?> onText(WebSocket webSocket,
+                                                 CharSequence data,
+                                                 boolean last) {
+                    return checkRunExclusively(
+                            () -> super.onText(webSocket, data, last));
+                }
 
-            @Override
-            public CompletionStage<?> onBinary(WebSocket webSocket,
-                                               ByteBuffer data,
-                                               boolean last) {
-                return checkRunExclusively(
-                        () -> super.onBinary(webSocket, data, last));
-            }
+                @Override
+                public CompletionStage<?> onBinary(WebSocket webSocket,
+                                                   ByteBuffer data,
+                                                   boolean last) {
+                    return checkRunExclusively(
+                            () -> super.onBinary(webSocket, data, last));
+                }
 
-            @Override
-            public CompletionStage<?> onPing(WebSocket webSocket,
-                                             ByteBuffer message) {
-                return checkRunExclusively(
-                        () -> super.onPing(webSocket, message));
-            }
+                @Override
+                public CompletionStage<?> onPing(WebSocket webSocket,
+                                                 ByteBuffer message) {
+                    return checkRunExclusively(
+                            () -> super.onPing(webSocket, message));
+                }
 
-            @Override
-            public CompletionStage<?> onPong(WebSocket webSocket,
-                                             ByteBuffer message) {
-                return checkRunExclusively(
-                        () -> super.onPong(webSocket, message));
-            }
+                @Override
+                public CompletionStage<?> onPong(WebSocket webSocket,
+                                                 ByteBuffer message) {
+                    return checkRunExclusively(
+                            () -> super.onPong(webSocket, message));
+                }
 
-            @Override
-            public CompletionStage<?> onClose(WebSocket webSocket,
-                                              int statusCode,
-                                              String reason) {
-                return checkRunExclusively(
-                        () -> super.onClose(webSocket, statusCode, reason));
-            }
+                @Override
+                public CompletionStage<?> onClose(WebSocket webSocket,
+                                                  int statusCode,
+                                                  String reason) {
+                    return checkRunExclusively(
+                            () -> super.onClose(webSocket, statusCode, reason));
+                }
 
-            @Override
-            public void onError(WebSocket webSocket, Throwable error) {
-                checkRunExclusively(() -> {
-                    super.onError(webSocket, error);
-                    return null;
-                });
-            }
-        };
+                @Override
+                public void onError(WebSocket webSocket, Throwable error) {
+                    checkRunExclusively(() -> {
+                        super.onError(webSocket, error);
+                        return null;
+                    });
+                }
+            };
 
-        webSocket = newBuilder().proxy(NO_PROXY).build().newWebSocketBuilder()
-                .buildAsync(server.getURI(), listener)
-                .join();
-
-
-        listener.invocations();
-        violation.complete(null); // won't affect if completed exceptionally
-        violation.join();
-
-        server.close();
+            var webSocket = newBuilder().proxy(NO_PROXY).build().newWebSocketBuilder()
+                    .buildAsync(server.getURI(), listener)
+                    .join();
+            try {
+                listener.invocations();
+                violation.complete(null); // won't affect if completed exceptionally
+                violation.join();
+            } finally {
+                webSocket.abort();
+            }
+        }
     }
 
     @Test
     public void sendMethodsThrowIOE2() throws Exception {
-        server = Support.serverWithCannedData(0x88, 0x00);
-        server.open();
-        CompletableFuture<Void> onCloseCalled = new CompletableFuture<>();
-        CompletableFuture<Void> canClose = new CompletableFuture<>();
+        try (var server = Support.serverWithCannedData(0x88, 0x00)) {
+            server.open();
+
+            CompletableFuture<Void> onCloseCalled = new CompletableFuture<>();
+            CompletableFuture<Void> canClose = new CompletableFuture<>();
 
-        WebSocket.Listener listener = new WebSocket.Listener() {
-            @Override
-            public CompletionStage<?> onClose(WebSocket webSocket,
-                                              int statusCode,
-                                              String reason) {
-                System.out.printf("onClose(%s, '%s')%n", statusCode, reason);
-                onCloseCalled.complete(null);
-                return canClose;
-            }
+            WebSocket.Listener listener = new WebSocket.Listener() {
+                @Override
+                public CompletionStage<?> onClose(WebSocket webSocket,
+                                                  int statusCode,
+                                                  String reason) {
+                    System.out.printf("onClose(%s, '%s')%n", statusCode, reason);
+                    onCloseCalled.complete(null);
+                    return canClose;
+                }
 
-            @Override
-            public void onError(WebSocket webSocket, Throwable error) {
-                System.out.println("onError(" + error + ")");
-                onCloseCalled.completeExceptionally(error);
-            }
-        };
-
-        webSocket = newBuilder().proxy(NO_PROXY).build().newWebSocketBuilder()
-                .buildAsync(server.getURI(), listener)
-                .join();
+                @Override
+                public void onError(WebSocket webSocket, Throwable error) {
+                    System.out.println("onError(" + error + ")");
+                    onCloseCalled.completeExceptionally(error);
+                }
+            };
 
-        onCloseCalled.join();      // Wait for onClose to be called
-        canClose.complete(null);   // Signal to the WebSocket it can close the output
-        TimeUnit.SECONDS.sleep(5); // Give canClose some time to reach the WebSocket
+            var webSocket = newBuilder().proxy(NO_PROXY).build().newWebSocketBuilder()
+                    .buildAsync(server.getURI(), listener)
+                    .join();
+            try {
+                onCloseCalled.join();      // Wait for onClose to be called
+                canClose.complete(null);   // Signal to the WebSocket it can close the output
+                TimeUnit.SECONDS.sleep(5); // Give canClose some time to reach the WebSocket
 
-        assertFails(IOE, webSocket.sendClose(WebSocket.NORMAL_CLOSURE, "ok"));
+                assertFails(IOE, webSocket.sendClose(WebSocket.NORMAL_CLOSURE, "ok"));
 
-        assertFails(IOE, webSocket.sendText("", true));
-        assertFails(IOE, webSocket.sendText("", false));
-        assertFails(IOE, webSocket.sendText("abc", true));
-        assertFails(IOE, webSocket.sendText("abc", false));
-        assertFails(IOE, webSocket.sendBinary(ByteBuffer.allocate(0), true));
-        assertFails(IOE, webSocket.sendBinary(ByteBuffer.allocate(0), false));
-        assertFails(IOE, webSocket.sendBinary(ByteBuffer.allocate(1), true));
-        assertFails(IOE, webSocket.sendBinary(ByteBuffer.allocate(1), false));
+                assertFails(IOE, webSocket.sendText("", true));
+                assertFails(IOE, webSocket.sendText("", false));
+                assertFails(IOE, webSocket.sendText("abc", true));
+                assertFails(IOE, webSocket.sendText("abc", false));
+                assertFails(IOE, webSocket.sendBinary(ByteBuffer.allocate(0), true));
+                assertFails(IOE, webSocket.sendBinary(ByteBuffer.allocate(0), false));
+                assertFails(IOE, webSocket.sendBinary(ByteBuffer.allocate(1), true));
+                assertFails(IOE, webSocket.sendBinary(ByteBuffer.allocate(1), false));
 
-        assertFails(IOE, webSocket.sendPing(ByteBuffer.allocate(125)));
-        assertFails(IOE, webSocket.sendPing(ByteBuffer.allocate(124)));
-        assertFails(IOE, webSocket.sendPing(ByteBuffer.allocate(1)));
-        assertFails(IOE, webSocket.sendPing(ByteBuffer.allocate(0)));
+                assertFails(IOE, webSocket.sendPing(ByteBuffer.allocate(125)));
+                assertFails(IOE, webSocket.sendPing(ByteBuffer.allocate(124)));
+                assertFails(IOE, webSocket.sendPing(ByteBuffer.allocate(1)));
+                assertFails(IOE, webSocket.sendPing(ByteBuffer.allocate(0)));
 
-        assertFails(IOE, webSocket.sendPong(ByteBuffer.allocate(125)));
-        assertFails(IOE, webSocket.sendPong(ByteBuffer.allocate(124)));
-        assertFails(IOE, webSocket.sendPong(ByteBuffer.allocate(1)));
-        assertFails(IOE, webSocket.sendPong(ByteBuffer.allocate(0)));
-
-        server.close();
+                assertFails(IOE, webSocket.sendPong(ByteBuffer.allocate(125)));
+                assertFails(IOE, webSocket.sendPong(ByteBuffer.allocate(124)));
+                assertFails(IOE, webSocket.sendPong(ByteBuffer.allocate(1)));
+                assertFails(IOE, webSocket.sendPong(ByteBuffer.allocate(0)));
+            } finally {
+                webSocket.abort();
+            }
+        }
     }
 
     // Used to verify a server requiring Authentication
@@ -458,74 +460,76 @@
         };
         CompletableFuture<List<byte[]>> actual = new CompletableFuture<>();
 
-        server = serverSupplier.apply(binary);
-        server.open();
-
-        WebSocket.Listener listener = new WebSocket.Listener() {
+        try (var server = serverSupplier.apply(binary)) {
+            server.open();
 
-            List<byte[]> collectedBytes = new ArrayList<>();
-            ByteBuffer buffer = ByteBuffer.allocate(1024);
+            WebSocket.Listener listener = new WebSocket.Listener() {
 
-            @Override
-            public CompletionStage<?> onBinary(WebSocket webSocket,
-                                               ByteBuffer message,
-                                               boolean last) {
-                System.out.printf("onBinary(%s, %s)%n", message, last);
-                webSocket.request(1);
+                List<byte[]> collectedBytes = new ArrayList<>();
+                ByteBuffer buffer = ByteBuffer.allocate(1024);
 
-                append(message);
-                if (last) {
-                    buffer.flip();
-                    byte[] bytes = new byte[buffer.remaining()];
-                    buffer.get(bytes);
-                    buffer.clear();
-                    processWholeBinary(bytes);
-                }
-                return null;
-            }
+                @Override
+                public CompletionStage<?> onBinary(WebSocket webSocket,
+                                                   ByteBuffer message,
+                                                   boolean last) {
+                    System.out.printf("onBinary(%s, %s)%n", message, last);
+                    webSocket.request(1);
 
-            private void append(ByteBuffer message) {
-                if (buffer.remaining() < message.remaining()) {
-                    assert message.remaining() > 0;
-                    int cap = (buffer.capacity() + message.remaining()) * 2;
-                    ByteBuffer b = ByteBuffer.allocate(cap);
-                    b.put(buffer.flip());
-                    buffer = b;
+                    append(message);
+                    if (last) {
+                        buffer.flip();
+                        byte[] bytes = new byte[buffer.remaining()];
+                        buffer.get(bytes);
+                        buffer.clear();
+                        processWholeBinary(bytes);
+                    }
+                    return null;
                 }
-                buffer.put(message);
-            }
 
-            private void processWholeBinary(byte[] bytes) {
-                String stringBytes = new String(bytes, UTF_8);
-                System.out.println("processWholeBinary: " + stringBytes);
-                collectedBytes.add(bytes);
-            }
+                private void append(ByteBuffer message) {
+                    if (buffer.remaining() < message.remaining()) {
+                        assert message.remaining() > 0;
+                        int cap = (buffer.capacity() + message.remaining()) * 2;
+                        ByteBuffer b = ByteBuffer.allocate(cap);
+                        b.put(buffer.flip());
+                        buffer = b;
+                    }
+                    buffer.put(message);
+                }
 
-            @Override
-            public CompletionStage<?> onClose(WebSocket webSocket,
-                                              int statusCode,
-                                              String reason) {
-                actual.complete(collectedBytes);
-                return null;
-            }
+                private void processWholeBinary(byte[] bytes) {
+                    String stringBytes = new String(bytes, UTF_8);
+                    System.out.println("processWholeBinary: " + stringBytes);
+                    collectedBytes.add(bytes);
+                }
 
-            @Override
-            public void onError(WebSocket webSocket, Throwable error) {
-                actual.completeExceptionally(error);
-            }
-        };
+                @Override
+                public CompletionStage<?> onClose(WebSocket webSocket,
+                                                  int statusCode,
+                                                  String reason) {
+                    actual.complete(collectedBytes);
+                    return null;
+                }
+
+                @Override
+                public void onError(WebSocket webSocket, Throwable error) {
+                    actual.completeExceptionally(error);
+                }
+            };
 
-        webSocket = newBuilder()
-                .proxy(NO_PROXY)
-                .authenticator(new WSAuthenticator())
-                .build().newWebSocketBuilder()
-                .buildAsync(server.getURI(), listener)
-                .join();
-
-        List<byte[]> a = actual.join();
-        assertEquals(a, expected);
-
-        server.close();
+            var webSocket = newBuilder()
+                    .proxy(NO_PROXY)
+                    .authenticator(new WSAuthenticator())
+                    .build().newWebSocketBuilder()
+                    .buildAsync(server.getURI(), listener)
+                    .join();
+            try {
+                List<byte[]> a = actual.join();
+                assertEquals(a, expected);
+            } finally {
+                webSocket.abort();
+            }
+        }
     }
 
     @Test(dataProvider = "servers")
@@ -554,59 +558,61 @@
         };
         CompletableFuture<List<String>> actual = new CompletableFuture<>();
 
-        server = serverSupplier.apply(binary);
-        server.open();
+        try (var server = serverSupplier.apply(binary)) {
+            server.open();
+
+            WebSocket.Listener listener = new WebSocket.Listener() {
+
+                List<String> collectedStrings = new ArrayList<>();
+                StringBuilder text = new StringBuilder();
 
-        WebSocket.Listener listener = new WebSocket.Listener() {
-
-            List<String> collectedStrings = new ArrayList<>();
-            StringBuilder text = new StringBuilder();
+                @Override
+                public CompletionStage<?> onText(WebSocket webSocket,
+                                                 CharSequence message,
+                                                 boolean last) {
+                    System.out.printf("onText(%s, %s)%n", message, last);
+                    webSocket.request(1);
+                    text.append(message);
+                    if (last) {
+                        String str = text.toString();
+                        text.setLength(0);
+                        processWholeText(str);
+                    }
+                    return null;
+                }
 
-            @Override
-            public CompletionStage<?> onText(WebSocket webSocket,
-                                             CharSequence message,
-                                             boolean last) {
-                System.out.printf("onText(%s, %s)%n", message, last);
-                webSocket.request(1);
-                text.append(message);
-                if (last) {
-                    String str = text.toString();
-                    text.setLength(0);
-                    processWholeText(str);
+                private void processWholeText(String string) {
+                    System.out.println(string);
+                    collectedStrings.add(string);
+                }
+
+                @Override
+                public CompletionStage<?> onClose(WebSocket webSocket,
+                                                  int statusCode,
+                                                  String reason) {
+                    actual.complete(collectedStrings);
+                    return null;
                 }
-                return null;
-            }
+
+                @Override
+                public void onError(WebSocket webSocket, Throwable error) {
+                    actual.completeExceptionally(error);
+                }
+            };
 
-            private void processWholeText(String string) {
-                System.out.println(string);
-                collectedStrings.add(string);
+            var webSocket = newBuilder()
+                    .proxy(NO_PROXY)
+                    .authenticator(new WSAuthenticator())
+                    .build().newWebSocketBuilder()
+                    .buildAsync(server.getURI(), listener)
+                    .join();
+            try {
+                List<String> a = actual.join();
+                assertEquals(a, expected);
+            } finally {
+                webSocket.abort();
             }
-
-            @Override
-            public CompletionStage<?> onClose(WebSocket webSocket,
-                                              int statusCode,
-                                              String reason) {
-                actual.complete(collectedStrings);
-                return null;
-            }
-
-            @Override
-            public void onError(WebSocket webSocket, Throwable error) {
-                actual.completeExceptionally(error);
-            }
-        };
-
-        webSocket = newBuilder()
-                .proxy(NO_PROXY)
-                .authenticator(new WSAuthenticator())
-                .build().newWebSocketBuilder()
-                .buildAsync(server.getURI(), listener)
-                .join();
-
-        List<String> a = actual.join();
-        assertEquals(a, expected);
-
-        server.close();
+        }
     }
 
     /*
@@ -639,73 +645,75 @@
         };
         CompletableFuture<List<String>> actual = new CompletableFuture<>();
 
-        server = serverSupplier.apply(binary);
-        server.open();
+        try (var server = serverSupplier.apply(binary)) {
+            server.open();
 
-        WebSocket.Listener listener = new WebSocket.Listener() {
+            WebSocket.Listener listener = new WebSocket.Listener() {
 
-            List<CharSequence> parts = new ArrayList<>();
-            /*
-             * A CompletableFuture which will complete once the current
-             * message has been fully assembled. Until then the listener
-             * returns this instance for every call.
-             */
-            CompletableFuture<?> currentCf = new CompletableFuture<>();
-            List<String> collected = new ArrayList<>();
+                List<CharSequence> parts = new ArrayList<>();
+                /*
+                 * A CompletableFuture which will complete once the current
+                 * message has been fully assembled. Until then the listener
+                 * returns this instance for every call.
+                 */
+                CompletableFuture<?> currentCf = new CompletableFuture<>();
+                List<String> collected = new ArrayList<>();
 
-            @Override
-            public CompletionStage<?> onText(WebSocket webSocket,
-                                             CharSequence message,
-                                             boolean last) {
-                parts.add(message);
-                if (!last) {
-                    webSocket.request(1);
-                } else {
-                    this.currentCf.thenRun(() -> webSocket.request(1));
-                    CompletableFuture<?> refCf = this.currentCf;
-                    processWholeMessage(new ArrayList<>(parts), refCf);
-                    currentCf = new CompletableFuture<>();
-                    parts.clear();
-                    return refCf;
+                @Override
+                public CompletionStage<?> onText(WebSocket webSocket,
+                                                 CharSequence message,
+                                                 boolean last) {
+                    parts.add(message);
+                    if (!last) {
+                        webSocket.request(1);
+                    } else {
+                        this.currentCf.thenRun(() -> webSocket.request(1));
+                        CompletableFuture<?> refCf = this.currentCf;
+                        processWholeMessage(new ArrayList<>(parts), refCf);
+                        currentCf = new CompletableFuture<>();
+                        parts.clear();
+                        return refCf;
+                    }
+                    return currentCf;
                 }
-                return currentCf;
-            }
 
-            @Override
-            public CompletionStage<?> onClose(WebSocket webSocket,
-                                              int statusCode,
-                                              String reason) {
-                actual.complete(collected);
-                return null;
-            }
+                @Override
+                public CompletionStage<?> onClose(WebSocket webSocket,
+                                                  int statusCode,
+                                                  String reason) {
+                    actual.complete(collected);
+                    return null;
+                }
 
-            @Override
-            public void onError(WebSocket webSocket, Throwable error) {
-                actual.completeExceptionally(error);
-            }
+                @Override
+                public void onError(WebSocket webSocket, Throwable error) {
+                    actual.completeExceptionally(error);
+                }
 
-            public void processWholeMessage(List<CharSequence> data,
-                                            CompletableFuture<?> cf) {
-                StringBuilder b = new StringBuilder();
-                data.forEach(b::append);
-                String s = b.toString();
-                System.out.println(s);
-                cf.complete(null);
-                collected.add(s);
-            }
-        };
+                public void processWholeMessage(List<CharSequence> data,
+                                                CompletableFuture<?> cf) {
+                    StringBuilder b = new StringBuilder();
+                    data.forEach(b::append);
+                    String s = b.toString();
+                    System.out.println(s);
+                    cf.complete(null);
+                    collected.add(s);
+                }
+            };
 
-        webSocket = newBuilder()
-                .proxy(NO_PROXY)
-                .authenticator(new WSAuthenticator())
-                .build().newWebSocketBuilder()
-                .buildAsync(server.getURI(), listener)
-                .join();
-
-        List<String> a = actual.join();
-        assertEquals(a, expected);
-
-        server.close();
+            var webSocket = newBuilder()
+                    .proxy(NO_PROXY)
+                    .authenticator(new WSAuthenticator())
+                    .build().newWebSocketBuilder()
+                    .buildAsync(server.getURI(), listener)
+                    .join();
+            try {
+                List<String> a = actual.join();
+                assertEquals(a, expected);
+            } finally {
+                webSocket.abort();
+            }
+        }
     }
 
     // -- authentication specific tests
@@ -725,6 +733,7 @@
                     .newWebSocketBuilder()
                     .buildAsync(server.getURI(), new WebSocket.Listener() { })
                     .join();
+            webSocket.abort();
         }
     }
 
@@ -745,6 +754,7 @@
                     .header("Authorization", hv)
                     .buildAsync(server.getURI(), new WebSocket.Listener() { })
                     .join();
+            webSocket.abort();
         }
     }
 
@@ -763,6 +773,7 @@
 
             try {
                 var webSocket = cf.join();
+                silentAbort(webSocket);
                 fail("Expected exception not thrown");
             } catch (CompletionException expected) {
                 WebSocketHandshakeException e = (WebSocketHandshakeException)expected.getCause();
@@ -783,7 +794,7 @@
 
             Authenticator authenticator = new Authenticator() {
                 @Override protected PasswordAuthentication getPasswordAuthentication() {
-                    return new PasswordAuthentication("BAD"+USERNAME, "".toCharArray());
+                    return new PasswordAuthentication("BAD" + USERNAME, "".toCharArray());
                 }
             };
 
@@ -796,10 +807,16 @@
 
             try {
                 var webSocket = cf.join();
+                silentAbort(webSocket);
                 fail("Expected exception not thrown");
             } catch (CompletionException expected) {
                 System.out.println("caught expected exception:" + expected);
             }
         }
     }
+    private static void silentAbort(WebSocket ws) {
+        try {
+            ws.abort();
+        } catch (Throwable t) { }
+    }
 }
--- a/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/InheritedChannelTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/InheritedChannelTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -25,7 +25,7 @@
  * @test
  * @bug 4673940 4930794 8211842
  * @summary Unit tests for inetd feature
- * @requires (os.family == "linux" | os.family == "solaris")
+ * @requires (os.family == "linux" | os.family == "solaris" | os.family == "mac")
  * @library /test/lib
  * @build jdk.test.lib.Utils
  *        jdk.test.lib.Asserts
@@ -33,7 +33,8 @@
  *        jdk.test.lib.JDKToolLauncher
  *        jdk.test.lib.Platform
  *        jdk.test.lib.process.*
- *        UnixSocketTest StateTest StateTestService EchoTest EchoService CloseTest Launcher Util
+ *        UnixSocketTest StateTest StateTestService EchoTest EchoService
+ *        UnixDomainChannelTest CloseTest Launcher Util
  * @run testng/othervm/native InheritedChannelTest
  * @key intermittent
  */
@@ -73,7 +74,8 @@
 
     @DataProvider
     public Object[][] testCases() {
-        return new Object[][]{
+        return new Object[][] {
+            { "UnixDomainChannelTest", List.of(UnixDomainChannelTest.class.getName())},
             { "UnixSocketTest", List.of(UnixSocketTest.class.getName())},
             { "StateTest", List.of(StateTest.class.getName()) },
             { "EchoTest",  List.of(EchoTest.class.getName())  },
@@ -83,6 +85,7 @@
             // Note that the system properties are arguments to StateTest and not options.
             // These system properties are passed to the launched service as options:
             // java [-options] class [args...]
+
             { "StateTest run with " + POLICY_PASS, List.of(StateTest.class.getName(),
                                                            "-Djava.security.manager",
                                                            "-Djava.security.policy="
@@ -97,7 +100,7 @@
         };
     }
 
-    @Test(dataProvider = "testCases")
+    @Test(dataProvider = "testCases", timeOut=30000)
     public void test(String desc, List<String> opts) throws Throwable {
         String pathVar = Platform.sharedLibraryPathVariableName();
         System.out.println(pathVar + "=" + libraryPath);
--- a/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/Launcher.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/Launcher.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -75,6 +75,15 @@
         return socks[1];
     }
 
+    /**
+     * Launch specified class with an AF_UNIX socket created externally, and one String arg to child VM
+     */
+    public static void launchWithUnixDomainSocket(String className, UnixDomainSocket socket, String arg) throws IOException {
+        String[] args = new String[1];
+        args[0] = arg;
+        launch(className, null, args, socket.fd());
+    }
+
     /*
      * Launch 'java' with specified class with the specified arguments (may be null).
      * The launched process will inherit a connected TCP socket. The remote endpoint
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/UnixDomainChannelTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,117 @@
+/*
+ * 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.
+ */
+
+import java.nio.channels.*;
+import java.nio.ByteBuffer;
+import java.io.IOException;
+import static java.nio.charset.StandardCharsets.ISO_8859_1;
+
+/*
+ * Make sure that System.inheritedChannel returns null when given a UNIX domain socket
+ */
+
+public class UnixDomainChannelTest {
+
+    public static class Child {
+        public static void main(String[] args) throws Exception {
+            // we just want to make sure that System.inheritedChannel either
+            // returns a connected channel, or null if it is given a listener
+            Channel channel = System.inheritedChannel();
+            String result = channel == null ? "N" : "Y";
+            if (args[0].equals("test1") || args[0].equals("test2")) {
+                // socket is writeable
+                ByteChannel bc = (ByteChannel)channel;
+                ByteBuffer buf = ByteBuffer.wrap(result.getBytes(ISO_8859_1));
+                bc.write(buf);
+            } else { // test3
+                // in this case the socket is a listener
+                // we can't write to it. So, use UnixDatagramSocket
+                // to accept a writeable socket
+                UnixDomainSocket listener = new UnixDomainSocket(0); // fd 0
+                UnixDomainSocket sock = listener.accept();
+                sock.write((int)result.charAt(0));
+            }
+        }
+    }
+
+    static boolean passed = true;
+
+    public static void main(String args[]) throws Exception {
+        test1();
+        test2();
+        test3();
+        if (!passed)
+            throw new RuntimeException();
+    }
+
+    private static void closeAll(UnixDomainSocket... sockets) {
+        for (UnixDomainSocket sock : sockets) {
+            sock.close();
+        }
+    }
+
+    // Test with a named connected socket
+    private static void test1() throws Exception {
+        UnixDomainSocket listener = new UnixDomainSocket();
+        listener.bind("foo.socket");
+        UnixDomainSocket sock1 = new UnixDomainSocket();
+        sock1.connect("foo.socket");
+        UnixDomainSocket sock2 = listener.accept();
+
+        Launcher.launchWithUnixDomainSocket("UnixDomainChannelTest$Child", sock2, "test1");
+        int c = sock1.read();
+        if (c != 'Y') {
+            System.err.printf("test1: failed %d d\n", c );
+            passed = false;
+        }
+        closeAll(listener, sock1, sock2);
+    }
+
+    // Test with unnamed socketpair
+    private static void test2() throws Exception {
+        UnixDomainSocket[] pair = UnixDomainSocket.socketpair();
+        System.out.println("test2: launching child");
+        Launcher.launchWithUnixDomainSocket("UnixDomainChannelTest$Child", pair[0], "test2");
+        if (pair[1].read() != 'Y') {
+            System.err.println("test2: failed");
+            passed = false;
+        }
+        closeAll(pair[0], pair[1]);
+    }
+
+    // Test with a named listener
+    private static void test3() throws Exception {
+        UnixDomainSocket listener = new UnixDomainSocket();
+        listener.bind("foo.socket");
+        UnixDomainSocket sock1 = new UnixDomainSocket();
+        System.out.println("test3: launching child");
+        Launcher.launchWithUnixDomainSocket("UnixDomainChannelTest$Child", listener, "test3");
+        sock1.connect("foo.socket");
+        if (sock1.read() != 'N') {
+            System.err.println("test3: failed");
+            passed = false;
+        }
+        closeAll(listener, sock1);
+    }
+
+}
--- a/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/UnixDomainSocket.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/UnixDomainSocket.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -37,21 +37,44 @@
     }
 
     private final int fd;
+    private volatile String name;
+
+    public UnixDomainSocket() throws IOException {
+        this.fd = create();
+    }
+
+    public void bind(String name) throws IOException {
+        bind0(fd, name);
+        this.name = name;
+    }
+
+    public UnixDomainSocket accept() throws IOException {
+        int newsock = accept0(fd);
+        return new UnixDomainSocket(newsock);
+    }
 
     public UnixDomainSocket(int fd) {
         this.fd = fd;
     }
 
+    public void connect(String dest) throws IOException {
+        connect0(fd, dest);
+    }
+
     public int read() throws IOException {
         return read0(fd);
     }
 
+    public String name() {
+        return name;
+    }
+
     public void write(int w) throws IOException {
         write0(fd, w);
     }
 
     public void close() {
-        close0(fd);
+        close0(fd, name); // close0 will unlink name if non-null
     }
 
     public int fd() {
@@ -62,11 +85,16 @@
         return "UnixDomainSocket: fd=" + Integer.toString(fd);
     }
 
+    private static native int create() throws IOException;
+    private static native void bind0(int fd, String name) throws IOException;
+    private static native int accept0(int fd) throws IOException;
+    private static native int connect0(int fd, String name) throws IOException;
+
     /* read and write bytes with UNIX domain sockets */
 
     private static native int read0(int fd) throws IOException;
     private static native void write0(int fd, int w) throws IOException;
-    private static native void close0(int fd);
+    private static native void close0(int fd, String name);
     private static native void init();
     public static native UnixDomainSocket[] socketpair();
 }
--- a/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/libInheritedChannel.c	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/libInheritedChannel.c	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -26,8 +26,10 @@
  */
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <sys/un.h>
 #include <unistd.h>
 #include <dirent.h>
 #include <sys/stat.h>
@@ -147,19 +149,18 @@
 
     /*
      * We need to close all file descriptors except for serviceFd. To
-     * get the list of open file descriptos we read through /proc/self/fd
+     * get the list of open file descriptos we read through /proc/self/fd (/dev/fd)
      * but to open this requires a file descriptor. We could use a specific
      * file descriptor and fdopendir but Linux doesn't seem to support
      * fdopendir. Instead we use opendir and make an assumption on the
      * file descriptor that is used (by opening & closing a file).
      */
-    thisFd = open("/dev/null", O_RDONLY);
+    thisFd = open("/dev/fd", O_RDONLY);
     if (thisFd < 0) {
         _exit(-1);
     }
-    close(thisFd);
 
-    if ((dp = opendir("/proc/self/fd")) == NULL) {
+    if ((dp = fdopendir(thisFd)) == NULL) {
         _exit(-1);
     }
 
@@ -216,6 +217,65 @@
     return result;
 }
 
+JNIEXPORT jint JNICALL Java_UnixDomainSocket_create
+  (JNIEnv *env, jclass cls)
+{
+    int sock = socket(AF_UNIX, SOCK_STREAM, 0);
+    if (sock == -1) {
+        ThrowException(env, "java/io/IOException", "socket create error");
+    }
+    return sock;
+}
+
+JNIEXPORT void JNICALL Java_UnixDomainSocket_bind0
+  (JNIEnv *env, jclass cls, jint sock, jstring name)
+{
+    struct sockaddr_un addr;
+    const char *nameUtf = (*env)->GetStringUTFChars(env, name, NULL);
+    int ret = -1;
+    unlink(nameUtf);
+    memset(&addr, 0, sizeof(addr));
+    addr.sun_family = AF_UNIX;
+    strncpy(addr.sun_path, nameUtf, strlen(nameUtf));
+    ret = bind(sock, (const struct sockaddr*)&addr, sizeof(addr));
+    if (ret == -1) {
+        ThrowException(env, "java/io/IOException", "socket bind error");
+    }
+    ret = listen(sock, 5);
+    if (ret == -1) {
+        ThrowException(env, "java/io/IOException", "socket bind error");
+    }
+    (*env)->ReleaseStringUTFChars(env, name, nameUtf);
+}
+
+JNIEXPORT jint JNICALL Java_UnixDomainSocket_accept0
+  (JNIEnv *env, jclass cls, jint sock)
+{
+    struct sockaddr_storage addr;
+    socklen_t len = sizeof(addr);
+    int ret = accept(sock, (struct sockaddr *)&addr, &len);
+    if (ret == -1)
+        ThrowException(env, "java/io/IOException", "socket accept error");
+    return ret;
+}
+
+JNIEXPORT void JNICALL Java_UnixDomainSocket_connect0
+  (JNIEnv *env, jclass cls, jint fd, jstring name)
+{
+    struct sockaddr_un addr;
+    const char *nameUtf = (*env)->GetStringUTFChars(env, name, NULL);
+    int ret = -1;
+    memset(&addr, 0, sizeof(addr));
+    addr.sun_family = AF_UNIX;
+    strncpy(addr.sun_path, nameUtf, strlen(nameUtf));
+    ret = connect(fd, (const struct sockaddr*)&addr, sizeof(addr));
+    if (ret == -1) {
+        ThrowException(env, "java/io/IOException", "socket connect error");
+    }
+    (*env)->ReleaseStringUTFChars(env, name, nameUtf);
+}
+
+
 JNIEXPORT jint JNICALL Java_UnixDomainSocket_read0
   (JNIEnv *env, jclass cls, jint fd)
 {
@@ -243,7 +303,12 @@
 }
 
 JNIEXPORT void JNICALL Java_UnixDomainSocket_close0
-  (JNIEnv *env, jclass cls, jint fd)
+  (JNIEnv *env, jclass cls, jint fd, jstring name)
 {
     close(fd);
+    if (name != NULL) {
+        const char *nameUtf = (*env)->GetStringUTFChars(env, name, NULL);
+        unlink(nameUtf);
+        (*env)->ReleaseStringUTFChars(env, name, nameUtf);
+    }
 }
--- a/test/jdk/java/nio/file/attribute/BasicFileAttributeView/SetTimesNanos.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/jdk/java/nio/file/attribute/BasicFileAttributeView/SetTimesNanos.java	Wed Sep 25 22:40:41 2019 +0200
@@ -22,9 +22,9 @@
  */
 
 /* @test
- * @bug 8181493
+ * @bug 8181493 8231174
  * @summary Verify that nanosecond precision is maintained for file timestamps
- * @requires (os.family == "linux") | (os.family == "mac") | (os.family == "solaris")
+ * @requires (os.family == "linux") | (os.family == "mac") | (os.family == "solaris") | (os.family == "windows")
  * @modules java.base/sun.nio.fs:+open
  */
 
@@ -40,14 +40,21 @@
 import java.util.concurrent.TimeUnit;
 
 public class SetTimesNanos {
+    private static final boolean IS_WINDOWS =
+        System.getProperty("os.name").startsWith("Windows");
+
     public static void main(String[] args) throws Exception {
-        // Check whether futimens() system call is supported
-        Class unixNativeDispatcherClass = Class.forName("sun.nio.fs.UnixNativeDispatcher");
-        Method futimensSupported = unixNativeDispatcherClass.getDeclaredMethod("futimensSupported");
-        futimensSupported.setAccessible(true);
-        if (!(boolean)futimensSupported.invoke(null)) {
-            System.err.println("futimens() system call not supported; skipping test");
-            return;
+        if (!IS_WINDOWS) {
+            // Check whether futimens() system call is supported
+            Class unixNativeDispatcherClass =
+                Class.forName("sun.nio.fs.UnixNativeDispatcher");
+            Method futimensSupported =
+                unixNativeDispatcherClass.getDeclaredMethod("futimensSupported");
+            futimensSupported.setAccessible(true);
+            if (!(boolean)futimensSupported.invoke(null)) {
+                System.err.println("futimens() not supported; skipping test");
+                return;
+            }
         }
 
         Path dirPath = Path.of("test");
@@ -56,7 +63,8 @@
         System.out.format("FileStore: \"%s\" on %s (%s)%n",
             dir, store.name(), store.type());
 
-        Set<String> testedTypes = Set.of("apfs", "ext4", "xfs", "zfs");
+        Set<String> testedTypes = IS_WINDOWS ?
+            Set.of("NTFS") : Set.of("apfs", "ext4", "xfs", "zfs");
         if (!testedTypes.contains(store.type())) {
             System.err.format("%s not in %s; skipping test", store.type(), testedTypes);
             return;
@@ -77,6 +85,11 @@
             Files.getFileAttributeView(path, BasicFileAttributeView.class);
         view.setTimes(pathTime, pathTime, null);
 
+        // Windows file time resolution is 100ns so truncate
+        if (IS_WINDOWS) {
+            timeNanos = 100L*(timeNanos/100L);
+        }
+
         // Read attributes
         BasicFileAttributes attrs =
             Files.readAttributes(path, BasicFileAttributes.class);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/nio/file/etc/MacVolumesTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,203 @@
+/*
+ * 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 8231254
+ * @requires os.family == "mac"
+ * @summary Check access and basic NIO APIs on APFS for macOS version >= 10.15
+ */
+import java.io.BufferedReader;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.IOException;
+import java.io.Reader;
+import java.nio.ByteBuffer;
+import java.nio.channels.SeekableByteChannel;
+import java.nio.file.DirectoryStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.StandardOpenOption;
+import java.nio.file.attribute.FileTime;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.Random;
+
+public class MacVolumesTest {
+    private static final String SYSTEM_VOLUME = "/";
+    private static final String DATA_VOLUME = "/System/Volumes/Data";
+    private static final String FIRMLINKS = "/usr/share/firmlinks";
+
+    private static final void checkSystemVolume() throws IOException {
+        System.out.format("--- Checking system volume %s ---%n", SYSTEM_VOLUME);
+        Path root = Path.of(SYSTEM_VOLUME);
+        if (!Files.getFileStore(root).isReadOnly()) {
+            throw new RuntimeException("Root volume is not read-only");
+        }
+
+        Path tempDir;
+        try {
+            tempDir = Files.createTempDirectory(root, "tempDir");
+            throw new RuntimeException("Created temporary directory in root");
+        } catch (IOException ignore) {
+        }
+
+        Path tempFile;
+        try {
+            tempFile = Files.createTempFile(root, "tempFile", null);
+            throw new RuntimeException("Created temporary file in root");
+        } catch (IOException ignore) {
+        }
+
+        Path path = null;
+        Path etc = Path.of(SYSTEM_VOLUME, "etc");
+        if (Files.isWritable(etc)) {
+            throw new RuntimeException("System path " + etc + " is writable");
+        }
+        try (DirectoryStream<Path> ds = Files.newDirectoryStream(etc)) {
+            Iterator<Path> paths = ds.iterator();
+            while (paths.hasNext()) {
+                Path p = paths.next();
+                if (Files.isReadable(p) && Files.isRegularFile(p)) {
+                    path = p;
+                    break;
+                }
+            }
+        }
+        if (path == null) {
+            System.err.println("No root test file found: skipping file test");
+            return;
+        }
+        System.out.format("Using root test file %s%n", path);
+
+        if (Files.isWritable(path)) {
+            throw new RuntimeException("Test file " + path + " is writable");
+        }
+
+        FileTime creationTime =
+            (FileTime)Files.getAttribute(path, "basic:creationTime");
+        System.out.format("%s creation time: %s%n", path, creationTime);
+
+        long size = Files.size(path);
+        int capacity = (int)Math.min(1024, size);
+        ByteBuffer buf = ByteBuffer.allocate(capacity);
+        try (SeekableByteChannel sbc = Files.newByteChannel(path)) {
+            int n = sbc.read(buf);
+            System.out.format("Read %d bytes from %s%n", n, path);
+        }
+    }
+
+    private static final void checkDataVolume() throws IOException {
+        System.out.format("--- Checking data volume %s ---%n", DATA_VOLUME);
+        Path data = Path.of(DATA_VOLUME, "tmp");
+        if (Files.getFileStore(data).isReadOnly()) {
+            throw new RuntimeException("Data volume is read-only");
+        }
+
+        Path tempDir = Files.createTempDirectory(data, "tempDir");
+        tempDir.toFile().deleteOnExit();
+        System.out.format("Temporary directory: %s%n", tempDir);
+        if (!Files.isWritable(tempDir)) {
+            throw new RuntimeException("Temporary directory is not writable");
+        }
+
+        Path tempFile = Files.createTempFile(tempDir, "tempFile", null);
+        tempFile.toFile().deleteOnExit();
+        System.out.format("Temporary file: %s%n", tempFile);
+        if (!Files.isWritable(tempFile)) {
+            throw new RuntimeException("Temporary file is not writable");
+        }
+
+        byte[] bytes = new byte[42];
+        new Random().nextBytes(bytes);
+        try (SeekableByteChannel sbc = Files.newByteChannel(tempFile,
+            StandardOpenOption.WRITE)) {
+            ByteBuffer src = ByteBuffer.wrap(bytes);
+            if (sbc.write(src) != bytes.length) {
+                throw new RuntimeException("Incorrect number of bytes written");
+            }
+        }
+
+        try (SeekableByteChannel sbc = Files.newByteChannel(tempFile)) {
+            ByteBuffer dst = ByteBuffer.allocate(bytes.length);
+            if (sbc.read(dst) != bytes.length) {
+                throw new RuntimeException("Incorrect number of bytes read");
+            }
+            if (!Arrays.equals(dst.array(), bytes)) {
+                throw new RuntimeException("Bytes read != bytes written");
+            }
+        }
+    }
+
+    static void checkFirmlinks() throws IOException {
+        System.out.format("--- Checking firmlinks %s ---%n", FIRMLINKS);
+        Path firmlinks = Path.of(FIRMLINKS);
+        if (!Files.exists(firmlinks)) {
+            System.err.format("%s does not exist: skipping firmlinks test%n",
+                firmlinks);
+            return;
+        } else if (!Files.isReadable(firmlinks)) {
+            throw new RuntimeException(String.format("%s is not readable",
+                firmlinks));
+        }
+
+        try (BufferedReader br = Files.newBufferedReader(firmlinks)) {
+            String line;
+            while ((line = br.readLine()) != null) {
+                String file = line.split("\\s")[0];
+                Path path = Path.of(file);
+                if (!Files.exists(path)) {
+                    System.err.format("Firmlink %s does not exist: skipping%n",
+                        file);
+                    continue;
+                }
+                if (Files.getFileStore(path).isReadOnly()) {
+                    String msg = String.format("%s is read-only%n", file);
+                    throw new RuntimeException(msg);
+                } else {
+                    System.out.format("Firmlink %s OK%n", file);
+                }
+            }
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        String[] osv = System.getProperty("os.version").split("\\.");
+        int major = Integer.valueOf(osv[0]);
+        int minor = Integer.valueOf(osv[1]);
+        if (major < 10 || (major == 10 && minor < 15)) {
+            System.out.format("macOS version %d.%d too old: skipping test%n",
+                major, minor);
+            return;
+        }
+
+        // Check system volume for read-only.
+        checkSystemVolume();
+
+        // Check data volume for read-write.
+        checkDataVolume();
+
+        // Check firmlinks for read-write.
+        checkFirmlinks();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/security/Provider/GetServiceRace.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,98 @@
+/*
+ * 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 8231387
+ * @library ../testlibrary
+ * @summary make sure getService() avoids a race
+ * @author Tianmin Shi
+ */
+
+import java.security.Provider;
+
+public class GetServiceRace {
+
+    private static final Provider testProvider;
+    static {
+        testProvider = new Provider("MyProvider", 1.0, "test") {
+        };
+        testProvider.put("CertificateFactory.Fixed", "MyCertificateFactory");
+    }
+
+    private static final int NUMBER_OF_RETRIEVERS = 3;
+    private static final int TEST_TIME_MS = 1000;
+
+    public static boolean testFailed = false;
+
+    public static void main(String[] args) throws Exception {
+        Updater updater = new Updater();
+        updater.start();
+        Retriever [] retrievers = new Retriever[NUMBER_OF_RETRIEVERS];
+        for (int i=0; i<retrievers.length; i++) {
+            retrievers[i] = new Retriever();
+            retrievers[i].start();
+        }
+        Thread.sleep(TEST_TIME_MS);
+        System.out.println("Interrupt");
+        updater.interrupt();
+        updater.join();
+        for (int i=0; i<retrievers.length; i++) {
+            retrievers[i].interrupt();
+            retrievers[i].join();
+        }
+        System.out.println("Done");
+        if (testFailed) {
+            throw new Exception("Test Failed");
+        }
+        System.out.println("Test Passed");
+    }
+
+    private static class Updater extends Thread {
+        @Override
+        public void run() {
+            while (!isInterrupted()) {
+                testProvider.put("CertificateFactory.Added", "MyCertificateFactory");
+            }
+            System.out.println("Updater stopped");
+        }
+    }
+
+    private static class Retriever extends Thread {
+        @Override
+        public void run() {
+            while (!isInterrupted()) {
+                Provider.Service service = testProvider.getService("CertificateFactory", "Fixed");
+                if (service == null) {
+                    if (!testFailed) {
+                        System.err.println("CertificateFactory.Fixed is NULL");
+                        testFailed = true;
+                    }
+                } else {
+                    //System.out.println("CertificateFactory.Fixed is good");
+                }
+            }
+            System.out.println("Retriever stopped");
+        }
+    }
+}
--- a/test/jdk/javax/swing/JInternalFrame/8145896/TestJInternalFrameMaximize.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/jdk/javax/swing/JInternalFrame/8145896/TestJInternalFrameMaximize.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 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
@@ -24,12 +24,13 @@
 /*
  * @test
  * @key headful
- * @bug 8145896
+ * @bug 8145896 8194944
  * @summary JInternalFrame setMaximum before adding to desktop throws null pointer exception
  * @library ../../regtesthelpers
  * @build Util
  * @run main TestJInternalFrameMaximize
  */
+
 import java.awt.Point;
 import java.awt.Robot;
 import java.awt.event.ActionEvent;
@@ -55,18 +56,27 @@
     private static JMenuItem menuItem;
     private static Robot robot;
     private static volatile String errorMessage = "";
+    private static volatile boolean isFrameShowing;
 
     public static void main(String[] args) throws Exception {
         robot = new Robot();
+        robot.setAutoDelay(100);
         UIManager.LookAndFeelInfo[] lookAndFeelArray
                 = UIManager.getInstalledLookAndFeels();
         for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) {
-            String lookAndFeelString = lookAndFeelItem.getClassName();
-            if (tryLookAndFeel(lookAndFeelString)) {
-                createUI();
+            try {
+                String lookAndFeelString = lookAndFeelItem.getClassName();
+                if (tryLookAndFeel(lookAndFeelString)) {
+                    createUI();
+                    robot.waitForIdle();
+                    blockTillDisplayed(frame);
+                    executeTest();
+                    robot.delay(1000);
+                }
+            } finally {
+                frame.dispose();
+                isFrameShowing = false;
                 robot.waitForIdle();
-                executeTest();
-                robot.delay(1000);
             }
         }
         if (!"".equals(errorMessage)) {
@@ -113,8 +123,6 @@
                 } catch (PropertyVetoException ex) {
                 } catch (RuntimeException ex) {
                     errorMessage = "Test Failed";
-                } finally {
-                    frame.dispose();
                 }
             });
             menu.add(menuItem);
@@ -124,8 +132,21 @@
         });
     }
 
+    private static void blockTillDisplayed(JFrame frame) throws Exception {
+        while (!isFrameShowing) {
+            try {
+                SwingUtilities.invokeAndWait(()-> isFrameShowing = frame.isShowing());
+                if (!isFrameShowing) {
+                    Thread.sleep(1000);
+                }
+            } catch (InterruptedException ex) {
+            } catch (Exception ex) {
+                throw new RuntimeException(ex);
+            }
+        }
+    }
+
     private static void executeTest() throws Exception {
-
         Point point = Util.getCenterPoint(menu);
         performMouseOperations(point);
         point = Util.getCenterPoint(menuItem);
--- a/test/jdk/javax/swing/plaf/metal/MetalIcons/MetalHiDPIIconsTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/jdk/javax/swing/plaf/metal/MetalIcons/MetalHiDPIIconsTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 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
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8160986 8174845 8176883
+ * @bug 8160986 8174845 8176883 8165828
  * @summary Bad rendering of Swing UI controls with Metal L&F on HiDPI display
  * @run main/manual MetalHiDPIIconsTest
  */
@@ -50,7 +50,7 @@
             + "Verify that icons are painted smoothly for standard Swing UI controls.\n\n"
             + "If the display does not support HiDPI mode press PASS.\n\n"
             + "1. Run the SwingSet2 demo on HiDPI Display.\n"
-            + "2. Select Metal Look and Feel\n"
+            + "2. Select Java Look and Feel. It is equivalent to Metal Look And Feel\n"
             + "3. Check that the icons are painted smoothly on Swing UI controls like:\n"
             + "  - JRadioButton\n"
             + "  - JCheckBox\n"
--- a/test/jdk/jdk/jfr/event/gc/collection/TestG1ParallelPhases.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/jdk/jdk/jfr/event/gc/collection/TestG1ParallelPhases.java	Wed Sep 25 22:40:41 2019 +0200
@@ -98,8 +98,7 @@
             "CLDGRoots",
             "JVMTIRoots",
             "CMRefRoots",
-            "WaitForStrongCLD",
-            "WeakCLDRoots",
+            "WaitForStrongRoots",
             "MergeER",
             "MergeHCC",
             "MergeRS",
--- a/test/jdk/jdk/jfr/jcmd/TestJcmdConfigure.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/jdk/jdk/jfr/jcmd/TestJcmdConfigure.java	Wed Sep 25 22:40:41 2019 +0200
@@ -25,6 +25,7 @@
 
 package jdk.jfr.jcmd;
 
+import java.io.File;
 import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.util.ArrayList;
@@ -56,8 +57,8 @@
     private static final String SAMPLE_THREADS = "samplethreads";
     private static final String UNSUPPORTED_OPTION = "unsupportedoption";
 
-    private static final String REPOSITORYPATH_1 = "./repo1";
-    private static final String REPOSITORYPATH_2 = "./repo2";
+    private static final String REPOSITORYPATH_1 = "." + File.pathSeparator + "repo1";
+    private static final String REPOSITORYPATH_2 = "." + File.pathSeparator + "repo2";
 
     private static final String REPOSITORYPATH_SETTING_1 = "repositorypath="+REPOSITORYPATH_1;
     private static final String REPOSITORYPATH_SETTING_2 = "repositorypath="+REPOSITORYPATH_2;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sun/java2d/marlin/FlipBitTest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -0,0 +1,104 @@
+/*
+ * 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.
+ */
+
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.RenderingHints;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Ellipse2D;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import javax.imageio.ImageIO;
+
+
+/**
+ * Tests calculating user space line with a negative determinant (flip).
+ *
+ * @test
+ * @summary verify that flipped transformed lines are properly rasterized
+ * @bug 8230728
+ */
+public class FlipBitTest {
+
+    static final boolean SAVE_IMAGE = false;
+
+    public static void main(final String[] args) {
+
+        final int size = 100;
+
+        // First display which renderer is tested:
+        // JDK9 only:
+        System.setProperty("sun.java2d.renderer.verbose", "true");
+
+        System.out.println("FlipBitTest: size = " + size);
+
+        final BufferedImage image = new BufferedImage(size, size, BufferedImage.TYPE_INT_ARGB);
+
+        final Graphics2D g2d = (Graphics2D) image.getGraphics();
+        try {
+            g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+            g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
+            g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);
+
+            final AffineTransform at = new AffineTransform();
+            at.setToScale(1, -1.01);
+            g2d.setTransform(at);
+
+            g2d.translate(0, -image.getHeight());
+            g2d.setPaint(Color.WHITE);
+            g2d.fill(new Rectangle(image.getWidth(), image.getHeight()));
+
+            g2d.setPaint(Color.BLACK);
+            g2d.setStroke(new BasicStroke(0.1f));
+            g2d.draw(new Ellipse2D.Double(25, 25, 50, 50));
+
+            if (SAVE_IMAGE) {
+                try {
+                    final File file = new File("FlipBitTest.png");
+
+                    System.out.println("Writing file: " + file.getAbsolutePath());
+                    ImageIO.write(image, "PNG", file);
+                } catch (IOException ex) {
+                    ex.printStackTrace();
+                }
+            }
+
+            boolean nonWhitePixelFound = false;
+            for (int x = 0; x < image.getWidth(); ++x) {
+                if (image.getRGB(x, 50) != Color.WHITE.getRGB()) {
+                    nonWhitePixelFound = true;
+                    break;
+                }
+            }
+            if (!nonWhitePixelFound) {
+                throw new IllegalStateException("The ellipse was not drawn");
+            }
+        } finally {
+            g2d.dispose();
+        }
+    }
+}
--- a/test/jdk/sun/java2d/pipe/hw/RSLAPITest/RSLAPITest.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/jdk/sun/java2d/pipe/hw/RSLAPITest/RSLAPITest.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -44,7 +44,6 @@
 import java.util.HashSet;
 import sun.java2d.DestSurfaceProvider;
 import sun.java2d.Surface;
-import sun.java2d.pipe.BufferedContext;
 import sun.java2d.pipe.RenderQueue;
 import sun.java2d.pipe.hw.AccelGraphicsConfig;
 import sun.java2d.pipe.hw.AccelSurface;
@@ -161,8 +160,6 @@
         AccelGraphicsConfig agc = (AccelGraphicsConfig) gc;
         printAGC(agc);
 
-        testContext(agc);
-
         VolatileImage vi = gc.createCompatibleVolatileImage(10, 10);
         vi.validate(gc);
         if (vi instanceof DestSurfaceProvider) {
@@ -250,22 +247,6 @@
         }
     }
 
-    private static void testContext(final AccelGraphicsConfig agc) {
-        BufferedContext c = agc.getContext();
-
-        RenderQueue rq = c.getRenderQueue();
-        rq.lock();
-        try {
-            c.saveState();
-            rq.flushNow();
-            c.restoreState();
-            rq.flushNow();
-            System.out.println("Passed: Save/Restore");
-        } finally {
-            rq.unlock();
-        }
-    }
-
     private static void testForNPEDuringCreation(AccelGraphicsConfig agc) {
         int iterations = 100;
         HashSet<VolatileImage> vis = new HashSet<VolatileImage>();
--- a/test/jdk/sun/java2d/pipe/hw/RSLContextInvalidationTest/RSLContextInvalidationTest.java	Mon Sep 23 09:16:05 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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
- * @key headful
- * @bug 6764257 8198613
- * @summary Tests that the color is reset properly after save/restore context
- * @author Dmitri.Trembovetski@sun.com: area=Graphics
- * @modules java.desktop/sun.java2d
- *          java.desktop/sun.java2d.pipe
- *          java.desktop/sun.java2d.pipe.hw
- * @compile -XDignore.symbol.file=true RSLContextInvalidationTest.java
- * @run main/othervm RSLContextInvalidationTest
- * @run main/othervm -Dsun.java2d.noddraw=true RSLContextInvalidationTest
- */
-
-import java.awt.Color;
-import java.awt.Graphics;
-import java.awt.GraphicsConfiguration;
-import java.awt.GraphicsDevice;
-import java.awt.GraphicsEnvironment;
-import java.awt.image.BufferedImage;
-import java.awt.image.VolatileImage;
-import sun.java2d.DestSurfaceProvider;
-import sun.java2d.Surface;
-import sun.java2d.pipe.RenderQueue;
-import sun.java2d.pipe.hw.*;
-
-public class RSLContextInvalidationTest {
-
-    public static void main(String[] args) {
-        GraphicsEnvironment ge =
-            GraphicsEnvironment.getLocalGraphicsEnvironment();
-        GraphicsDevice gd = ge.getDefaultScreenDevice();
-        GraphicsConfiguration gc = gd.getDefaultConfiguration();
-        VolatileImage vi = gc.createCompatibleVolatileImage(100, 100);
-        vi.validate(gc);
-        VolatileImage vi1 = gc.createCompatibleVolatileImage(100, 100);
-        vi1.validate(gc);
-
-        if (!(vi instanceof DestSurfaceProvider)) {
-            System.out.println("Test considered PASSED: no HW acceleration");
-            return;
-        }
-
-        DestSurfaceProvider p = (DestSurfaceProvider)vi;
-        Surface s = p.getDestSurface();
-        if (!(s instanceof AccelSurface)) {
-            System.out.println("Test considered PASSED: no HW acceleration");
-            return;
-        }
-        AccelSurface dst = (AccelSurface)s;
-
-        Graphics g = vi.createGraphics();
-        g.drawImage(vi1, 95, 95, null);
-        g.setColor(Color.red);
-        g.fillRect(0, 0, 100, 100);
-        g.setColor(Color.black);
-        g.fillRect(0, 0, 100, 100);
-        // after this the validated context color is black
-
-        RenderQueue rq = dst.getContext().getRenderQueue();
-        rq.lock();
-        try {
-            dst.getContext().saveState();
-            dst.getContext().restoreState();
-        } finally {
-            rq.unlock();
-        }
-
-        // this will cause ResetPaint (it will set color to extended EA=ff,
-        // which is ffffffff==Color.white)
-        g.drawImage(vi1, 95, 95, null);
-
-        // now try filling with black again, but it will come up as white
-        // because this fill rect won't validate the color properly
-        g.setColor(Color.black);
-        g.fillRect(0, 0, 100, 100);
-
-        BufferedImage bi = vi.getSnapshot();
-        if (bi.getRGB(50, 50) != Color.black.getRGB()) {
-            throw new RuntimeException("Test FAILED: found color="+
-                Integer.toHexString(bi.getRGB(50, 50))+" instead of "+
-                Integer.toHexString(Color.black.getRGB()));
-        }
-
-        System.out.println("Test PASSED.");
-    }
-}
--- a/test/jdk/sun/tools/jcmd/TestProcessHelper.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/jdk/sun/tools/jcmd/TestProcessHelper.java	Wed Sep 25 22:40:41 2019 +0200
@@ -21,16 +21,13 @@
  * questions.
  */
 
-import jdk.internal.module.ModuleInfoWriter;
-import jdk.test.lib.JDKToolFinder;
-import jdk.test.lib.process.ProcessTools;
-import jdk.test.lib.util.JarUtils;
-import sun.tools.common.ProcessHelper;
-
 import java.io.File;
 import java.io.IOException;
 import java.io.OutputStream;
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
 import java.lang.module.ModuleDescriptor;
+import java.lang.reflect.Method;
 import java.nio.file.FileSystems;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -44,6 +41,11 @@
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
+import jdk.internal.module.ModuleInfoWriter;
+import jdk.test.lib.JDKToolFinder;
+import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.util.JarUtils;
+
 /*
  * @test
  * @bug 8205654
@@ -52,15 +54,13 @@
  *
  * @requires os.family == "linux"
  * @library /test/lib
- * @modules jdk.jcmd/sun.tools.common
+ * @modules jdk.jcmd/sun.tools.common:+open
  *          java.base/jdk.internal.module
  * @build test.TestProcess
  * @run main/othervm TestProcessHelper
  */
 public class TestProcessHelper {
 
-    private ProcessHelper PROCESS_HELPER = ProcessHelper.platformProcessHelper();
-
     private static final String TEST_PROCESS_MAIN_CLASS_NAME = "TestProcess";
     private static final String TEST_PROCESS_MAIN_CLASS_PACKAGE = "test";
     private static final String TEST_PROCESS_MAIN_CLASS = TEST_PROCESS_MAIN_CLASS_PACKAGE + "."
@@ -89,6 +89,29 @@
 
     private static final String[] PATCH_MODULE_OPTIONS = {"--patch-module", null};
 
+    private static final MethodHandle MH_GET_MAIN_CLASS = resolveMainClassMH();
+
+    private static MethodHandle resolveMainClassMH() {
+        try {
+            Method getMainClassMethod = Class
+                .forName("sun.tools.common.ProcessHelper")
+                .getDeclaredMethod("getMainClass", String.class);
+            getMainClassMethod.setAccessible(true);
+            return MethodHandles.lookup().unreflect(getMainClassMethod);
+        } catch (ClassNotFoundException | NoSuchMethodException | SecurityException | IllegalAccessException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    private static String callGetMainClass(Process p) {
+        try {
+            return (String)MH_GET_MAIN_CLASS.invoke(Long.toString(p.pid()));
+        } catch (Throwable e) {
+            throw new RuntimeException(e);
+        }
+
+    }
+
     public static void main(String[] args) throws Exception {
         new TestProcessHelper().runTests();
     }
@@ -188,7 +211,7 @@
     }
 
     private void checkMainClass(Process p, String expectedMainClass) {
-        String mainClass = PROCESS_HELPER.getMainClass(Long.toString(p.pid()));
+        String mainClass = callGetMainClass(p);
         // getMainClass() may return null, e.g. due to timing issues.
         // Attempt some limited retries.
         if (mainClass == null) {
@@ -204,7 +227,7 @@
                 } catch (InterruptedException e) {
                     // ignore
                 }
-                mainClass = PROCESS_HELPER.getMainClass(Long.toString(p.pid()));
+                mainClass = callGetMainClass(p);
                 retrycount++;
                 sleepms *= 2;
             }
--- a/test/jdk/tools/launcher/TestSpecialArgs.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/jdk/tools/launcher/TestSpecialArgs.java	Wed Sep 25 22:40:41 2019 +0200
@@ -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
@@ -132,11 +132,9 @@
          *       Code to create env variable not executed.
          * 4) give and invalid value and check to make sure JVM commented
          */
-        String launcherPidString = "launcher.pid=";
         String envVarPidString = "TRACER_MARKER: NativeMemoryTracking: env var is NMT_LEVEL_";
         String NMT_Option_Value = "off";
         String myClassName = "helloworld";
-        boolean haveLauncherPid = false;
 
         // === Run the tests ===
         // ---Test 1a
@@ -163,46 +161,6 @@
             throw new RuntimeException("Error: env Var Pid in tracking info is empty string");
         }
 
-        /*
-         * On Linux, Launcher Tracking will print the PID.  Use this info
-         * to validate what we got as the PID in the Launcher itself.
-         * Linux is the only one that prints this, and trying to get it
-         * here for win is awful.  So let the linux test make sure we get
-         * the valid pid, and for non-linux, just make sure pid string is
-         * non-zero.
-         */
-        if (isLinux) {
-            // get what the test says is the launcher pid
-            String launcherPid = null;
-            for (String line : tr.testOutput) {
-                int index = line.indexOf(launcherPidString);
-                if (index >= 0) {
-                    int sindex = index + launcherPidString.length();
-                    int tindex = sindex + line.substring(sindex).indexOf("'");
-                    System.out.println("DEBUG INFO: sindex = " + sindex);
-                    System.out.println("DEBUG INFO: searching substring: " + line.substring(sindex));
-                    System.out.println("DEBUG INFO: tindex = " + tindex);
-                    // DEBUG INFO
-                    System.out.println(tr);
-                    launcherPid = line.substring(sindex, tindex);
-                    break;
-                }
-            }
-            if (launcherPid == null) {
-                System.out.println(tr);
-                throw new RuntimeException("Error: failed to find launcher Pid in launcher tracking info");
-            }
-
-            // did we create the env var with the correct pid?
-            if (!launcherPid.equals(envVarPid)) {
-                System.out.println(tr);
-                System.out.println("Error: wrong pid in creating env var");
-                System.out.println("Error Info: launcherPid = " + launcherPid);
-                System.out.println("Error Info: envVarPid   = " + envVarPid);
-                throw new RuntimeException("Error: wrong pid in creating env var");
-            }
-        }
-
         // --- Test 1b
         if (!tr.contains("NativeMemoryTracking: got value " + NMT_Option_Value)) {
             System.out.println(tr);
--- a/test/langtools/jdk/javadoc/doclet/testSearchScript/TestSearchScript.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/langtools/jdk/javadoc/doclet/testSearchScript/TestSearchScript.java	Wed Sep 25 22:40:41 2019 +0200
@@ -149,11 +149,12 @@
         checkSearch(inv, "operty", List.of());
 
         // search tag
-        checkSearch(inv, "search tag", List.of("search tag"));
-        checkSearch(inv, "search   tag", List.of("search tag"));
-        checkSearch(inv, "search ", List.of("search tag"));
-        checkSearch(inv, "tag", List.of("search tag"));
-        checkSearch(inv, "sea", List.of("search tag"));
+        checkSearch(inv, "search tag", List.of("multiline search tag", "search tag"));
+        checkSearch(inv, "search   tag", List.of("multiline search tag", "search tag"));
+        checkSearch(inv, "search ", List.of("multiline search tag", "search tag"));
+        checkSearch(inv, "tag", List.of("multiline search tag", "search tag"));
+        checkSearch(inv, "sea", List.of("multiline search tag", "search tag"));
+        checkSearch(inv, "multi", List.of("multiline search tag"));
         checkSearch(inv, "ear", List.of());
     }
 
@@ -244,7 +245,7 @@
                 List.of("listpkg.List.of(E, E, E, E)", "listpkg.List.of(E, E, E, E, E)"));
         checkSearch(inv, "l . o (e,e,e,",
                 List.of("listpkg.List.of(E, E, E, E)", "listpkg.List.of(E, E, E, E, E)"));
-        checkSearch(inv, "search    \tt", List.of("search tag"));
+        checkSearch(inv, "search    \tt", List.of("other search tag"));
         checkSearch(inv, "sear ch", List.of());
         checkSearch(inv, "( e ..", List.of("listpkg.List.of(E...)"));
         checkSearch(inv, "( i [ ]", List.of("listpkg.Nolist.withArrayArg(int[])"));
--- a/test/langtools/jdk/javadoc/doclet/testSearchScript/listpkg/Nolist.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/langtools/jdk/javadoc/doclet/testSearchScript/listpkg/Nolist.java	Wed Sep 25 22:40:41 2019 +0200
@@ -27,9 +27,8 @@
 import java.util.Map;
 
 /**
- * Example class containing "list" but not matching at any word boundary.
- *
- * {@index "search tag"}.
+ * Example class containing "list" but not matching at any word boundary. {@index "other
+ * search tag"}.
  */
 public class Nolist {
 
--- a/test/langtools/jdk/javadoc/doclet/testSearchScript/mapmodule/mappkg/Map.java	Mon Sep 23 09:16:05 2019 -0700
+++ b/test/langtools/jdk/javadoc/doclet/testSearchScript/mapmodule/mappkg/Map.java	Wed Sep 25 22:40:41 2019 +0200
@@ -25,6 +25,13 @@
 
 import java.util.Iterator;
 
+/**
+ * Map interface.
+ *
+ * {@index "multiline
+ *          search
+ *          tag"}
+ */
 public interface Map {
     public void put(Object key, Object value);
     public boolean contains(Object key);