changeset 51903:f91e995f6d5c

Merge
author prr
date Fri, 03 Aug 2018 12:52:58 -0700
parents 36bc2044b15c 13e2e64337be
children 5ade5b3a227e
files test/hotspot/gtest/utilities/utilitiesHelper.inline.hpp test/hotspot/jtreg/applications/jcstress/acqrel/Test.java test/hotspot/jtreg/applications/jcstress/atomicity/Test.java test/hotspot/jtreg/applications/jcstress/copy/Test.java test/hotspot/jtreg/applications/jcstress/fences/Test.java test/hotspot/jtreg/applications/jcstress/memeffects/Test.java test/hotspot/jtreg/applications/jcstress/other/Test.java test/hotspot/jtreg/applications/jcstress/seqcst.sync/Test.java test/hotspot/jtreg/applications/jcstress/seqcst.volatiles/Test.java test/langtools/tools/javac/file/zip/8003512/LoadClassFromJava6CreatedJarTest.java test/langtools/tools/javac/processing/environment/round/AnnotatedElementInfo.java
diffstat 1115 files changed, 11942 insertions(+), 75447 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Wed Aug 01 11:02:19 2018 +0530
+++ b/.hgtags	Fri Aug 03 12:52:58 2018 -0700
@@ -497,5 +497,9 @@
 00b16d0457e43d23f6ca5ade6b243edce62750a0 jdk-12+1
 9937ef7499dcd7673714517fd5e450410c14ba4e jdk-11+22
 1edcf36fe15f79d6228d1a63eb680878e2386480 jdk-11+23
+ea900a7dc7d77dee30865c60eabd87fc24b1037c jdk-11+24
+331888ea4a788df801b1edf8836646cd25fc758b jdk-11+25
 69b438908512d3dfef5852c6a843a5778333a309 jdk-12+2
 990db216e7199b2ba9989d8fa20b657e0ca7d969 jdk-12+3
+499b873761d8e8a1cc4aa649daf04cbe98cbce77 jdk-12+4
+f8696e0ab9b795030429fc3374ec03e378fd9ed7 jdk-12+5
--- a/bin/idea.sh	Wed Aug 01 11:02:19 2018 +0530
+++ b/bin/idea.sh	Fri Aug 03 12:52:58 2018 -0700
@@ -68,9 +68,12 @@
 cd $IDEA_OUTPUT; IDEA_OUTPUT=`pwd`
 
 MAKE_DIR="$SCRIPT_DIR/../make"
+SUPPORT_DIR="$SCRIPT_DIR/../build/.idea-support"
 IDEA_MAKE="$MAKE_DIR/idea"
 IDEA_TEMPLATE="$IDEA_MAKE/template"
 
+mkdir -p $SUPPORT_DIR
+
 cp -r "$IDEA_TEMPLATE"/* "$IDEA_OUTPUT"
 
 #init template variables
@@ -124,6 +127,11 @@
   echo "FATAL: SPEC is empty" >&2; exit 1
 fi
 
+# move build.xml out of .idea, see IDEA-189915
+IDEA_BUILD_OLD=$IDEA_BUILD
+IDEA_BUILD=$SUPPORT_DIR/build.xml
+mv $IDEA_BUILD_OLD $IDEA_BUILD
+
 SOURCE_FOLDER="      <sourceFolder url=\"file://\$MODULE_DIR\$/####\" isTestSource=\"false\" />"
 SOURCE_FOLDERS_DONE="false"
 
--- a/doc/building.html	Wed Aug 01 11:02:19 2018 +0530
+++ b/doc/building.html	Fri Aug 03 12:52:58 2018 -0700
@@ -1,16 +1,11 @@
 <!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
+<html>
 <head>
-  <meta charset="utf-8" />
-  <meta name="generator" content="pandoc" />
-  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
+  <meta charset="utf-8">
+  <meta name="generator" content="pandoc">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
   <title>Building the JDK</title>
-  <style type="text/css">
-      code{white-space: pre-wrap;}
-      span.smallcaps{font-variant: small-caps;}
-      span.underline{text-decoration: underline;}
-      div.column{display: inline-block; vertical-align: top; width: 50%;}
-  </style>
+  <style type="text/css">code{white-space: pre;}</style>
   <link rel="stylesheet" href="../make/data/docs-resources/resources/jdk-default.css">
   <!--[if lt IE 9]>
     <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
@@ -134,8 +129,8 @@
 <p>The JDK is a complex software project. Building it requires a certain amount of technical expertise, a fair number of dependencies on external software, and reasonably powerful hardware.</p>
 <p>If you just want to use the JDK and not build it yourself, this document is not for you. See for instance <a href="http://openjdk.java.net/install">OpenJDK installation</a> for some methods of installing a prebuilt JDK.</p>
 <h2 id="getting-the-source-code">Getting the Source Code</h2>
-<p>Make sure you are getting the correct version. As of JDK 10, the source is no longer split into separate repositories so you only need to clone one single repository. At the <a href="http://hg.openjdk.java.net/">OpenJDK Mercurial server</a> you can see a list of all available forests. If you want to build an older version, e.g. JDK 8, it is recommended that you get the <code>jdk8u</code> forest, which contains incremental updates, instead of the <code>jdk8</code> forest, which was frozen at JDK 8 GA.</p>
-<p>If you are new to Mercurial, a good place to start is the <a href="http://www.mercurial-scm.org/guide">Mercurial Beginner’s Guide</a>. The rest of this document assumes a working knowledge of Mercurial.</p>
+<p>Make sure you are getting the correct version. As of JDK 10, the source is no longer split into separate repositories so you only need to clone one single repository. At the <a href="http://hg.openjdk.java.net/">OpenJDK Mercurial server</a> you can see a list of all available forests. If you want to build an older version, e.g. JDK 8, it is recommended that you get the <code>jdk8u</code> forest, which contains incremental updates, instead of the <code>jdk8</code> forest, which was frozen at JDK 8 GA.</p>
+<p>If you are new to Mercurial, a good place to start is the <a href="http://www.mercurial-scm.org/guide">Mercurial Beginner's Guide</a>. The rest of this document assumes a working knowledge of Mercurial.</p>
 <h3 id="special-considerations">Special Considerations</h3>
 <p>For a smooth building experience, it is recommended that you follow these rules on where and how to check out the source code.</p>
 <ul>
@@ -144,7 +139,7 @@
 <li><p>Put the source code on a local disk, not a network share. If possible, use an SSD. The build process is very disk intensive, and having slow disk access will significantly increase build times. If you need to use a network share for the source code, see below for suggestions on how to keep the build artifacts on a local disk.</p></li>
 <li><p>On Windows, extra care must be taken to make sure the <a href="#cygwin">Cygwin</a> environment is consistent. It is recommended that you follow this procedure:</p>
 <ul>
-<li><p>Create the directory that is going to contain the top directory of the JDK clone by using the <code>mkdir</code> command in the Cygwin bash shell. That is, do <em>not</em> create it using Windows Explorer. This will ensure that it will have proper Cygwin attributes, and that it’s children will inherit those attributes.</p></li>
+<li><p>Create the directory that is going to contain the top directory of the JDK clone by using the <code>mkdir</code> command in the Cygwin bash shell. That is, do <em>not</em> create it using Windows Explorer. This will ensure that it will have proper Cygwin attributes, and that it's children will inherit those attributes.</p></li>
 <li><p>Do not put the JDK clone in a path under your Cygwin home directory. This is especially important if your user name contains spaces and/or mixed upper and lower case letters.</p></li>
 <li><p>Clone the JDK repository using the Cygwin command line <code>hg</code> client as instructed in this document. That is, do <em>not</em> use another Mercurial client such as TortoiseHg.</p></li>
 </ul>
@@ -161,7 +156,7 @@
 <h3 id="building-on-armaarch64">Building on arm/aarch64</h3>
 <p>This is not recommended. Instead, see the section on <a href="#cross-compiling">Cross-compiling</a>.</p>
 <h2 id="operating-system-requirements">Operating System Requirements</h2>
-<p>The mainline JDK project supports Linux, Solaris, macOS, AIX and Windows. Support for other operating system, e.g. BSD, exists in separate “port” projects.</p>
+<p>The mainline JDK project supports Linux, Solaris, macOS, AIX and Windows. Support for other operating system, e.g. BSD, exists in separate &quot;port&quot; projects.</p>
 <p>In general, the JDK can be built on a wide range of versions of these operating systems, but the further you deviate from what is tested on a daily basis, the more likely you are to run into problems.</p>
 <p>This table lists the OS versions used by Oracle when building the JDK. Such information is always subject to change, but this table is up to date at the time of writing.</p>
 <table>
@@ -196,7 +191,7 @@
 <p>Windows XP is not a supported platform, but all newer Windows should be able to build the JDK.</p>
 <p>On Windows, it is important that you pay attention to the instructions in the <a href="#special-considerations">Special Considerations</a>.</p>
 <p>Windows is the only non-POSIX OS supported by the JDK, and as such, requires some extra care. A POSIX support layer is required to build on Windows. Currently, the only supported such layer is Cygwin. (Msys is no longer supported due to a too old bash; msys2 and the new Windows Subsystem for Linux (WSL) would likely be possible to support in a future version but that would require effort to implement.)</p>
-<p>Internally in the build system, all paths are represented as Unix-style paths, e.g. <code>/cygdrive/c/hg/jdk9/Makefile</code> rather than <code>C:\hg\jdk9\Makefile</code>. This rule also applies to input to the build system, e.g. in arguments to <code>configure</code>. So, use <code>--with-msvcr-dll=/cygdrive/c/msvcr100.dll</code> rather than <code>--with-msvcr-dll=c:\msvcr100.dll</code>. For details on this conversion, see the section on <a href="#fixpath">Fixpath</a>.</p>
+<p>Internally in the build system, all paths are represented as Unix-style paths, e.g. <code>/cygdrive/c/hg/jdk9/Makefile</code> rather than <code>C:\hg\jdk9\Makefile</code>. This rule also applies to input to the build system, e.g. in arguments to <code>configure</code>. So, use <code>--with-msvcr-dll=/cygdrive/c/msvcr100.dll</code> rather than <code>--with-msvcr-dll=c:\msvcr100.dll</code>. For details on this conversion, see the section on <a href="#fixpath">Fixpath</a>.</p>
 <h4 id="cygwin">Cygwin</h4>
 <p>A functioning <a href="http://www.cygwin.com/">Cygwin</a> environment is thus required for building the JDK on Windows. If you have a 64-bit OS, we strongly recommend using the 64-bit version of Cygwin.</p>
 <p><strong>Note:</strong> Cygwin has a model of continuously updating all packages without any easy way to install or revert to a specific version of a package. This means that whenever you add or update a package in Cygwin, you might (inadvertently) update tools that are used by the JDK build process, and that can cause unexpected build problems.</p>
@@ -210,13 +205,13 @@
 </ul>
 <p>Often, you can install these packages using the following command line:</p>
 <pre><code>&lt;path to Cygwin setup&gt;/setup-x86_64 -q -P autoconf -P make -P unzip -P zip</code></pre>
-<p>Unfortunately, Cygwin can be unreliable in certain circumstances. If you experience build tool crashes or strange issues when building on Windows, please check the Cygwin FAQ on the <a href="https://cygwin.com/faq/faq.html#faq.using.bloda">“BLODA” list</a> and the section on <a href="https://cygwin.com/faq/faq.html#faq.using.fixing-fork-failures">fork() failures</a>.</p>
+<p>Unfortunately, Cygwin can be unreliable in certain circumstances. If you experience build tool crashes or strange issues when building on Windows, please check the Cygwin FAQ on the <a href="https://cygwin.com/faq/faq.html#faq.using.bloda">&quot;BLODA&quot; list</a> and the section on <a href="https://cygwin.com/faq/faq.html#faq.using.fixing-fork-failures">fork() failures</a>.</p>
 <h3 id="solaris">Solaris</h3>
 <p>See <code>make/devkit/solaris11.1-package-list.txt</code> for a list of recommended packages to install when building on Solaris. The versions specified in this list is the versions used by the daily builds at Oracle, and is likely to work properly.</p>
 <p>Older versions of Solaris shipped a broken version of <code>objcopy</code>. At least version 2.21.1 is needed, which is provided by Solaris 11 Update 1. Objcopy is needed if you want to have external debug symbols. Please make sure you are using at least version 2.21.1 of objcopy, or that you disable external debug symbols.</p>
 <h3 id="macos">macOS</h3>
 <p>Apple is using a quite aggressive scheme of pushing OS updates, and coupling these updates with required updates of Xcode. Unfortunately, this makes it difficult for a project such as the JDK to keep pace with a continuously updated machine running macOS. See the section on <a href="#apple-xcode">Apple Xcode</a> on some strategies to deal with this.</p>
-<p>It is recommended that you use at least Mac OS X 10.9 (Mavericks). At the time of writing, the JDK has been successfully compiled on macOS versions up to 10.12.5 (Sierra), using XCode 8.3.2 and <code>--disable-warnings-as-errors</code>.</p>
+<p>It is recommended that you use at least Mac OS X 10.13 (High Sierra). At the time of writing, the JDK has been successfully compiled on macOS 10.12 (Sierra).</p>
 <p>The standard macOS environment contains the basic tooling needed to build, but for external libraries a package manager is recommended. The JDK uses <a href="https://brew.sh/">homebrew</a> in the examples, but feel free to use whatever manager you want (or none).</p>
 <h3 id="linux">Linux</h3>
 <p>It is often not much problem to build the JDK on Linux. The only general advice is to try to use the compilers, external libraries and header files as provided by your distribution.</p>
@@ -228,7 +223,7 @@
 <h3 id="aix">AIX</h3>
 <p>The regular builds by SAP is using AIX version 7.1, but AIX 5.3 is also supported. See the <a href="http://cr.openjdk.java.net/~simonis/ppc-aix-port">OpenJDK PowerPC Port Status Page</a> for details.</p>
 <h2 id="native-compiler-toolchain-requirements">Native Compiler (Toolchain) Requirements</h2>
-<p>Large portions of the JDK consists of native code, that needs to be compiled to be able to run on the target platform. In theory, toolchain and operating system should be independent factors, but in practice there’s more or less a one-to-one correlation between target operating system and toolchain.</p>
+<p>Large portions of the JDK consists of native code, that needs to be compiled to be able to run on the target platform. In theory, toolchain and operating system should be independent factors, but in practice there's more or less a one-to-one correlation between target operating system and toolchain.</p>
 <table>
 <thead>
 <tr class="header">
@@ -274,7 +269,7 @@
 </tr>
 <tr class="even">
 <td style="text-align: left;">macOS</td>
-<td style="text-align: left;">Apple Xcode 6.3 (using clang 6.1.0)</td>
+<td style="text-align: left;">Apple Xcode 9.4 (using clang 9.1.0)</td>
 </tr>
 <tr class="odd">
 <td style="text-align: left;">Solaris</td>
@@ -282,7 +277,7 @@
 </tr>
 <tr class="even">
 <td style="text-align: left;">Windows</td>
-<td style="text-align: left;">Microsoft Visual Studio 2013 update 4</td>
+<td style="text-align: left;">Microsoft Visual Studio 2017 update 15.5.5</td>
 </tr>
 </tbody>
 </table>
@@ -294,10 +289,10 @@
 <p>The minimum accepted version of clang is 3.2. Older versions will not be accepted by <code>configure</code>.</p>
 <p>To use clang instead of gcc on Linux, use <code>--with-toolchain-type=clang</code>.</p>
 <h3 id="apple-xcode">Apple Xcode</h3>
-<p>The oldest supported version of Xcode is 5.</p>
+<p>The oldest supported version of Xcode is 8.</p>
 <p>You will need the Xcode command lines developers tools to be able to build the JDK. (Actually, <em>only</em> the command lines tools are needed, not the IDE.) The simplest way to install these is to run:</p>
 <pre><code>xcode-select --install</code></pre>
-<p>It is advisable to keep an older version of Xcode for building the JDK when updating Xcode. This <a href="http://iosdevelopertips.com/xcode/install-multiple-versions-of-xcode.html">blog page</a> has good suggestions on managing multiple Xcode versions. To use a specific version of Xcode, use <code>xcode-select -s</code> before running <code>configure</code>, or use <code>--with-toolchain-path</code> to point to the version of Xcode to use, e.g. <code>configure --with-toolchain-path=/Applications/Xcode5.app/Contents/Developer/usr/bin</code></p>
+<p>It is advisable to keep an older version of Xcode for building the JDK when updating Xcode. This <a href="http://iosdevelopertips.com/xcode/install-multiple-versions-of-xcode.html">blog page</a> has good suggestions on managing multiple Xcode versions. To use a specific version of Xcode, use <code>xcode-select -s</code> before running <code>configure</code>, or use <code>--with-toolchain-path</code> to point to the version of Xcode to use, e.g. <code>configure --with-toolchain-path=/Applications/Xcode8.app/Contents/Developer/usr/bin</code></p>
 <p>If you have recently (inadvertently) updated your OS and/or Xcode version, and the JDK can no longer be built, please see the section on <a href="#problems-with-the-build-environment">Problems with the Build Environment</a>, and <a href="#getting-help">Getting Help</a> to find out if there are any recent, non-merged patches available for this update.</p>
 <h3 id="oracle-solaris-studio">Oracle Solaris Studio</h3>
 <p>The minimum accepted version of the Solaris Studio compilers is 5.13 (corresponding to Solaris Studio 12.4). Older versions will not be accepted by configure.</p>
@@ -358,15 +353,15 @@
 $ CC -V
 CC: Sun C++ 5.13 SunOS_i386 151846-10 2015/10/30</code></pre>
 <h3 id="microsoft-visual-studio">Microsoft Visual Studio</h3>
-<p>The minimum accepted version of Visual Studio is 2010. Older versions will not be accepted by <code>configure</code>. The maximum accepted version of Visual Studio is 2013.</p>
-<p>If you have multiple versions of Visual Studio installed, <code>configure</code> will by default pick the latest. You can request a specific version to be used by setting <code>--with-toolchain-version</code>, e.g. <code>--with-toolchain-version=2010</code>.</p>
+<p>The minimum accepted version of Visual Studio is 2010. Older versions will not be accepted by <code>configure</code>. The maximum accepted version of Visual Studio is 2017. Versions older than 2017 are unlikely to continue working for long.</p>
+<p>If you have multiple versions of Visual Studio installed, <code>configure</code> will by default pick the latest. You can request a specific version to be used by setting <code>--with-toolchain-version</code>, e.g. <code>--with-toolchain-version=2015</code>.</p>
 <p>If you get <code>LINK: fatal error LNK1123: failure during conversion to COFF: file invalid</code> when building using Visual Studio 2010, you have encountered <a href="http://support.microsoft.com/kb/2757355">KB2757355</a>, a bug triggered by a specific installation order. However, the solution suggested by the KB article does not always resolve the problem. See <a href="https://stackoverflow.com/questions/10888391">this stackoverflow discussion</a> for other suggestions.</p>
 <h3 id="ibm-xl-cc">IBM XL C/C++</h3>
 <p>The regular builds by SAP is using version 12.1, described as <code>IBM XL C/C++ for AIX, V12.1 (5765-J02, 5725-C72) Version: 12.01.0000.0017</code>.</p>
 <p>See the <a href="http://cr.openjdk.java.net/~simonis/ppc-aix-port">OpenJDK PowerPC Port Status Page</a> for details.</p>
 <h2 id="boot-jdk-requirements">Boot JDK Requirements</h2>
-<p>Paradoxically, building the JDK requires a pre-existing JDK. This is called the “boot JDK”. The boot JDK does not, however, have to be a JDK built directly from the source code available in the OpenJDK Community. If you are porting the JDK to a new platform, chances are that there already exists another JDK for that platform that is usable as boot JDK.</p>
-<p>The rule of thumb is that the boot JDK for building JDK major version <em>N</em> should be a JDK of major version <em>N-1</em>, so for building JDK 9 a JDK 8 would be suitable as boot JDK. However, the JDK should be able to “build itself”, so an up-to-date build of the current JDK source is an acceptable alternative. If you are following the <em>N-1</em> rule, make sure you’ve got the latest update version, since JDK 8 GA might not be able to build JDK 9 on all platforms.</p>
+<p>Paradoxically, building the JDK requires a pre-existing JDK. This is called the &quot;boot JDK&quot;. The boot JDK does not, however, have to be a JDK built directly from the source code available in the OpenJDK Community. If you are porting the JDK to a new platform, chances are that there already exists another JDK for that platform that is usable as boot JDK.</p>
+<p>The rule of thumb is that the boot JDK for building JDK major version <em>N</em> should be a JDK of major version <em>N-1</em>, so for building JDK 9 a JDK 8 would be suitable as boot JDK. However, the JDK should be able to &quot;build itself&quot;, so an up-to-date build of the current JDK source is an acceptable alternative. If you are following the <em>N-1</em> rule, make sure you've got the latest update version, since JDK 8 GA might not be able to build JDK 9 on all platforms.</p>
 <p>Early in the release cycle, version <em>N-1</em> may not yet have been released. In that case, the preferred boot JDK will be version <em>N-2</em> until version <em>N-1</em> is available.</p>
 <p>If the boot JDK is not automatically detected, or the wrong JDK is picked, use <code>--with-boot-jdk</code> to point to the JDK to use.</p>
 <h3 id="getting-jdk-binaries">Getting JDK binaries</h3>
@@ -428,14 +423,14 @@
 <h3 id="gnu-make">GNU Make</h3>
 <p>The JDK requires <a href="http://www.gnu.org/software/make">GNU Make</a>. No other flavors of make are supported.</p>
 <p>At least version 3.81 of GNU Make must be used. For distributions supporting GNU Make 4.0 or above, we strongly recommend it. GNU Make 4.0 contains useful functionality to handle parallel building (supported by <code>--with-output-sync</code>) and speed and stability improvements.</p>
-<p>Note that <code>configure</code> locates and verifies a properly functioning version of <code>make</code> and stores the path to this <code>make</code> binary in the configuration. If you start a build using <code>make</code> on the command line, you will be using the version of make found first in your <code>PATH</code>, and not necessarily the one stored in the configuration. This initial make will be used as “bootstrap make”, and in a second stage, the make located by <code>configure</code> will be called. Normally, this will present no issues, but if you have a very old <code>make</code>, or a non-GNU Make <code>make</code> in your path, this might cause issues.</p>
+<p>Note that <code>configure</code> locates and verifies a properly functioning version of <code>make</code> and stores the path to this <code>make</code> binary in the configuration. If you start a build using <code>make</code> on the command line, you will be using the version of make found first in your <code>PATH</code>, and not necessarily the one stored in the configuration. This initial make will be used as &quot;bootstrap make&quot;, and in a second stage, the make located by <code>configure</code> will be called. Normally, this will present no issues, but if you have a very old <code>make</code>, or a non-GNU Make <code>make</code> in your path, this might cause issues.</p>
 <p>If you want to override the default make found by <code>configure</code>, use the <code>MAKE</code> configure variable, e.g. <code>configure MAKE=/opt/gnu/make</code>.</p>
 <p>On Solaris, it is common to call the GNU version of make by using <code>gmake</code>.</p>
 <h3 id="gnu-bash">GNU Bash</h3>
 <p>The JDK requires <a href="http://www.gnu.org/software/bash">GNU Bash</a>. No other shells are supported.</p>
 <p>At least version 3.2 of GNU Bash must be used.</p>
 <h2 id="running-configure">Running Configure</h2>
-<p>To build the JDK, you need a “configuration”, which consists of a directory where to store the build output, coupled with information about the platform, the specific build machine, and choices that affect how the JDK is built.</p>
+<p>To build the JDK, you need a &quot;configuration&quot;, which consists of a directory where to store the build output, coupled with information about the platform, the specific build machine, and choices that affect how the JDK is built.</p>
 <p>The configuration is created by the <code>configure</code> script. The basic invocation of the <code>configure</code> script looks like this:</p>
 <pre><code>bash configure [options]</code></pre>
 <p>This will create an output directory containing the configuration and setup an area for the build result. This directory typically looks like <code>build/linux-x64-normal-server-release</code>, but the actual name depends on your specific configuration. (It can also be set directly, see <a href="#using-multiple-configurations">Using Multiple Configurations</a>). This directory is referred to as <code>$BUILD</code> in this documentation.</p>
@@ -497,13 +492,13 @@
 </ul>
 <h3 id="configure-control-variables">Configure Control Variables</h3>
 <p>It is possible to control certain aspects of <code>configure</code> by overriding the value of <code>configure</code> variables, either on the command line or in the environment.</p>
-<p>Normally, this is <strong>not recommended</strong>. If used improperly, it can lead to a broken configuration. Unless you’re well versed in the build system, this is hard to use properly. Therefore, <code>configure</code> will print a warning if this is detected.</p>
+<p>Normally, this is <strong>not recommended</strong>. If used improperly, it can lead to a broken configuration. Unless you're well versed in the build system, this is hard to use properly. Therefore, <code>configure</code> will print a warning if this is detected.</p>
 <p>However, there are a few <code>configure</code> variables, known as <em>control variables</em> that are supposed to be overriden on the command line. These are variables that describe the location of tools needed by the build, like <code>MAKE</code> or <code>GREP</code>. If any such variable is specified, <code>configure</code> will use that value instead of trying to autodetect the tool. For instance, <code>bash configure MAKE=/opt/gnumake4.0/bin/make</code>.</p>
-<p>If a configure argument exists, use that instead, e.g. use <code>--with-jtreg</code> instead of setting <code>JTREGEXE</code>.</p>
+<p>If a configure argument exists, use that instead, e.g. use <code>--with-jtreg</code> instead of setting <code>JTREGEXE</code>.</p>
 <p>Also note that, despite what autoconf claims, setting <code>CFLAGS</code> will not accomplish anything. Instead use <code>--with-extra-cflags</code> (and similar for <code>cxxflags</code> and <code>ldflags</code>).</p>
 <h2 id="running-make">Running Make</h2>
 <p>When you have a proper configuration, all you need to do to build the JDK is to run <code>make</code>. (But see the warning at <a href="#gnu-make">GNU Make</a> about running the correct version of make.)</p>
-<p>When running <code>make</code> without any arguments, the default target is used, which is the same as running <code>make default</code> or <code>make jdk</code>. This will build a minimal (or roughly minimal) set of compiled output (known as an “exploded image”) needed for a developer to actually execute the newly built JDK. The idea is that in an incremental development fashion, when doing a normal make, you should only spend time recompiling what’s changed (making it purely incremental) and only do the work that’s needed to actually run and test your code.</p>
+<p>When running <code>make</code> without any arguments, the default target is used, which is the same as running <code>make default</code> or <code>make jdk</code>. This will build a minimal (or roughly minimal) set of compiled output (known as an &quot;exploded image&quot;) needed for a developer to actually execute the newly built JDK. The idea is that in an incremental development fashion, when doing a normal make, you should only spend time recompiling what's changed (making it purely incremental) and only do the work that's needed to actually run and test your code.</p>
 <p>The output of the exploded image resides in <code>$BUILD/jdk</code>. You can test the newly built JDK like this: <code>$BUILD/jdk/bin/java -version</code>.</p>
 <h3 id="common-make-targets">Common Make Targets</h3>
 <p>Apart from the default target, here are some common make targets:</p>
@@ -534,8 +529,8 @@
 </ul>
 <h3 id="make-control-variables">Make Control Variables</h3>
 <p>It is possible to control <code>make</code> behavior by overriding the value of <code>make</code> variables, either on the command line or in the environment.</p>
-<p>Normally, this is <strong>not recommended</strong>. If used improperly, it can lead to a broken build. Unless you’re well versed in the build system, this is hard to use properly. Therefore, <code>make</code> will print a warning if this is detected.</p>
-<p>However, there are a few <code>make</code> variables, known as <em>control variables</em> that are supposed to be overriden on the command line. These make up the “make time” configuration, as opposed to the “configure time” configuration.</p>
+<p>Normally, this is <strong>not recommended</strong>. If used improperly, it can lead to a broken build. Unless you're well versed in the build system, this is hard to use properly. Therefore, <code>make</code> will print a warning if this is detected.</p>
+<p>However, there are a few <code>make</code> variables, known as <em>control variables</em> that are supposed to be overriden on the command line. These make up the &quot;make time&quot; configuration, as opposed to the &quot;configure time&quot; configuration.</p>
 <h4 id="general-make-control-variables">General Make Control Variables</h4>
 <ul>
 <li><code>JOBS</code> - Specify the number of jobs to build with. See <a href="#build-performance">Build Performance</a>.</li>
@@ -559,7 +554,7 @@
 <li><code>JDK_FILTER</code></li>
 </ul>
 <h2 id="running-tests">Running Tests</h2>
-<p>Most of the JDK tests are using the <a href="http://openjdk.java.net/jtreg">JTReg</a> test framework. Make sure that your configuration knows where to find your installation of JTReg. If this is not picked up automatically, use the <code>--with-jtreg=&lt;path to jtreg home&gt;</code> option to point to the JTReg framework. Note that this option should point to the JTReg home, i.e. the top directory, containing <code>lib/jtreg.jar</code> etc.</p>
+<p>Most of the JDK tests are using the <a href="http://openjdk.java.net/jtreg">JTReg</a> test framework. Make sure that your configuration knows where to find your installation of JTReg. If this is not picked up automatically, use the <code>--with-jtreg=&lt;path to jtreg home&gt;</code> option to point to the JTReg framework. Note that this option should point to the JTReg home, i.e. the top directory, containing <code>lib/jtreg.jar</code> etc.</p>
 <p>The <a href="https://wiki.openjdk.java.net/display/Adoption">Adoption Group</a> provides recent builds of jtreg <a href="https://adopt-openjdk.ci.cloudbees.com/job/jtreg/lastSuccessfulBuild/artifact">here</a>. Download the latest <code>.tar.gz</code> file, unpack it, and point <code>--with-jtreg</code> to the <code>jtreg</code> directory that you just unpacked.</p>
 <p>To execute the most basic tests (tier 1), use:</p>
 <pre><code>make run-test-tier1</code></pre>
@@ -569,13 +564,13 @@
 <p>The typical reason for cross-compiling is that the build is performed on a more powerful desktop computer, but the resulting binaries will be able to run on a different, typically low-performing system. Most of the complications that arise when building for embedded is due to this separation of <em>build</em> and <em>target</em> systems.</p>
 <p>This requires a more complex setup and build procedure. This section assumes you are familiar with cross-compiling in general, and will only deal with the particularities of cross-compiling the JDK. If you are new to cross-compiling, please see the <a href="https://en.wikipedia.org/wiki/Cross_compiler#External_links">external links at Wikipedia</a> for a good start on reading materials.</p>
 <p>Cross-compiling the JDK requires you to be able to build both for the build platform and for the target platform. The reason for the former is that we need to build and execute tools during the build process, both native tools and Java tools.</p>
-<p>If all you want to do is to compile a 32-bit version, for the same OS, on a 64-bit machine, consider using <code>--with-target-bits=32</code> instead of doing a full-blown cross-compilation. (While this surely is possible, it’s a lot more work and will take much longer to build.)</p>
+<p>If all you want to do is to compile a 32-bit version, for the same OS, on a 64-bit machine, consider using <code>--with-target-bits=32</code> instead of doing a full-blown cross-compilation. (While this surely is possible, it's a lot more work and will take much longer to build.)</p>
 <h3 id="boot-jdk-and-build-jdk">Boot JDK and Build JDK</h3>
 <p>When cross-compiling, make sure you use a boot JDK that runs on the <em>build</em> system, and not on the <em>target</em> system.</p>
-<p>To be able to build, we need a “Build JDK”, which is a JDK built from the current sources (that is, the same as the end result of the entire build process), but able to run on the <em>build</em> system, and not the <em>target</em> system. (In contrast, the Boot JDK should be from an older release, e.g. JDK 8 when building JDK 9.)</p>
+<p>To be able to build, we need a &quot;Build JDK&quot;, which is a JDK built from the current sources (that is, the same as the end result of the entire build process), but able to run on the <em>build</em> system, and not the <em>target</em> system. (In contrast, the Boot JDK should be from an older release, e.g. JDK 8 when building JDK 9.)</p>
 <p>The build process will create a minimal Build JDK for you, as part of building. To speed up the build, you can use <code>--with-build-jdk</code> to <code>configure</code> to point to a pre-built Build JDK. Please note that the build result is unpredictable, and can possibly break in subtle ways, if the Build JDK does not <strong>exactly</strong> match the current sources.</p>
 <h3 id="specifying-the-target-platform">Specifying the Target Platform</h3>
-<p>You <em>must</em> specify the target platform when cross-compiling. Doing so will also automatically turn the build into a cross-compiling mode. The simplest way to do this is to use the <code>--openjdk-target</code> argument, e.g. <code>--openjdk-target=arm-linux-gnueabihf</code>. or <code>--openjdk-target=aarch64-oe-linux</code>. This will automatically set the <code>--build</code>, <code>--host</code> and <code>--target</code> options for autoconf, which can otherwise be confusing. (In autoconf terminology, the “target” is known as “host”, and “target” is used for building a Canadian cross-compiler.)</p>
+<p>You <em>must</em> specify the target platform when cross-compiling. Doing so will also automatically turn the build into a cross-compiling mode. The simplest way to do this is to use the <code>--openjdk-target</code> argument, e.g. <code>--openjdk-target=arm-linux-gnueabihf</code>. or <code>--openjdk-target=aarch64-oe-linux</code>. This will automatically set the <code>--build</code>, <code>--host</code> and <code>--target</code> options for autoconf, which can otherwise be confusing. (In autoconf terminology, the &quot;target&quot; is known as &quot;host&quot;, and &quot;target&quot; is used for building a Canadian cross-compiler.)</p>
 <h3 id="toolchain-considerations">Toolchain Considerations</h3>
 <p>You will need two copies of your toolchain, one which generates output that can run on the target system (the normal, or <em>target</em>, toolchain), and one that generates output that can run on the build system (the <em>build</em> toolchain). Note that cross-compiling is only supported for gcc at the time being. The gcc standard is to prefix cross-compiling toolchains with the target denominator. If you follow this standard, <code>configure</code> is likely to pick up the toolchain correctly.</p>
 <p>The <em>build</em> toolchain will be autodetected just the same way the normal <em>build</em>/<em>target</em> toolchain will be autodetected when not cross-compiling. If this is not what you want, or if the autodetection fails, you can specify a devkit containing the <em>build</em> toolchain using <code>--with-build-devkit</code> to <code>configure</code>, or by giving <code>BUILD_CC</code> and <code>BUILD_CXX</code> arguments.</p>
@@ -587,23 +582,21 @@
 </ul>
 <h3 id="native-libraries">Native Libraries</h3>
 <p>You will need copies of external native libraries for the <em>target</em> system, present on the <em>build</em> machine while building.</p>
-<p>Take care not to replace the <em>build</em> system’s version of these libraries by mistake, since that can render the <em>build</em> machine unusable.</p>
+<p>Take care not to replace the <em>build</em> system's version of these libraries by mistake, since that can render the <em>build</em> machine unusable.</p>
 <p>Make sure that the libraries you point to (ALSA, X11, etc) are for the <em>target</em>, not the <em>build</em>, platform.</p>
 <h4 id="alsa-1">ALSA</h4>
-<p>You will need alsa libraries suitable for your <em>target</em> system. For most cases, using Debian’s pre-built libraries work fine.</p>
+<p>You will need alsa libraries suitable for your <em>target</em> system. For most cases, using Debian's pre-built libraries work fine.</p>
 <p>Note that alsa is needed even if you only want to build a headless JDK.</p>
 <ul>
 <li><p>Go to <a href="https://www.debian.org/distrib/packages">Debian Package Search</a> and search for the <code>libasound2</code> and <code>libasound2-dev</code> packages for your <em>target</em> system. Download them to /tmp.</p></li>
-<li>Install the libraries into the cross-compilation toolchain. For instance:</li>
-</ul>
+<li><p>Install the libraries into the cross-compilation toolchain. For instance:</p>
 <pre><code>cd /tools/gcc-linaro-arm-linux-gnueabihf-raspbian-2012.09-20120921_linux/arm-linux-gnueabihf/libc
 dpkg-deb -x /tmp/libasound2_1.0.25-4_armhf.deb .
-dpkg-deb -x /tmp/libasound2-dev_1.0.25-4_armhf.deb .</code></pre>
-<ul>
-<li>If alsa is not properly detected by <code>configure</code>, you can point it out by <code>--with-alsa</code>.</li>
+dpkg-deb -x /tmp/libasound2-dev_1.0.25-4_armhf.deb .</code></pre></li>
+<li><p>If alsa is not properly detected by <code>configure</code>, you can point it out by <code>--with-alsa</code>.</p></li>
 </ul>
 <h4 id="x11-1">X11</h4>
-<p>You will need X11 libraries suitable for your <em>target</em> system. For most cases, using Debian’s pre-built libraries work fine.</p>
+<p>You will need X11 libraries suitable for your <em>target</em> system. For most cases, using Debian's pre-built libraries work fine.</p>
 <p>Note that X11 is needed even if you only want to build a headless JDK.</p>
 <ul>
 <li>Go to <a href="https://www.debian.org/distrib/packages">Debian Package Search</a>, search for the following packages for your <em>target</em> system, and download them to /tmp/target-x11:
@@ -643,7 +636,7 @@
 </ul>
 <h3 id="building-for-armaarch64">Building for ARM/aarch64</h3>
 <p>A common cross-compilation target is the ARM CPU. When building for ARM, it is useful to set the ABI profile. A number of pre-defined ABI profiles are available using <code>--with-abi-profile</code>: arm-vfp-sflt, arm-vfp-hflt, arm-sflt, armv5-vfp-sflt, armv6-vfp-hflt. Note that soft-float ABIs are no longer properly supported by the JDK.</p>
-<p>The JDK contains two different ports for the aarch64 platform, one is the original aarch64 port from the <a href="http://openjdk.java.net/projects/aarch64-port">AArch64 Port Project</a> and one is a 64-bit version of the Oracle contributed ARM port. When targeting aarch64, by the default the original aarch64 port is used. To select the Oracle ARM 64 port, use <code>--with-cpu-port=arm64</code>. Also set the corresponding value (<code>aarch64</code> or <code>arm64</code>) to –with-abi-profile, to ensure a consistent build.</p>
+<p>The JDK contains two different ports for the aarch64 platform, one is the original aarch64 port from the <a href="http://openjdk.java.net/projects/aarch64-port">AArch64 Port Project</a> and one is a 64-bit version of the Oracle contributed ARM port. When targeting aarch64, by the default the original aarch64 port is used. To select the Oracle ARM 64 port, use <code>--with-cpu-port=arm64</code>. Also set the corresponding value (<code>aarch64</code> or <code>arm64</code>) to --with-abi-profile, to ensure a consistent build.</p>
 <h3 id="verifying-the-build">Verifying the Build</h3>
 <p>The build will end up in a directory named like <code>build/linux-arm-normal-server-release</code>.</p>
 <p>Inside this build output directory, the <code>images/jdk</code> will contain the newly built JDK, for your <em>target</em> system.</p>
@@ -651,21 +644,21 @@
 <h2 id="build-performance">Build Performance</h2>
 <p>Building the JDK requires a lot of horsepower. Some of the build tools can be adjusted to utilize more or less of resources such as parallel threads and memory. The <code>configure</code> script analyzes your system and selects reasonable values for such options based on your hardware. If you encounter resource problems, such as out of memory conditions, you can modify the detected values with:</p>
 <ul>
-<li><p><code>--with-num-cores</code> – number of cores in the build system, e.g. <code>--with-num-cores=8</code>.</p></li>
-<li><p><code>--with-memory-size</code> – memory (in MB) available in the build system, e.g. <code>--with-memory-size=1024</code></p></li>
+<li><p><code>--with-num-cores</code> -- number of cores in the build system, e.g. <code>--with-num-cores=8</code>.</p></li>
+<li><p><code>--with-memory-size</code> -- memory (in MB) available in the build system, e.g. <code>--with-memory-size=1024</code></p></li>
 </ul>
 <p>You can also specify directly the number of build jobs to use with <code>--with-jobs=N</code> to <code>configure</code>, or <code>JOBS=N</code> to <code>make</code>. Do not use the <code>-j</code> flag to <code>make</code>. In most cases it will be ignored by the makefiles, but it can cause problems for some make targets.</p>
 <p>It might also be necessary to specify the JVM arguments passed to the Boot JDK, using e.g. <code>--with-boot-jdk-jvmargs=&quot;-Xmx8G&quot;</code>. Doing so will override the default JVM arguments passed to the Boot JDK.</p>
 <p>At the end of a successful execution of <code>configure</code>, you will get a performance summary, indicating how well the build will perform. Here you will also get performance hints. If you want to build fast, pay attention to those!</p>
 <p>If you want to tweak build performance, run with <code>make LOG=info</code> to get a build time summary at the end of the build process.</p>
 <h3 id="disk-speed">Disk Speed</h3>
-<p>If you are using network shares, e.g. via NFS, for your source code, make sure the build directory is situated on local disk (e.g. by <code>ln -s /localdisk/jdk-build $JDK-SHARE/build</code>). The performance penalty is extremely high for building on a network share; close to unusable.</p>
+<p>If you are using network shares, e.g. via NFS, for your source code, make sure the build directory is situated on local disk (e.g. by <code>ln -s /localdisk/jdk-build $JDK-SHARE/build</code>). The performance penalty is extremely high for building on a network share; close to unusable.</p>
 <p>Also, make sure that your build tools (including Boot JDK and toolchain) is located on a local disk and not a network share.</p>
 <p>As has been stressed elsewhere, do use SSD for source code and build directory, as well as (if possible) the build tools.</p>
 <h3 id="virus-checking">Virus Checking</h3>
 <p>The use of virus checking software, especially on Windows, can <em>significantly</em> slow down building of the JDK. If possible, turn off such software, or exclude the directory containing the JDK source code from on-the-fly checking.</p>
 <h3 id="ccache">Ccache</h3>
-<p>The JDK build supports building with ccache when using gcc or clang. Using ccache can radically speed up compilation of native code if you often rebuild the same sources. Your milage may vary however, so we recommend evaluating it for yourself. To enable it, make sure it’s on the path and configure with <code>--enable-ccache</code>.</p>
+<p>The JDK build supports building with ccache when using gcc or clang. Using ccache can radically speed up compilation of native code if you often rebuild the same sources. Your milage may vary however, so we recommend evaluating it for yourself. To enable it, make sure it's on the path and configure with <code>--enable-ccache</code>.</p>
 <h3 id="precompiled-headers">Precompiled Headers</h3>
 <p>By default, the Hotspot build uses preccompiled headers (PCH) on the toolchains were it is properly supported (clang, gcc, and Visual Studio). Normally, this speeds up the build process, but in some circumstances, it can actually slow things down.</p>
 <p>You can experiment by disabling precompiled headers using <code>--disable-precompiled-headers</code>.</p>
@@ -700,11 +693,11 @@
 
 Hint: Try searching the build log for the name of the first failed target.
 Hint: If caused by a warning, try configure --disable-warnings-as-errors.</code></pre>
-<p>Let’s break it down! First, the selected configuration, and the top-level target you entered on the command line that caused the failure is printed.</p>
+<p>Let's break it down! First, the selected configuration, and the top-level target you entered on the command line that caused the failure is printed.</p>
 <p>Then, between the <code>Output from failing command(s) repeated here</code> and <code>End of repeated output</code> the first lines of output (stdout and stderr) from the actual failing command is repeated. In most cases, this is the error message that caused the build to fail. If multiple commands were failing (this can happen in a parallel build), output from all failed commands will be printed here.</p>
 <p>The path to the <code>failure-logs</code> directory is printed. In this file you will find a <code>&lt;target&gt;.log</code> file that contains the output from this command in its entirety, and also a <code>&lt;target&gt;.cmd</code>, which contain the complete command line used for running this command. You can re-run the failing command by executing <code>. &lt;path to failure-logs&gt;/&lt;target&gt;.cmd</code> in your shell.</p>
 <p>Another way to trace the failure is to follow the chain of make targets, from top-level targets to individual file targets. Between <code>Make failed targets repeated here</code> and <code>End of repeated output</code> the output from make showing this chain is repeated. The first failed recipe will typically contain the full path to the file in question that failed to compile. Following lines will show a trace of make targets why we ended up trying to compile that file.</p>
-<p>Finally, some hints are given on how to locate the error in the complete log. In this example, we would try searching the log file for “<code>psMemoryPool.o</code>”. Another way to quickly locate make errors in the log is to search for “<code>] Error</code>” or “<code>***</code>”.</p>
+<p>Finally, some hints are given on how to locate the error in the complete log. In this example, we would try searching the log file for &quot;<code>psMemoryPool.o</code>&quot;. Another way to quickly locate make errors in the log is to search for &quot;<code>] Error</code>&quot; or &quot;<code>***</code>&quot;.</p>
 <p>Note that the build failure summary will only help you if the issue was a compilation failure or similar. If the problem is more esoteric, or is due to errors in the build machinery, you will likely get empty output logs, and <code>No indication of failed target found</code> instead of the make target chain.</p>
 <h4 id="checking-the-build-log-file">Checking the Build Log File</h4>
 <p>The output (stdout and stderr) from the latest build is always stored in <code>$BUILD/build.log</code>. The previous build log is stored as <code>build.log.old</code>. This means that it is not necessary to redirect the build output yourself if you want to process it.</p>
@@ -725,13 +718,13 @@
 <li><p>Clean build results</p>
 <p>The simplest way to fix incremental rebuild issues is to run <code>make clean</code>. This will remove all build results, but not the configuration or any build system support artifacts. In most cases, this will solve build errors resulting from incremental build mismatches.</p></li>
 <li><p>Completely clean the build directory.</p>
-<p>If this does not work, the next step is to run <code>make dist-clean</code>, or removing the build output directory (<code>$BUILD</code>). This will clean all generated output, including your configuration. You will need to re-run <code>configure</code> after this step. A good idea is to run <code>make print-configuration</code> before running <code>make dist-clean</code>, as this will print your current <code>configure</code> command line. Here’s a way to do this:</p>
+<p>If this does not work, the next step is to run <code>make dist-clean</code>, or removing the build output directory (<code>$BUILD</code>). This will clean all generated output, including your configuration. You will need to re-run <code>configure</code> after this step. A good idea is to run <code>make print-configuration</code> before running <code>make dist-clean</code>, as this will print your current <code>configure</code> command line. Here's a way to do this:</p>
 <pre><code>make print-configuration &gt; current-configuration
 make dist-clean
 bash configure $(cat current-configuration)
 make</code></pre></li>
 <li><p>Re-clone the Mercurial forest</p>
-<p>Sometimes the Mercurial repositories themselves gets in a state that causes the product to be un-buildable. In such a case, the simplest solution is often the “sledgehammer approach”: delete the entire forest, and re-clone it. If you have local changes, save them first to a different location using <code>hg export</code>.</p></li>
+<p>Sometimes the Mercurial repositories themselves gets in a state that causes the product to be un-buildable. In such a case, the simplest solution is often the &quot;sledgehammer approach&quot;: delete the entire forest, and re-clone it. If you have local changes, save them first to a different location using <code>hg export</code>.</p></li>
 </ol>
 <h3 id="specific-build-issues">Specific Build Issues</h3>
 <h4 id="clock-skew">Clock Skew</h4>
@@ -755,7 +748,7 @@
 <h2 id="hints-and-suggestions-for-advanced-users">Hints and Suggestions for Advanced Users</h2>
 <h3 id="setting-up-a-forest-for-pushing-changes-defpath">Setting Up a Forest for Pushing Changes (defpath)</h3>
 <p>To help you prepare a proper push path for a Mercurial repository, there exists a useful tool known as <a href="http://openjdk.java.net/projects/code-tools/defpath">defpath</a>. It will help you setup a proper push path for pushing changes to the JDK.</p>
-<p>Install the extension by cloning <code>http://hg.openjdk.java.net/code-tools/defpath</code> and updating your <code>.hgrc</code> file. Here’s one way to do this:</p>
+<p>Install the extension by cloning <code>http://hg.openjdk.java.net/code-tools/defpath</code> and updating your <code>.hgrc</code> file. Here's one way to do this:</p>
 <pre><code>cd ~
 mkdir hg-ext
 cd hg-ext
@@ -789,7 +782,7 @@
 <h3 id="handling-reconfigurations">Handling Reconfigurations</h3>
 <p>If you update the forest and part of the configure script has changed, the build system will force you to re-run <code>configure</code>.</p>
 <p>Most of the time, you will be fine by running <code>configure</code> again with the same arguments as the last time, which can easily be performed by <code>make reconfigure</code>. To simplify this, you can use the <code>CONF_CHECK</code> make control variable, either as <code>make CONF_CHECK=auto</code>, or by setting an environment variable. For instance, if you add <code>export CONF_CHECK=auto</code> to your <code>.bashrc</code> file, <code>make</code> will always run <code>reconfigure</code> automatically whenever the configure script has changed.</p>
-<p>You can also use <code>CONF_CHECK=ignore</code> to skip the check for a needed configure update. This might speed up the build, but comes at the risk of an incorrect build result. This is only recommended if you know what you’re doing.</p>
+<p>You can also use <code>CONF_CHECK=ignore</code> to skip the check for a needed configure update. This might speed up the build, but comes at the risk of an incorrect build result. This is only recommended if you know what you're doing.</p>
 <p>From time to time, you will also need to modify the command line to <code>configure</code> due to changes. Use <code>make print-configure</code> to show the command line used for your current configuration.</p>
 <h3 id="using-fine-grained-make-targets">Using Fine-Grained Make Targets</h3>
 <p>The default behavior for make is to create consistent and correct output, at the expense of build speed, if necessary.</p>
@@ -847,9 +840,9 @@
 <p>This is what they are used for:</p>
 <ul>
 <li><p><code>images</code>: This is the directory were the output of the <code>*-image</code> make targets end up. For instance, <code>make jdk-image</code> ends up in <code>images/jdk</code>.</p></li>
-<li><p><code>jdk</code>: This is the “exploded image”. After <code>make jdk</code>, you will be able to launch the newly built JDK by running <code>$BUILD/jdk/bin/java</code>.</p></li>
+<li><p><code>jdk</code>: This is the &quot;exploded image&quot;. After <code>make jdk</code>, you will be able to launch the newly built JDK by running <code>$BUILD/jdk/bin/java</code>.</p></li>
 <li><p><code>test-results</code>: This directory contains the results from running tests.</p></li>
-<li><p><code>support</code>: This is an area for intermediate files needed during the build, e.g. generated source code, object files and class files. Some noteworthy directories in <code>support</code> is <code>gensrc</code>, which contains the generated source code, and the <code>modules_*</code> directories, which contains the files in a per-module hierarchy that will later be collapsed into the <code>jdk</code> directory of the exploded image.</p></li>
+<li><p><code>support</code>: This is an area for intermediate files needed during the build, e.g. generated source code, object files and class files. Some noteworthy directories in <code>support</code> is <code>gensrc</code>, which contains the generated source code, and the <code>modules_*</code> directories, which contains the files in a per-module hierarchy that will later be collapsed into the <code>jdk</code> directory of the exploded image.</p></li>
 <li><p><code>buildtools</code>: This is an area for tools compiled for the build platform that are used during the rest of the build.</p></li>
 <li><p><code>hotspot</code>: This is an area for intermediate files needed when building hotspot.</p></li>
 <li><p><code>configure-support</code>, <code>make-support</code> and <code>test-support</code>: These directories contain files that are needed by the build system for <code>configure</code>, <code>make</code> and for running tests.</p></li>
@@ -884,7 +877,7 @@
 ))</code></pre>
 <p>By encapsulating and expressing the high-level knowledge of <em>what</em> should be done, rather than <em>how</em> it should be done (as is normal in Makefiles), we can build a much more powerful and flexible build system.</p>
 <p>Correct dependency tracking is paramount. Sloppy dependency tracking will lead to improper parallelization, or worse, race conditions.</p>
-<p>To test for/debug race conditions, try running <code>make JOBS=1</code> and <code>make JOBS=100</code> and see if it makes any difference. (It shouldn’t).</p>
+<p>To test for/debug race conditions, try running <code>make JOBS=1</code> and <code>make JOBS=100</code> and see if it makes any difference. (It shouldn't).</p>
 <p>To compare the output of two different builds and see if, and how, they differ, run <code>$BUILD1/compare.sh -o $BUILD2</code>, where <code>$BUILD1</code> and <code>$BUILD2</code> are the two builds you want to compare.</p>
 <p>To automatically build two consecutive versions and compare them, use <code>COMPARE_BUILD</code>. The value of <code>COMPARE_BUILD</code> is a set of variable=value assignments, like this:</p>
 <pre><code>make COMPARE_BUILD=CONF=--enable-new-hotspot-feature:MAKE=hotspot</code></pre>
@@ -892,9 +885,9 @@
 <p>To analyze build performance, run with <code>LOG=trace</code> and check <code>$BUILD/build-trace-time.log</code>. Use <code>JOBS=1</code> to avoid parallelism.</p>
 <p>Please check that you adhere to the <a href="http://openjdk.java.net/groups/build/doc/code-conventions.html">Code Conventions for the Build System</a> before submitting patches.</p>
 <h2 id="contributing-to-the-jdk">Contributing to the JDK</h2>
-<p>So, now you’ve built your JDK, and made your first patch, and want to contribute it back to the OpenJDK Community.</p>
+<p>So, now you've built your JDK, and made your first patch, and want to contribute it back to the OpenJDK Community.</p>
 <p>First of all: Thank you! We gladly welcome your contribution. However, please bear in mind that the JDK is a massive project, and we must ask you to follow our rules and guidelines to be able to accept your contribution.</p>
-<p>The official place to start is the <a href="http://openjdk.java.net/contribute/">‘How to contribute’ page</a>. There is also an official (but somewhat outdated and skimpy on details) <a href="http://openjdk.java.net/guide/">Developer’s Guide</a>.</p>
-<p>If this seems overwhelming to you, the Adoption Group is there to help you! A good place to start is their <a href="https://wiki.openjdk.java.net/display/Adoption/New+Contributor">‘New Contributor’ page</a>, or start reading the comprehensive <a href="https://adoptopenjdk.gitbooks.io/adoptopenjdk-getting-started-kit/en/">Getting Started Kit</a>. The Adoption Group will also happily answer any questions you have about contributing. Contact them by <a href="http://mail.openjdk.java.net/mailman/listinfo/adoption-discuss">mail</a> or <a href="http://openjdk.java.net/irc/">IRC</a>.</p>
+<p>The official place to start is the <a href="http://openjdk.java.net/contribute/">'How to contribute' page</a>. There is also an official (but somewhat outdated and skimpy on details) <a href="http://openjdk.java.net/guide/">Developer's Guide</a>.</p>
+<p>If this seems overwhelming to you, the Adoption Group is there to help you! A good place to start is their <a href="https://wiki.openjdk.java.net/display/Adoption/New+Contributor">'New Contributor' page</a>, or start reading the comprehensive <a href="https://adoptopenjdk.gitbooks.io/adoptopenjdk-getting-started-kit/en/">Getting Started Kit</a>. The Adoption Group will also happily answer any questions you have about contributing. Contact them by <a href="http://mail.openjdk.java.net/mailman/listinfo/adoption-discuss">mail</a> or <a href="http://openjdk.java.net/irc/">IRC</a>.</p>
 </body>
 </html>
--- a/doc/building.md	Wed Aug 01 11:02:19 2018 +0530
+++ b/doc/building.md	Fri Aug 03 12:52:58 2018 -0700
@@ -233,9 +233,8 @@
 machine running macOS. See the section on [Apple Xcode](#apple-xcode) on some
 strategies to deal with this.
 
-It is recommended that you use at least Mac OS X 10.9 (Mavericks). At the time
-of writing, the JDK has been successfully compiled on macOS versions up to
-10.12.5 (Sierra), using XCode 8.3.2 and `--disable-warnings-as-errors`.
+It is recommended that you use at least Mac OS X 10.13 (High Sierra). At the time
+of writing, the JDK has been successfully compiled on macOS 10.12 (Sierra).
 
 The standard macOS environment contains the basic tooling needed to build, but
 for external libraries a package manager is recommended. The JDK uses
@@ -292,9 +291,9 @@
  Operating system   Toolchain version
  ------------------ -------------------------------------------------------
  Linux              gcc 7.3.0
- macOS              Apple Xcode 6.3 (using clang 6.1.0)
+ macOS              Apple Xcode 9.4 (using clang 9.1.0)
  Solaris            Oracle Solaris Studio 12.4 (with compiler version 5.13)
- Windows            Microsoft Visual Studio 2013 update 4
+ Windows            Microsoft Visual Studio 2017 update 15.5.5
 
 ### gcc
 
@@ -315,7 +314,7 @@
 
 ### Apple Xcode
 
-The oldest supported version of Xcode is 5.
+The oldest supported version of Xcode is 8.
 
 You will need the Xcode command lines developers tools to be able to build
 the JDK. (Actually, *only* the command lines tools are needed, not the IDE.)
@@ -330,7 +329,7 @@
 good suggestions on managing multiple Xcode versions. To use a specific version
 of Xcode, use `xcode-select -s` before running `configure`, or use
 `--with-toolchain-path` to point to the version of Xcode to use, e.g.
-`configure --with-toolchain-path=/Applications/Xcode5.app/Contents/Developer/usr/bin`
+`configure --with-toolchain-path=/Applications/Xcode8.app/Contents/Developer/usr/bin`
 
 If you have recently (inadvertently) updated your OS and/or Xcode version, and
 the JDK can no longer be built, please see the section on [Problems with the
@@ -372,11 +371,11 @@
 
 The minimum accepted version of Visual Studio is 2010. Older versions will not
 be accepted by `configure`. The maximum accepted version of Visual Studio is
-2013.
+2017. Versions older than 2017 are unlikely to continue working for long.
 
 If you have multiple versions of Visual Studio installed, `configure` will by
 default pick the latest. You can request a specific version to be used by
-setting `--with-toolchain-version`, e.g. `--with-toolchain-version=2010`.
+setting `--with-toolchain-version`, e.g. `--with-toolchain-version=2015`.
 
 If you get `LINK: fatal error LNK1123: failure during conversion to COFF: file
 invalid` when building using Visual Studio 2010, you have encountered
--- a/make/CompileJavaModules.gmk	Wed Aug 01 11:02:19 2018 +0530
+++ b/make/CompileJavaModules.gmk	Fri Aug 03 12:52:58 2018 -0700
@@ -621,9 +621,14 @@
 	$(install-file)
 
 CreateHkTargets = \
-    $(patsubst $(TOPDIR)/src/%, $(JDK_OUTPUTDIR)/modules/%, \
-      $(subst /share/classes,, \
-        $(subst _zh_TW,_zh_HK, $(filter %_zh_TW.properties, $1))))
+    $(call FilterExcludedTranslations, \
+       $(patsubst $(TOPDIR)/src/%, $(JDK_OUTPUTDIR)/modules/%, \
+         $(subst /share/classes,, \
+            $(subst _zh_TW,_zh_HK, $(filter %_zh_TW.properties, $1)) \
+         ) \
+       ), \
+       .properties \
+    )
 
 ifeq ($(MODULE), java.sql.rowset)
   TARGETS += $(call CreateHkTargets, $(java.sql.rowset_CLEAN_FILES))
--- a/make/Images.gmk	Wed Aug 01 11:02:19 2018 +0530
+++ b/make/Images.gmk	Fri Aug 03 12:52:58 2018 -0700
@@ -121,115 +121,117 @@
 #
 # Avoid evaluating this whole section on windows for speed and stability
 ifneq ($(OPENJDK_TARGET_OS), windows)
-  JRE_MAN_PAGES += \
-      java.1 \
-      jjs.1 \
-      keytool.1 \
-      orbd.1 \
-      pack200.1 \
-      rmid.1 \
-      rmiregistry.1 \
-      servertool.1 \
-      unpack200.1
+  ifeq ($(BUILD_MANPAGES), true)
+    JRE_MAN_PAGES += \
+        java.1 \
+        jjs.1 \
+        keytool.1 \
+        orbd.1 \
+        pack200.1 \
+        rmid.1 \
+        rmiregistry.1 \
+        servertool.1 \
+        unpack200.1
 
-  JDK_MAN_PAGES += \
-      $(JRE_MAN_PAGES) \
-      idlj.1 \
-      jar.1 \
-      jarsigner.1 \
-      javac.1 \
-      javadoc.1 \
-      javap.1 \
-      jconsole.1 \
-      jcmd.1 \
-      jdb.1 \
-      jdeps.1 \
-      jinfo.1 \
-      jmap.1 \
-      jps.1 \
-      jrunscript.1 \
-      jstack.1 \
-      jstat.1 \
-      jstatd.1 \
-      rmic.1 \
-      serialver.1
+    JDK_MAN_PAGES += \
+        $(JRE_MAN_PAGES) \
+        idlj.1 \
+        jar.1 \
+        jarsigner.1 \
+        javac.1 \
+        javadoc.1 \
+        javap.1 \
+        jconsole.1 \
+        jcmd.1 \
+        jdb.1 \
+        jdeps.1 \
+        jinfo.1 \
+        jmap.1 \
+        jps.1 \
+        jrunscript.1 \
+        jstack.1 \
+        jstat.1 \
+        jstatd.1 \
+        rmic.1 \
+        serialver.1
 
-  # This variable is potentially overridden in the closed makefile.
-  MAN_SRC_BASEDIR ?= $(TOPDIR)/src
+    # This variable is potentially overridden in the closed makefile.
+    MAN_SRC_BASEDIR ?= $(TOPDIR)/src
 
-  ifeq ($(OPENJDK_TARGET_OS), linux)
-    MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/linux/doc
-    MAN1_SUBDIR = man
-  endif
-  ifeq ($(OPENJDK_TARGET_OS), solaris)
-    MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/solaris/doc
-    MAN1_SUBDIR = sun/man/man1
-  endif
-  ifeq ($(OPENJDK_TARGET_OS), macosx)
-    MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/bsd/doc
-    MAN1_SUBDIR = man
-  endif
+    ifeq ($(OPENJDK_TARGET_OS), linux)
+      MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/linux/doc
+      MAN1_SUBDIR = man
+    endif
+    ifeq ($(OPENJDK_TARGET_OS), solaris)
+      MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/solaris/doc
+      MAN1_SUBDIR = sun/man/man1
+    endif
+    ifeq ($(OPENJDK_TARGET_OS), macosx)
+      MAN_SRC_DIR = $(MAN_SRC_BASEDIR)/bsd/doc
+      MAN1_SUBDIR = man
+    endif
 
-  $(JRE_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
+    $(JRE_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
 	$(call LogInfo, Copying $(patsubst $(OUTPUTDIR)/%,%,$@))
 	$(install-file)
 
-  $(JDK_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
+    $(JDK_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
 	$(call LogInfo, Copying $(patsubst $(OUTPUTDIR)/%,%,$@))
 	$(install-file)
 
-  $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
+    $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
 	$(call LogInfo, Copying $(patsubst $(OUTPUTDIR)/%,%,$@))
 	$(install-file)
 
-  $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
+    $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
 	$(call LogInfo, Copying $(patsubst $(OUTPUTDIR)/%,%,$@))
 	$(install-file)
 
-  ifeq ($(OPENJDK_TARGET_OS), solaris)
-    $(JRE_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
+    ifeq ($(OPENJDK_TARGET_OS), solaris)
+      $(JRE_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
 	$(call LogInfo, Converting $(patsubst $(OUTPUTDIR)/%,%,$@))
 	$(install-file)
 
-    $(JDK_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
+      $(JDK_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
 	$(call LogInfo, Converting $(patsubst $(OUTPUTDIR)/%,%,$@))
 	$(install-file)
-  endif
+    endif
 
-  ifneq ($(findstring $(OPENJDK_TARGET_OS), linux macosx), )
-    $(JRE_IMAGE_DIR)/man/ja:
+    ifneq ($(findstring $(OPENJDK_TARGET_OS), linux macosx), )
+      $(JRE_IMAGE_DIR)/man/ja:
 	$(call LogInfo, Creating $(patsubst $(OUTPUTDIR)/%,%,$@))
 	$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
 
-    $(JDK_IMAGE_DIR)/man/ja:
+      $(JDK_IMAGE_DIR)/man/ja:
 	$(call LogInfo, Creating $(patsubst $(OUTPUTDIR)/%,%,$@))
 	$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
-  endif
+    endif
 
-  ifeq ($(OPENJDK_TARGET_OS), solaris)
-    JRE_MAN_PAGE_LIST = $(addprefix $(JRE_IMAGE_DIR)/man/man1/, $(JRE_MAN_PAGES)) \
-        $(addprefix $(JRE_IMAGE_DIR)/man/ja/man1/, $(JRE_MAN_PAGES)) \
-        $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JRE_MAN_PAGES)) \
-        $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/, $(JRE_MAN_PAGES))
+    ifeq ($(OPENJDK_TARGET_OS), solaris)
+      JRE_MAN_PAGE_LIST = $(addprefix $(JRE_IMAGE_DIR)/man/man1/, $(JRE_MAN_PAGES)) \
+          $(addprefix $(JRE_IMAGE_DIR)/man/ja/man1/, $(JRE_MAN_PAGES)) \
+          $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JRE_MAN_PAGES)) \
+          $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/, $(JRE_MAN_PAGES))
 
-    JDK_MAN_PAGE_LIST = $(addprefix $(JDK_IMAGE_DIR)/man/man1/, $(JDK_MAN_PAGES)) \
-        $(addprefix $(JDK_IMAGE_DIR)/man/ja/man1/, $(JDK_MAN_PAGES)) \
-        $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JDK_MAN_PAGES)) \
-        $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/, $(JDK_MAN_PAGES))
-  endif
+      JDK_MAN_PAGE_LIST = $(addprefix $(JDK_IMAGE_DIR)/man/man1/, $(JDK_MAN_PAGES)) \
+          $(addprefix $(JDK_IMAGE_DIR)/man/ja/man1/, $(JDK_MAN_PAGES)) \
+          $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JDK_MAN_PAGES)) \
+          $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/, $(JDK_MAN_PAGES))
+    endif
 
-  ifneq ($(findstring $(OPENJDK_TARGET_OS), linux macosx), )
-    JRE_MAN_PAGE_LIST = $(addprefix $(JRE_IMAGE_DIR)/man/man1/, $(JRE_MAN_PAGES)) \
-        $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JRE_MAN_PAGES)) \
-        $(JRE_IMAGE_DIR)/man/ja
+    ifneq ($(findstring $(OPENJDK_TARGET_OS), linux macosx), )
+      JRE_MAN_PAGE_LIST = $(addprefix $(JRE_IMAGE_DIR)/man/man1/, $(JRE_MAN_PAGES)) \
+          $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JRE_MAN_PAGES)) \
+          $(JRE_IMAGE_DIR)/man/ja
 
-    JDK_MAN_PAGE_LIST = $(addprefix $(JDK_IMAGE_DIR)/man/man1/, $(JDK_MAN_PAGES)) \
-        $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JDK_MAN_PAGES)) \
-        $(JDK_IMAGE_DIR)/man/ja
-  endif
+      JDK_MAN_PAGE_LIST = $(addprefix $(JDK_IMAGE_DIR)/man/man1/, $(JDK_MAN_PAGES)) \
+          $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JDK_MAN_PAGES)) \
+          $(JDK_IMAGE_DIR)/man/ja
+    endif
 
-  JRE_TARGETS += $(JRE_MAN_PAGE_LIST)
-  JDK_TARGETS += $(JDK_MAN_PAGE_LIST)
+    JRE_TARGETS += $(JRE_MAN_PAGE_LIST)
+    JDK_TARGETS += $(JDK_MAN_PAGE_LIST)
+  endif # BUILD_MANPAGES
 endif # Windows
 
 ################################################################################
--- a/make/autoconf/configure.ac	Wed Aug 01 11:02:19 2018 +0530
+++ b/make/autoconf/configure.ac	Fri Aug 03 12:52:58 2018 -0700
@@ -233,6 +233,7 @@
 JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER
 JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST
 JDKOPT_EXCLUDE_TRANSLATIONS
+JDKOPT_ENABLE_DISABLE_MANPAGES
 
 ###############################################################################
 #
--- a/make/autoconf/hotspot.m4	Wed Aug 01 11:02:19 2018 +0530
+++ b/make/autoconf/hotspot.m4	Fri Aug 03 12:52:58 2018 -0700
@@ -331,8 +331,10 @@
 
   # Enable JFR by default, except for Zero, linux-sparcv9 and on minimal.
   if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then
-    if test "x$OPENJDK_TARGET_OS" != xlinux || test "x$OPENJDK_TARGET_CPU" != xsparcv9; then
-      NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES jfr"
+    if test "x$OPENJDK_TARGET_OS" != xaix; then
+      if test "x$OPENJDK_TARGET_OS" != xlinux || test "x$OPENJDK_TARGET_CPU" != xsparcv9; then
+        NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES jfr"
+      fi
     fi
   fi
 
@@ -459,7 +461,7 @@
       JVM_FEATURES_aot="aot"
     fi
   else
-    if test "x$enable_aot" = "xno" || "x$DISABLE_AOT" = "xaot"; then
+    if test "x$enable_aot" = "xno" || test "x$DISABLE_AOT" = "xaot"; then
       AC_MSG_RESULT([no, forced])
     else
       AC_MSG_RESULT([no])
--- a/make/autoconf/jdk-options.m4	Wed Aug 01 11:02:19 2018 +0530
+++ b/make/autoconf/jdk-options.m4	Fri Aug 03 12:52:58 2018 -0700
@@ -604,3 +604,29 @@
 
   AC_SUBST(EXCLUDE_TRANSLATIONS)
 ])
+
+################################################################################
+#
+# Optionally disable man pages
+#
+AC_DEFUN([JDKOPT_ENABLE_DISABLE_MANPAGES],
+[
+  AC_ARG_ENABLE([manpages], [AS_HELP_STRING([--disable-manpages],
+      [Set to disable building of man pages @<:@enabled@:>@])])
+
+  BUILD_MANPAGES="true"
+  AC_MSG_CHECKING([if man pages should be built])
+  if test "x$enable_manpages" = "x"; then
+    AC_MSG_RESULT([yes])
+  elif test "x$enable_manpages" = "xyes"; then
+    AC_MSG_RESULT([yes, forced])
+  elif test "x$enable_manpages" = "xno"; then
+    AC_MSG_RESULT([no, forced])
+    BUILD_MANPAGES="false"
+  else
+    AC_MSG_RESULT([no])
+    AC_MSG_ERROR([--enable-manpages can only yes/no or empty])
+  fi
+
+  AC_SUBST(BUILD_MANPAGES)
+])
--- a/make/autoconf/jdk-version.m4	Wed Aug 01 11:02:19 2018 +0530
+++ b/make/autoconf/jdk-version.m4	Fri Aug 03 12:52:58 2018 -0700
@@ -139,15 +139,18 @@
     AC_MSG_ERROR([--with-version-string must have a value])
   elif test "x$with_version_string" != x; then
     # Additional [] needed to keep m4 from mangling shell constructs.
-    if [ [[ $with_version_string =~ ^([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(-([a-zA-Z]+))?((\+)([0-9]+)?(-([-a-zA-Z0-9.]+))?)?$ ]] ]; then
+    if [ [[ $with_version_string =~ ^([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(-([a-zA-Z]+))?((\+)([0-9]+)?(-([-a-zA-Z0-9.]+))?)?$ ]] ]; then
       VERSION_FEATURE=${BASH_REMATCH[[1]]}
       VERSION_INTERIM=${BASH_REMATCH[[3]]}
       VERSION_UPDATE=${BASH_REMATCH[[5]]}
       VERSION_PATCH=${BASH_REMATCH[[7]]}
-      VERSION_PRE=${BASH_REMATCH[[9]]}
-      version_plus_separator=${BASH_REMATCH[[11]]}
-      VERSION_BUILD=${BASH_REMATCH[[12]]}
-      VERSION_OPT=${BASH_REMATCH[[14]]}
+      VERSION_EXTRA1=${BASH_REMATCH[[9]]}
+      VERSION_EXTRA2=${BASH_REMATCH[[11]]}
+      VERSION_EXTRA3=${BASH_REMATCH[[13]]}
+      VERSION_PRE=${BASH_REMATCH[[15]]}
+      version_plus_separator=${BASH_REMATCH[[17]]}
+      VERSION_BUILD=${BASH_REMATCH[[18]]}
+      VERSION_OPT=${BASH_REMATCH[[20]]}
       # Unspecified numerical fields are interpreted as 0.
       if test "x$VERSION_INTERIM" = x; then
         VERSION_INTERIM=0
@@ -158,6 +161,15 @@
       if test "x$VERSION_PATCH" = x; then
         VERSION_PATCH=0
       fi
+      if test "x$VERSION_EXTRA1" = x; then
+        VERSION_EXTRA1=0
+      fi
+      if test "x$VERSION_EXTRA2" = x; then
+        VERSION_EXTRA2=0
+      fi
+      if test "x$VERSION_EXTRA3" = x; then
+        VERSION_EXTRA3=0
+      fi
       if test "x$version_plus_separator" != x \
           && test "x$VERSION_BUILD$VERSION_OPT" = x; then
         AC_MSG_ERROR([Version string contains + but both 'BUILD' and 'OPT' are missing])
@@ -327,6 +339,72 @@
     fi
   fi
 
+  # The 1st version extra number, if any
+  AC_ARG_WITH(version-extra1, [AS_HELP_STRING([--with-version-extra1],
+      [Set 1st version extra number @<:@not specified@:>@])],
+      [with_version_extra1_present=true], [with_version_extra1_present=false])
+
+  if test "x$with_version_extra1_present" = xtrue; then
+    if test "x$with_version_extra1" = xyes; then
+      AC_MSG_ERROR([--with-version-extra1 must have a value])
+    elif test "x$with_version_extra1" = xno; then
+      # Interpret --without-* as empty string (i.e. 0) instead of the literal "no"
+      VERSION_EXTRA1=0
+    elif test "x$with_version_extra1" = x; then
+      VERSION_EXTRA1=0
+    else
+      JDKVER_CHECK_AND_SET_NUMBER(VERSION_EXTRA1, $with_version_extra1)
+    fi
+  else
+    if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
+      VERSION_EXTRA1=$DEFAULT_VERSION_EXTRA1
+    fi
+  fi
+
+  # The 2nd version extra number, if any
+  AC_ARG_WITH(version-extra2, [AS_HELP_STRING([--with-version-extra2],
+      [Set 2nd version extra number @<:@not specified@:>@])],
+      [with_version_extra2_present=true], [with_version_extra2_present=false])
+
+  if test "x$with_version_extra2_present" = xtrue; then
+    if test "x$with_version_extra2" = xyes; then
+      AC_MSG_ERROR([--with-version-extra2 must have a value])
+    elif test "x$with_version_extra2" = xno; then
+      # Interpret --without-* as empty string (i.e. 0) instead of the literal "no"
+      VERSION_EXTRA2=0
+    elif test "x$with_version_extra2" = x; then
+      VERSION_EXTRA2=0
+    else
+      JDKVER_CHECK_AND_SET_NUMBER(VERSION_EXTRA2, $with_version_extra2)
+    fi
+  else
+    if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
+      VERSION_EXTRA2=$DEFAULT_VERSION_EXTRA2
+    fi
+  fi
+
+  # The 3rd version extra number, if any
+  AC_ARG_WITH(version-extra3, [AS_HELP_STRING([--with-version-extra3],
+      [Set 3rd version extra number @<:@not specified@:>@])],
+      [with_version_extra3_present=true], [with_version_extra3_present=false])
+
+  if test "x$with_version_extra3_present" = xtrue; then
+    if test "x$with_version_extra3" = xyes; then
+      AC_MSG_ERROR([--with-version-extra3 must have a value])
+    elif test "x$with_version_extra3" = xno; then
+      # Interpret --without-* as empty string (i.e. 0) instead of the literal "no"
+      VERSION_EXTRA3=0
+    elif test "x$with_version_extra3" = x; then
+      VERSION_EXTRA3=0
+    else
+      JDKVER_CHECK_AND_SET_NUMBER(VERSION_EXTRA3, $with_version_extra3)
+    fi
+  else
+    if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
+      VERSION_EXTRA3=$DEFAULT_VERSION_EXTRA3
+    fi
+  fi
+
   # Calculate derived version properties
 
   # Set VERSION_IS_GA based on if VERSION_PRE has a value
@@ -339,9 +417,12 @@
   # VERSION_NUMBER but always with exactly 4 positions, with 0 for empty positions.
   VERSION_NUMBER_FOUR_POSITIONS=$VERSION_FEATURE.$VERSION_INTERIM.$VERSION_UPDATE.$VERSION_PATCH
 
-  stripped_version_number=$VERSION_NUMBER_FOUR_POSITIONS
+  # VERSION_NUMBER but always with all positions, with 0 for empty positions.
+  VERSION_NUMBER_ALL_POSITIONS=$VERSION_NUMBER_FOUR_POSITIONS.$VERSION_EXTRA1.$VERSION_EXTRA2.$VERSION_EXTRA3
+
+  stripped_version_number=$VERSION_NUMBER_ALL_POSITIONS
   # Strip trailing zeroes from stripped_version_number
-  for i in 1 2 3 ; do stripped_version_number=${stripped_version_number%.0} ; done
+  for i in 1 2 3 4 5 6 ; do stripped_version_number=${stripped_version_number%.0} ; done
   VERSION_NUMBER=$stripped_version_number
 
   # The complete version string, with additional build information
@@ -392,6 +473,9 @@
   AC_SUBST(VERSION_INTERIM)
   AC_SUBST(VERSION_UPDATE)
   AC_SUBST(VERSION_PATCH)
+  AC_SUBST(VERSION_EXTRA1)
+  AC_SUBST(VERSION_EXTRA2)
+  AC_SUBST(VERSION_EXTRA3)
   AC_SUBST(VERSION_PRE)
   AC_SUBST(VERSION_BUILD)
   AC_SUBST(VERSION_OPT)
--- a/make/autoconf/spec.gmk.in	Wed Aug 01 11:02:19 2018 +0530
+++ b/make/autoconf/spec.gmk.in	Fri Aug 03 12:52:58 2018 -0700
@@ -165,6 +165,9 @@
 VERSION_INTERIM := @VERSION_INTERIM@
 VERSION_UPDATE := @VERSION_UPDATE@
 VERSION_PATCH := @VERSION_PATCH@
+VERSION_EXTRA1 := @VERSION_EXTRA1@
+VERSION_EXTRA2 := @VERSION_EXTRA2@
+VERSION_EXTRA3 := @VERSION_EXTRA3@
 # The pre-release identifier (string)
 VERSION_PRE := @VERSION_PRE@
 # The build number (numerical)
@@ -203,6 +206,9 @@
     -DVERSION_INTERIM=$(VERSION_INTERIM) \
     -DVERSION_UPDATE=$(VERSION_UPDATE) \
     -DVERSION_PATCH=$(VERSION_PATCH) \
+    -DVERSION_EXTRA1=$(VERSION_EXTRA1) \
+    -DVERSION_EXTRA2=$(VERSION_EXTRA2) \
+    -DVERSION_EXTRA3=$(VERSION_EXTRA3) \
     -DVERSION_PRE='"$(VERSION_PRE)"' \
     -DVERSION_BUILD=$(VERSION_BUILD) \
     -DVERSION_OPT='"$(VERSION_OPT)"' \
@@ -305,6 +311,8 @@
 
 EXCLUDE_TRANSLATIONS := @EXCLUDE_TRANSLATIONS@
 
+BUILD_MANPAGES := @BUILD_MANPAGES@
+
 # The boot jdk to use. This is overridden in bootcycle-spec.gmk. Make sure to keep
 # it in sync.
 BOOT_JDK:=@BOOT_JDK@
--- a/make/autoconf/version-numbers	Wed Aug 01 11:02:19 2018 +0530
+++ b/make/autoconf/version-numbers	Fri Aug 03 12:52:58 2018 -0700
@@ -29,6 +29,9 @@
 DEFAULT_VERSION_INTERIM=0
 DEFAULT_VERSION_UPDATE=0
 DEFAULT_VERSION_PATCH=0
+DEFAULT_VERSION_EXTRA1=0
+DEFAULT_VERSION_EXTRA2=0
+DEFAULT_VERSION_EXTRA3=0
 DEFAULT_VERSION_DATE=2019-03-19
 DEFAULT_VERSION_CLASSFILE_MAJOR=56  # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
 DEFAULT_VERSION_CLASSFILE_MINOR=0
--- a/make/conf/jib-profiles.js	Wed Aug 01 11:02:19 2018 +0530
+++ b/make/conf/jib-profiles.js	Fri Aug 03 12:52:58 2018 -0700
@@ -242,7 +242,8 @@
         dependencies: ["boot_jdk", "gnumake", "jtreg", "jib", "autoconf"],
         default_make_targets: ["product-bundles", "test-bundles"],
         configure_args: concat(["--enable-jtreg-failure-handler"],
-            "--with-exclude-translations=de,es,fr,it,ko,pt_BR,sv,ca,tr,cs,sk,ja_JP_A,ja_JP_HA,ja_JP_HI,ja_JP_I",
+            "--with-exclude-translations=de,es,fr,it,ko,pt_BR,sv,ca,tr,cs,sk,ja_JP_A,ja_JP_HA,ja_JP_HI,ja_JP_I,zh_TW,zh_HK",
+            "--disable-manpages",
             versionArgs(input, common))
     };
     // Extra settings for debug profiles
@@ -900,7 +901,7 @@
         jtreg: {
             server: "javare",
             revision: "4.2",
-            build_number: "b12",
+            build_number: "b13",
             checksum_file: "MD5_VALUES",
             file: "jtreg_bin-4.2.zip",
             environment_name: "JT_HOME",
--- a/make/data/docs-resources/resources/jdk-default.css	Wed Aug 01 11:02:19 2018 +0530
+++ b/make/data/docs-resources/resources/jdk-default.css	Fri Aug 03 12:52:58 2018 -0700
@@ -75,7 +75,7 @@
 }
 
 a:link {
-  color: #437291;
+  color: #4A6782;
 }
 
 a:visited {
@@ -117,7 +117,7 @@
 }
 
 tr:nth-child(even), tr:nth-child(even) th[scope=row] {
-  background: #DDD;
+  background: #E3E3E3;
 }
 
 tr:nth-child(odd), tr:nth-child(odd) th[scope=row] {
--- a/make/hotspot/src/native/dtrace/generateJvmOffsets.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/make/hotspot/src/native/dtrace/generateJvmOffsets.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -212,7 +212,7 @@
   GEN_VALUE(AccessFlags_NATIVE, JVM_ACC_NATIVE);
   GEN_VALUE(ConstMethod_has_linenumber_table, ConstMethod::_has_linenumber_table);
   GEN_OFFS(AccessFlags, _flags);
-  GEN_OFFS(Symbol, _length);
+  GEN_OFFS(Symbol, _length_and_refcount);
   GEN_OFFS(Symbol, _body);
   printf("\n");
 
--- a/make/idea/template/ant.xml	Wed Aug 01 11:02:19 2018 +0530
+++ b/make/idea/template/ant.xml	Fri Aug 03 12:52:58 2018 -0700
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="AntConfiguration">
-    <buildFile url="file://$PROJECT_DIR$/.idea/build.xml">
+    <buildFile url="file://$PROJECT_DIR$/build/.idea-support/build.xml">
       <properties>
         <property name="intellij.ismake" value="$IsMake$" />
         <property name="build.target.dir" value="specDir" /> <!-- this will be replaced -->
--- a/make/idea/template/build.xml	Wed Aug 01 11:02:19 2018 +0530
+++ b/make/idea/template/build.xml	Fri Aug 03 12:52:58 2018 -0700
@@ -1,5 +1,5 @@
 <!-- importing.xml -->
-<project name="jdk" basedir="..">
+<project name="jdk" basedir="../..">
 
     <script language="javascript" classpath=".idea/classes">
         var JdkLogger = Java.type("idea.JdkIdeaAntLogger");
--- a/make/idea/template/misc.xml	Wed Aug 01 11:02:19 2018 +0530
+++ b/make/idea/template/misc.xml	Fri Aug 03 12:52:58 2018 -0700
@@ -9,10 +9,10 @@
     <jre alt="true" value="images_jdk" /> <!-- this will be replaced -->
     <options></options>
     <ant>
-      <target file="file://$PROJECT_DIR$/.idea/build.xml" name="images" />
+      <target file="file://$PROJECT_DIR$/build/.idea-support/build.xml" name="images" />
     </ant>
   </component>
   <component name="ProjectRootManager" version="2" languageLevel="JDK_1_9" assert-keyword="true" jdk-15="true">
-    <output url="file://$PROJECT_DIR$/build/idea/out" />
+    <output url="file://$PROJECT_DIR$/build/.idea-support/out" />
   </component>
 </project>
--- a/make/jdk/src/classes/build/tools/jdwpgen/RootNode.java	Wed Aug 01 11:02:19 2018 +0530
+++ b/make/jdk/src/classes/build/tools/jdwpgen/RootNode.java	Fri Aug 03 12:52:58 2018 -0700
@@ -52,14 +52,16 @@
         writer.println("</style>");
         writer.println("</head>");
         writer.println("<body>");
-        writer.println("<ul>");
+        writer.println("<ul role=\"navigation\">");
         for (Node node : components) {
             node.documentIndex(writer);
         }
         writer.println("</ul>");
+        writer.println("<div role=\"main\">");
         for (Node node : components) {
             node.document(writer);
         }
+        writer.println("</div>");
         writer.println("</body></html>");
     }
 
--- a/make/langtools/build.xml	Wed Aug 01 11:02:19 2018 +0530
+++ b/make/langtools/build.xml	Fri Aug 03 12:52:58 2018 -0700
@@ -76,6 +76,7 @@
     <property name="make.conf.dir" location="${make.dir}/conf"/>
     <property name="make.tools.dir" location="${make.dir}/tools"/>
     <property name="build.dir" location="build/langtools"/>
+    <property name="idea.support.dir" location="build/.idea-support"/>
     <property name="build.modules" location="${build.dir}/modules"/>
     <property name="build.gensrc" location="${build.dir}/gensrc"/>
     <property name="build.tools" location="${build.dir}/toolclasses"/>
@@ -274,6 +275,9 @@
                <exclude name="**/utils/**"/>
             </fileset>
         </copy>
+        <!-- move build.xml out of .idea, see IDEA-189915 -->
+        <mkdir dir="${idea.support.dir}"/>
+        <move todir="${idea.support.dir}" file=".idea/build.xml"/>
         <condition property="idea.jtreg.home" value="${jtreg.home}" else = "[jtreg.home]">
             <isset property="jtreg.home"/>
         </condition>
--- a/make/langtools/intellij/ant.xml	Wed Aug 01 11:02:19 2018 +0530
+++ b/make/langtools/intellij/ant.xml	Fri Aug 03 12:52:58 2018 -0700
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="AntConfiguration">
-    <buildFile url="file://$PROJECT_DIR$/.idea/build.xml">
+    <buildFile url="file://$PROJECT_DIR$/build/.idea-support/build.xml">
       <properties>
 	    <property name="langtools.jdk.home" value="@IDEA_TARGET_JDK@" />
         <property name="intellij.ismake" value="$IsMake$" />
--- a/make/langtools/intellij/build.xml	Wed Aug 01 11:02:19 2018 +0530
+++ b/make/langtools/intellij/build.xml	Fri Aug 03 12:52:58 2018 -0700
@@ -1,12 +1,12 @@
 <!-- importing.xml -->
-<project name="langtools" basedir="..">
+<project name="langtools" basedir="../..">
 
     <script language="javascript" classpath=".idea/classes">
         var LangtoolsLogger = Java.type("idea.LangtoolsIdeaAntLogger");
         new LangtoolsLogger(project)
     </script>
 
-    <import file="../make/langtools/build.xml"/>
+    <import file="../../make/langtools/build.xml"/>
 
     <target name="cond-clean" unless="${intellij.ismake}">
         <antcall target="clean"/>
--- a/make/langtools/intellij/misc.xml	Wed Aug 01 11:02:19 2018 +0530
+++ b/make/langtools/intellij/misc.xml	Fri Aug 03 12:52:58 2018 -0700
@@ -9,12 +9,10 @@
     <jre alt="true" value="@IDEA_TARGET_JDK@" />
     <options>@XPATCH@</options>
     <ant>
-      <target file="file://$PROJECT_DIR$/.idea/build.xml" name="build-all-classes" />
+      <target file="file://$PROJECT_DIR$/build/.idea-support/build.xml" name="build-all-classes" />
     </ant>
   </component>
   <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
-    <output url="file://$PROJECT_DIR$/.idea/out" />
+    <output url="file://$PROJECT_DIR$/build/.idea-support/out" />
   </component>
 </project>
-
-
--- a/src/demo/share/jfc/SwingSet2/resources/swingset_ja.properties	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/demo/share/jfc/SwingSet2/resources/swingset_ja.properties	Fri Aug 03 12:52:58 2018 -0700
@@ -128,24 +128,24 @@
 
 FileMenu.file.labelAndMnemonic=\u30D5\u30A1\u30A4\u30EB(&F)
 FileMenu.accessible_description=\u30D5\u30A1\u30A4\u30EB\u30FB\u30E1\u30CB\u30E5\u30FC
-FileMenu.about.labelAndMnemonic=\u60C5\u5831(&B)
+FileMenu.about.labelAndMnemonic=\u6982\u8981(&B)
 FileMenu.about_accessible_description=SwingSet2\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u8A73\u7D30\u3092\u78BA\u8A8D\u3057\u307E\u3059
 FileMenu.open.labelAndMnemonic=\u958B\u304F(&O)
-FileMenu.open_accessible_description=\u30D5\u30A1\u30A4\u30EB\u3092\u958B\u304F\u305F\u3081\u306E\u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u30FB\u30E1\u30CB\u30E5\u30FC\u9805\u76EE
+FileMenu.open_accessible_description=\u30D5\u30A1\u30A4\u30EB\u3092\u958B\u304F\u305F\u3081\u306E\u30E1\u30CB\u30E5\u30FC\u9805\u76EE
 FileMenu.save.labelAndMnemonic=\u4FDD\u5B58(&S)
-FileMenu.save_accessible_description=\u30D5\u30A1\u30A4\u30EB\u3092\u4FDD\u5B58\u3059\u308B\u305F\u3081\u306E\u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u30FB\u30E1\u30CB\u30E5\u30FC\u9805\u76EE
+FileMenu.save_accessible_description=\u30D5\u30A1\u30A4\u30EB\u3092\u4FDD\u5B58\u3059\u308B\u305F\u3081\u306E\u30E1\u30CB\u30E5\u30FC\u9805\u76EE
 FileMenu.save_as.labelAndMnemonic=\u5225\u540D\u4FDD\u5B58(&A)...
-FileMenu.save_as_accessible_description=\u30D5\u30A1\u30A4\u30EB\u3092\u5225\u540D\u4FDD\u5B58\u3059\u308B\u305F\u3081\u306E\u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u30FB\u30E1\u30CB\u30E5\u30FC\u9805\u76EE
+FileMenu.save_as_accessible_description=\u30D5\u30A1\u30A4\u30EB\u3092\u5225\u540D\u4FDD\u5B58\u3059\u308B\u305F\u3081\u306E\u30E1\u30CB\u30E5\u30FC\u9805\u76EE
 FileMenu.exit.labelAndMnemonic=\u7D42\u4E86(&X)
 FileMenu.exit_accessible_description=SwingSet2\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u3092\u7D42\u4E86\u3057\u307E\u3059
 
 ### Multi-Screen menu ###
-MultiMenu.multi.labelAndMnemonic=\u30DE\u30EB\u30C1\u30B9\u30AF\u30EA\u30FC\u30F3(&M)
-MultiMenu.multi_accessible_description=\u30DE\u30EB\u30C1\u30B9\u30AF\u30EA\u30FC\u30F3\u30FB\u30E1\u30CB\u30E5\u30FC
-MultiMenu.all.labelAndMnemonic=SwingSet2\u3092\u3059\u3079\u3066\u306E\u30B9\u30AF\u30EA\u30FC\u30F3\u306B\u4F5C\u6210\u3057\u307E\u3059(&A)
-MultiMenu.all_accessible_description=SwingSet2\u306E\u30A6\u30A3\u30F3\u30C9\u30A6\u3092\u30B9\u30AF\u30EA\u30FC\u30F3\u3054\u3068\u306B\u4F5C\u6210\u3057\u307E\u3059
-MultiMenu.single.labelAndMnemonic=SwingSet2\u3092\u30B9\u30AF\u30EA\u30FC\u30F3\u306B\u4F5C\u6210\u3057\u307E\u3059
-MultiMenu.single_accessible_description=SwingSet2\u306E\u30A6\u30A3\u30F3\u30C9\u30A6\u3092\u30B9\u30AF\u30EA\u30FC\u30F3\u306B\u4F5C\u6210\u3057\u307E\u3059
+MultiMenu.multi.labelAndMnemonic=\u30B9\u30AF\u30EA\u30FC\u30F3\u30FB\u30E2\u30FC\u30C9(&M)
+MultiMenu.multi_accessible_description=\u30B9\u30AF\u30EA\u30FC\u30F3\u30FB\u30E1\u30CB\u30E5\u30FC
+MultiMenu.all.labelAndMnemonic=\u30DE\u30EB\u30C1\u30FB\u30B9\u30AF\u30EA\u30FC\u30F3(&A)
+MultiMenu.all_accessible_description=SwingSet2\u306E\u30A6\u30A3\u30F3\u30C9\u30A6\u3092\u3059\u3079\u3066\u306E\u30B9\u30AF\u30EA\u30FC\u30F3\u306B\u4F5C\u6210\u3057\u307E\u3059
+MultiMenu.single.labelAndMnemonic=\u30B7\u30F3\u30B0\u30EB\u30FB\u30B9\u30AF\u30EA\u30FC\u30F3
+MultiMenu.single_accessible_description=SwingSet2\u306E\u30A6\u30A3\u30F3\u30C9\u30A6\u30921\u3064\u306E\u30B9\u30AF\u30EA\u30FC\u30F3\u306B\u4F5C\u6210\u3057\u307E\u3059
 
 
 ################################
@@ -295,7 +295,7 @@
 FileChooserDemo.help=\u30D8\u30EB\u30D7
 FileChooserDemo.find=\u691C\u7D22
 FileChooserDemo.ok=OK
-FileChooserDemo.about=\u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831
+FileChooserDemo.about=\u8A73\u7D30
 FileChooserDemo.cancel=\u53D6\u6D88
 
 ### Html Demo ###
@@ -308,20 +308,20 @@
 
 ### Internal Frame Demo ###
 
-InternalFrameDemo.accessible_description=JInternal Frame\u30C7\u30E2
+InternalFrameDemo.accessible_description=JInternalFrame\u30C7\u30E2
 InternalFrameDemo.create_frames.labelAndMnemonic=\u30AB\u30B9\u30BF\u30DE\u30A4\u30BA\u3055\u308C\u305F\u5185\u90E8\u30D5\u30EC\u30FC\u30E0\u306E\u4F5C\u6210
 InternalFrameDemo.title_text_field.labelAndMnemonic=\u30D5\u30EC\u30FC\u30E0\u306E\u30BF\u30A4\u30C8\u30EB:
 InternalFrameDemo.frame.labelAndMnemonic=\u30D5\u30EC\u30FC\u30E0
 InternalFrameDemo.palette.labelAndMnemonic=\u5185\u90E8\u30D5\u30EC\u30FC\u30E0\u306E\u4F5C\u6210
-InternalFrameDemo.name=Internal Frame\u30C7\u30E2
-InternalFrameDemo.tooltip=JInternal Frame\u30C7\u30E2
+InternalFrameDemo.name=InternalFrame\u30C7\u30E2
+InternalFrameDemo.tooltip=JInternalFrame\u30C7\u30E2
 InternalFrameDemo.closable.labelAndMnemonic=\u30AF\u30ED\u30FC\u30BA\u53EF
 InternalFrameDemo.resizable.labelAndMnemonic=\u30B5\u30A4\u30BA\u5909\u66F4\u53EF
 InternalFrameDemo.iconifiable.labelAndMnemonic=\u6700\u5C0F\u5316\u53EF
 InternalFrameDemo.maximizable.labelAndMnemonic=\u6700\u5927\u5316\u53EF
-InternalFrameDemo.toast=Cheers
-InternalFrameDemo.duke=Your Grace
-InternalFrameDemo.duchess=Duchess
+InternalFrameDemo.toast=\u4E7E\u676F
+InternalFrameDemo.duke=\u730A\u4E0B
+InternalFrameDemo.duchess=\u516C\u7235\u592B\u4EBA
 InternalFrameDemo.cab=Anyone need a Taxi?
 
 
@@ -330,8 +330,8 @@
 ListDemo.accessible_description=JList\u30C7\u30E2
 ListDemo.name=List\u30C7\u30E2
 ListDemo.tooltip=JList\u30C7\u30E2
-ListDemo.prefixes=\u63A5\u982D\u8F9E
-ListDemo.suffixes=\u63A5\u5C3E\u8F9E
+ListDemo.prefixes=\u30D7\u30EA\u30D5\u30A3\u30AF\u30B9
+ListDemo.suffixes=\u30B5\u30D5\u30A3\u30AF\u30B9
 ListDemo.count.labelAndMnemonic=\u751F\u6210\u3055\u308C\u305F\u30EA\u30B9\u30C8\u30FB\u30A8\u30F3\u30C8\u30EA\u306E\u6570:
 ListDemo.all=\u3059\u3079\u3066
 ListDemo.none=\u306A\u3057
@@ -342,14 +342,14 @@
 ListDemo.green=\u7DD1\u8272\u306E\u4F1A\u793E\u30ED\u30B4\u30FB\u30A4\u30E1\u30FC\u30B8
 ListDemo.magenta=\u30DE\u30BC\u30F3\u30BF\u306E\u4F1A\u793E\u30ED\u30B4\u30FB\u30A4\u30E1\u30FC\u30B8
 ListDemo.cyan=\u30B7\u30A2\u30F3\u306E\u4F1A\u793E\u30ED\u30B4\u30FB\u30A4\u30E1\u30FC\u30B8
-ListDemo.description=<html><P STYLE="margin-left: .25in; margin-right: .25in">\u3053\u306E\u30C7\u30E2\u3067\u306F\u30012\u3064\u306E\u7570\u306A\u308B\u65B9\u6CD5\u3067\u4F5C\u6210\u3057\u305F\u30EA\u30B9\u30C8\u3092\u7D39\u4ECB\u3057\u307E\u3059\u3002\u5DE6\u5074\u306B\u3042\u308B<b>JList</b>\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u30EA\u30B9\u30C8\u9805\u76EE\u306F\u3001\u30C1\u30A7\u30C3\u30AF\u30FB\u30DE\u30FC\u30AF\u306E\u4ED8\u3051\u3089\u308C\u305F\u63A5\u982D\u8F9E\u304A\u3088\u3073\u63A5\u5C3E\u8F9E\u306E\u9806\u5217\u3067\u69CB\u6210\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u53F3\u5074\u306E\u63A5\u982D\u8F9E\u304A\u3088\u3073\u63A5\u5C3E\u8F9E\u306E\u30C1\u30A7\u30C3\u30AF\u30FB\u30DC\u30C3\u30AF\u30B9\u306E\u5217\u306F\u3001\u5782\u76F4\u914D\u7F6E\u306E<b>BoxLayout</b>\u3092\u6301\u3064<b>JPanel</b>\u3092\u4F7F\u7528\u3057\u3066<b>JScrollPane</b>\u5185\u306B\u4F5C\u6210\u3055\u308C\u307E\u3059\u3002</P></html>
+ListDemo.description=<html><P STYLE="margin-left: .25in; margin-right: .25in">\u3053\u306E\u30C7\u30E2\u3067\u306F\u30012\u3064\u306E\u7570\u306A\u308B\u65B9\u6CD5\u3067\u4F5C\u6210\u3057\u305F\u30EA\u30B9\u30C8\u3092\u7D39\u4ECB\u3057\u307E\u3059\u3002\u5DE6\u5074\u306B\u3042\u308B<b>JList</b>\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u30EA\u30B9\u30C8\u9805\u76EE\u306F\u3001\u30C1\u30A7\u30C3\u30AF\u30FB\u30DE\u30FC\u30AF\u306E\u4ED8\u3051\u3089\u308C\u305F\u30D7\u30EC\u30D5\u30A3\u30C3\u30AF\u30B9\u304A\u3088\u3073\u30B5\u30D5\u30A3\u30AF\u30B9\u306E\u9806\u5217\u3067\u69CB\u6210\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u53F3\u5074\u306E\u30D7\u30EC\u30D5\u30A3\u30C3\u30AF\u30B9\u304A\u3088\u3073\u30B5\u30D5\u30A3\u30AF\u30B9\u306E\u30C1\u30A7\u30C3\u30AF\u30FB\u30DC\u30C3\u30AF\u30B9\u306E\u5217\u306F\u3001\u5782\u76F4\u914D\u7F6E\u306E<b>BoxLayout</b>\u3092\u6301\u3064<b>JPanel</b>\u3092\u4F7F\u7528\u3057\u3066<b>JScrollPane</b>\u5185\u306B\u4F5C\u6210\u3055\u308C\u307E\u3059\u3002</P></html>
 
 
 ### OptionPane Demo ###
 
 OptionPaneDemo.accessible_description=OptionPane\u30C7\u30E2\u3067\u306F\u3001\u69D8\u3005\u306A\u5171\u901A\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u30FB\u30C0\u30A4\u30A2\u30ED\u30B0\u30FB\u30DC\u30C3\u30AF\u30B9\u3092\u751F\u6210\u3059\u308B\u305F\u3081\u306EJOptionPane\u306E\u4F7F\u7528\u4F8B\u3092\u7D39\u4ECB\u3057\u307E\u3059
 OptionPaneDemo.tooltip=JOptionPane\u30C7\u30E2
-OptionPaneDemo.name=Option Pane\u30C7\u30E2
+OptionPaneDemo.name=OptionPane\u30C7\u30E2
 
 OptionPaneDemo.warningbutton=\u8B66\u544A\u30C0\u30A4\u30A2\u30ED\u30B0\u306E\u8868\u793A
 OptionPaneDemo.componentbutton=\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30FB\u30C0\u30A4\u30A2\u30ED\u30B0\u306E\u8868\u793A
@@ -367,10 +367,10 @@
 OptionPaneDemo.confirmno=\u5C4B\u5185\u306B\u3044\u3066\u69D8\u3005\u306A\u3082\u306E\u304B\u3089\u4FDD\u8B77\u3055\u308C\u3066\u3044\u308B\u306E\u306F\u3044\u3044\u3053\u3068\u3067\u3059\u3002
 
 OptionPaneDemo.inputquestion=\u597D\u304D\u306A\u6620\u753B\u306F\u4F55\u3067\u3059\u304B\u3002
-OptionPaneDemo.inputresponse=\u3042\u308C\u306F\u3068\u3066\u3082\u3044\u3044\u6620\u753B\u3067\u3057\u305F\u306D\u3002
+OptionPaneDemo.inputresponse=\u305D\u308C\u306F\u3044\u3044\u6620\u753B\u3067\u3059\u306D\u3002
 
 OptionPaneDemo.componenttitle=\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30FB\u30C0\u30A4\u30A2\u30ED\u30B0\u306E\u4F8B
-OptionPaneDemo.componentmessage=<html>JOptionPane\u306B\u306F\u3001\u30C6\u30AD\u30B9\u30C8\u30FB\u30D5\u30A3\u30FC\u30EB\u30C9\u306A\u3069\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092<br>\u5FC5\u8981\u306A\u3060\u3051\u542B\u3081\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002</html>
+OptionPaneDemo.componentmessage=<html>JOptionPane\u306B\u306F\u3001\u30C6\u30AD\u30B9\u30C8\u30FB\u30D5\u30A3\u30FC\u30EB\u30C9\u306A\u3069\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u5FC5\u8981\u306A\u3060\u3051\u542B\u3081\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002</html>
 OptionPaneDemo.componenttextfield=\u30B3\u30F3\u30DC\u30DC\u30C3\u30AF\u30B9:
 OptionPaneDemo.component_cb1=\u9805\u76EE1
 OptionPaneDemo.component_cb2=\u9805\u76EE2
@@ -405,7 +405,7 @@
 ### ScrollPane Demo ###
 
 ScrollPaneDemo.accessible_description=JScrollPane\u30C7\u30E2
-ScrollPaneDemo.name=Scroll Pane\u30C7\u30E2
+ScrollPaneDemo.name=ScrollPane\u30C7\u30E2
 ScrollPaneDemo.tooltip=JScrollPane\u30C7\u30E2
 ScrollPaneDemo.crayons=\u305F\u304F\u3055\u3093\u306E\u30AF\u30EC\u30E8\u30F3
 ScrollPaneDemo.colheader=\u5217\u30D8\u30C3\u30C0\u30FC
@@ -427,20 +427,20 @@
 SliderDemo.plain=\u30D7\u30EC\u30FC\u30F3
 SliderDemo.a_plain_slider=\u30D7\u30EC\u30FC\u30F3\u306E\u30B9\u30E9\u30A4\u30C0
 SliderDemo.majorticks=\u5927\u76EE\u76DB
-SliderDemo.majorticksdescription=\u5927\u76EE\u76DB\u3092\u8868\u793A\u3059\u308B\u30B9\u30E9\u30A4\u30C0
-SliderDemo.ticks=\u5C0F\u76EE\u76DB\u3001Snap-to-ticks\u304A\u3088\u3073\u30E9\u30D9\u30EB
+SliderDemo.majorticksdescription=\u5927\u76EE\u76DB\u3092\u6301\u3064\u30B9\u30E9\u30A4\u30C0
+SliderDemo.ticks=\u5927\u5C0F\u76EE\u76DB\u3068\u30E9\u30D9\u30EB(SnapToTicks=true)
 SliderDemo.minorticks=\u5C0F\u76EE\u76DB
-SliderDemo.minorticksdescription=\u5927\u76EE\u76DB\u3068\u5C0F\u76EE\u76DB\u3092\u8868\u793A\u3059\u308B\u30B9\u30E9\u30A4\u30C0(\u76EE\u76DB\u30DE\u30FC\u30AF\u306B\u30B9\u30CA\u30C3\u30D7\u3059\u308B\u30B9\u30E9\u30A4\u30C0\u30FB\u30A2\u30AF\u30B7\u30E7\u30F3\u3042\u308A\u3001\u4E00\u90E8\u306E\u76EE\u76DB\u306F\u76EE\u7ACB\u3064\u30E9\u30D9\u30EB\u4ED8\u304D)
+SliderDemo.minorticksdescription=SnapToTicks=true\u3067\u5927\u76EE\u76DB\u3001\u5C0F\u76EE\u76DB\u304A\u3088\u3073\u30E9\u30D9\u30EB\u4ED8\u304D\u306E\u30B9\u30E9\u30A4\u30C0
 SliderDemo.disabled=\u7121\u52B9
-SliderDemo.disableddescription=\u7121\u52B9\u5316\u3055\u308C\u305F\u3001\u5927\u76EE\u76DB\u3068\u5C0F\u76EE\u76DB\u3092\u8868\u793A\u3059\u308B\u30B9\u30E9\u30A4\u30C0(\u64CD\u4F5C\u4E0D\u53EF)
+SliderDemo.disableddescription=\u5927\u5C0F\u306E\u76EE\u76DB\u3092\u6301\u3064\u7121\u52B9\u306A\u30B9\u30E9\u30A4\u30C0(\u64CD\u4F5C\u4E0D\u53EF)
 
 ### SplitPane Demo ###
 
 SplitPaneDemo.accessible_description=JSplitPane\u30C7\u30E2
-SplitPaneDemo.name=Split Pane\u30C7\u30E2
+SplitPaneDemo.name=SplitPane\u30C7\u30E2
 SplitPaneDemo.tooltip=JSplitPane\u30C7\u30E2
-SplitPaneDemo.earth=\u6BCD\u306A\u308B\u5730\u7403
-SplitPaneDemo.moon=\u6708\u9762\u306E\u5B87\u5B99\u98DB\u884C\u58EB
+SplitPaneDemo.earth=\u5730\u7403
+SplitPaneDemo.moon=\u5B87\u5B99\u98DB\u884C\u58EB
 SplitPaneDemo.vert_split.labelAndMnemonic=\u5782\u76F4\u5206\u5272(&V)
 SplitPaneDemo.horz_split.labelAndMnemonic=\u6C34\u5E73\u5206\u5272(&R)
 SplitPaneDemo.cont_layout.labelAndMnemonic=\u9023\u7D9A\u3057\u305F\u30EC\u30A4\u30A2\u30A6\u30C8(&C)
@@ -460,7 +460,7 @@
 TabbedPaneDemo.tooltip=JTabbedPane\u30C7\u30E2
 TabbedPaneDemo.name=TabbedPane\u30C7\u30E2
 
-TabbedPaneDemo.bounce=<html><font color=blue><bold><center>Bouncing Babies!</center></bold></font></html>
+TabbedPaneDemo.bounce=<html><font color=blue><bold><center>\u5143\u6C17\u306A\u5B50\u4F9B\u9054\u3002</center></bold></font></html>
 TabbedPaneDemo.stephen=\u30B9\u30C6\u30A3\u30FC\u30F4\u30F3
 TabbedPaneDemo.david=\u30C7\u30A4\u30F4\u30A3\u30C3\u30C9
 TabbedPaneDemo.matthew=\u30DE\u30B7\u30E5\u30FC
@@ -533,7 +533,7 @@
 TableDemo.2001=2001\u5E74\u5B87\u5B99\u306E\u65C5
 TableDemo.buckaroo=\u30D0\u30AB\u30EB\u30FC\u30FB\u30D0\u30F3\u30B6\u30A4\u306E8\u6B21\u5143\u30AE\u30E3\u30E9\u30AF\u30B7\u30FC
 TableDemo.firstsight=\u3042\u306A\u305F\u304C\u898B\u3048\u306A\u304F\u3066\u3082
-TableDemo.airplane=\u30D5\u30E9\u30A4\u30F3\u30B0\u30FB\u30CF\u30A4(\u5168\u30B7\u30EA\u30FC\u30BA)
+TableDemo.airplane=\u30D5\u30E9\u30A4\u30F3\u30B0\u30FB\u30CF\u30A4(\u30B7\u30EA\u30FC\u30BA)
 TableDemo.aliens=\u30A8\u30A4\u30EA\u30A2\u30F3
 TableDemo.bicycle=\u81EA\u8EE2\u8ECA\u6CE5\u68D2
 TableDemo.bladerunner=\u30D6\u30EC\u30FC\u30C9\u30FB\u30E9\u30F3\u30CA\u30FC(\u30C7\u30A3\u30EC\u30AF\u30BF\u30FC\u30BA\u30FB\u30AB\u30C3\u30C8)
@@ -541,18 +541,18 @@
 TableDemo.brazil=\u672A\u6765\u4E16\u7D00\u30D6\u30E9\u30B8\u30EB
 TableDemo.bugs=\u30D0\u30B0\u30BA\u30FB\u30E9\u30A4\u30D5
 TableDemo.city=\u30ED\u30B9\u30C8\u30FB\u30C1\u30EB\u30C9\u30EC\u30F3
-TableDemo.chusingura=\u5FE0\u81E3\u8535(1962)
+TableDemo.chusingura=\u5FE0\u81E3\u8535
 TableDemo.clock=\u6642\u8A08\u4ED5\u639B\u3051\u306E\u30AA\u30EC\u30F3\u30B8
 TableDemo.curse=\u602A\u5947\u30DF\u30A4\u30E9\u7537
 TableDemo.dasboot=U\u30DC\u30FC\u30C8
 TableDemo.dazed=\u30D0\u30C3\u30C9\u30FB\u30C1\u30E5\u30FC\u30CB\u30F3\u30B0
 TableDemo.defending=\u3042\u306A\u305F\u306E\u6B7B\u5F8C\u306B\u3054\u7528\u5FC3
-TableDemo.eraserhead=\u30A4\u30EC\u30A4\u30B6\u30FC\u30D8\u30C3\u30C9
+TableDemo.eraserhead=\u30A4\u30EC\u30A4\u30B6\u30FB\u30D8\u30C3\u30C9
 TableDemo.fifthelement=\u30D5\u30A3\u30D5\u30B9\u30FB\u30A8\u30EC\u30E1\u30F3\u30C8
 TableDemo.goodfellas=\u30B0\u30C3\u30C9\u30FB\u30D5\u30A7\u30ED\u30FC\u30BA
 TableDemo.harold=\u30CF\u30ED\u30EB\u30C9\u3068\u30E2\u30FC\u30C9
 TableDemo.joyluck=\u30B8\u30E7\u30A4\u30FB\u30E9\u30C3\u30AF\u30FB\u30AF\u30E9\u30D6
-TableDemo.jules=\u7A81\u7136\u708E\u306E\u3054\u3068\u304F
+TableDemo.jules=\u7A81\u7136\u708E\u306E\u3054\u3068\u304F\u30B8\u30E5\u30FC\u30EB\u3068\u30B8\u30E0
 TableDemo.ladyvanishes=\u30EC\u30C7\u30A3\u30FB\u30D0\u30CB\u30C3\u30B7\u30E5/\u6697\u53F7\u3092\u6B4C\u3046\u5973
 TableDemo.mohicans=\u30E9\u30B9\u30C8\u30FB\u30AA\u30D6\u30FB\u30E2\u30D2\u30AB\u30F3
 TableDemo.lonestar=\u771F\u5B9F\u306E\u56C1\u304D
@@ -581,7 +581,7 @@
 TableDemo.corn=\u3068\u3046\u3082\u308D\u3053\u3057
 TableDemo.grapes=\u3076\u3069\u3046
 TableDemo.grapefruit=\u30B0\u30EC\u30FC\u30D7\u30D5\u30EB\u30FC\u30C4
-TableDemo.kiwi=\u30AD\u30A6\u30A3\u30FB\u30D5\u30EB\u30FC\u30C4
+TableDemo.kiwi=\u30AD\u30A6\u30A4\u30FB\u30D5\u30EB\u30FC\u30C4
 TableDemo.onion=\u7389\u306D\u304E
 TableDemo.pear=\u6D0B\u306A\u3057
 TableDemo.peach=\u6843
@@ -624,15 +624,15 @@
 ### ToolTip Demo ###
 
 ToolTipDemo.accessible_description=ToolTip\u306F\u3001\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306B\u3064\u3044\u3066\u306E\u7C21\u5358\u306A\u8AAC\u660E\u3092\u8868\u793A\u3057\u307E\u3059\u3002
-ToolTipDemo.accessible_cow=\u3053\u308C\u306F\u96CC\u725B\u3067\u3059\u3002
+ToolTipDemo.accessible_cow=\u3053\u308C\u306F\u4E73\u725B\u3067\u3059
 ToolTipDemo.tooltip=ToolTip\u30C7\u30E2
 ToolTipDemo.name=ToolTip\u30C7\u30E2
-ToolTipDemo.bessie=\u96CC\u725B\u306E\u30D9\u30C3\u30B7\u30FC
-ToolTipDemo.cow=\u96CC\u725B\u3002
-ToolTipDemo.got_milk=\u725B\u4E73\u3042\u308B?
-ToolTipDemo.tail=\u3057\u3063\u307D\u3002
+ToolTipDemo.bessie=\u96CC\u725B\u306E\u30A8\u30EA\u30B6\u30D9\u30B9
+ToolTipDemo.cow=\u4E73\u725B
+ToolTipDemo.got_milk=\u725B\u4E73\u98F2\u3093\u3060?
+ToolTipDemo.tail=\u3057\u3063\u307D
 ToolTipDemo.moo=\u30E2\u30A9\u30A9\u30A9\u30A9!
-ToolTipDemo.tooltip_features=<html>\u3082\u3057\u3084\u3042\u306A\u305F\u306F\u3001\u30C4\u30FC\u30EB\u30FB\u30C1\u30C3\u30D7\u306F\u300C1\u884C\u306E\u30D7\u30EC\u30FC\u30F3\u30FB\u30C6\u30AD\u30B9\u30C8\u300D\u3057\u304B<p>\u8868\u793A\u3067\u304D\u306A\u3044\u9000\u5C48\u306A\u3082\u306E\u3060\u306A\u3093\u3066\u601D\u3063\u3066\u3084\u3057\u307E\u305B\u3093\u304B\u3002<p>\u3060\u3068\u3057\u305F\u3089\u3001\u79C1\u305F\u3061<font color=blue size=+2>Swing!</font>\u30C1\u30FC\u30E0\u304C\u305D\u306E\u8AA4\u89E3\u3092\u89E3\u3044\u3066\u3042\u3052\u307E\u3057\u3087\u3046\u3002<p>Swing\u306EToolTip\u306F\u3001HTML\u3092\u4F7F\u7528\u3057\u3066<ul><li>List\u3092\u6301\u3063\u305F\u308A\u3001<li><b>\u592A\u5B57</b>\u306B\u3057\u305F\u308A\u3001<li><em>\u5F37\u8ABF</em>\u306B\u3057\u305F\u308A\u3001<li>\u6587\u5B57\u306B<font color=red>\u8272</font>\u3092\u4ED8\u3051\u305F\u308A\u3001<li><font size=+3>\u30B5\u30A4\u30BA</font>\u3092\u5909\u3048\u305F\u308A\u3001<li><font face=AvantGarde>\u30D5\u30A9\u30F3\u30C8</font>\u3092\u5909\u3048\u305F\u308A\u3001</ul>\u305D\u3046\u305D\u3046\u3001\u3082\u3061\u308D\u3093\u8907\u6570\u884C\u306B\u3059\u308B\u3053\u3068\u3082\u3067\u304D\u3061\u3083\u3046\u306E\u3067\u3059\u3002\u306D\u3063\u3002</html>
+ToolTipDemo.tooltip_features=<html>\u3082\u3057\u3084\u3042\u306A\u305F\u306F\u3001\u30C4\u30FC\u30EB\u30FB\u30C1\u30C3\u30D7\u306F\u300C1\u884C\u306E\u30D7\u30EC\u30A4\u30F3\u30FB\u30C6\u30AD\u30B9\u30C8\u300D\u3057\u304B<p>\u8868\u793A\u3067\u304D\u306A\u3044\u9000\u5C48\u306A\u3082\u306E\u3060\u306A\u3093\u3066\u601D\u3063\u3066\u3084\u3057\u307E\u305B\u3093\u304B\u3002<p>\u3060\u3068\u3057\u305F\u3089\u3001\u79C1\u305F\u3061<font color=blue size=+2>Swing!</font>\u30C1\u30FC\u30E0\u304C\u305D\u306E\u8AA4\u89E3\u3092\u89E3\u3044\u3066\u3042\u3052\u307E\u3057\u3087\u3046\u3002<p>Swing\u306EToolTip\u306F\u3001HTML\u3092\u4F7F\u7528\u3057\u3066<ul><li>List\u3092\u6301\u3063\u305F\u308A\u3001<li><b>\u592A\u5B57</b>\u306B\u3057\u305F\u308A\u3001<li><em>\u30A4\u30BF\u30EA\u30C3\u30AF</em>\u306B\u3057\u305F\u308A\u3001<li>\u6587\u5B57\u306B<font color=red>\u8272</font>\u3092\u4ED8\u3051\u305F\u308A\u3001<li><font size=+3>\u30B5\u30A4\u30BA</font>\u3092\u5909\u3048\u305F\u308A\u3001<li><font face=AvantGarde>\u30D5\u30A9\u30F3\u30C8</font>\u3092\u5909\u3048\u305F\u308A\u3001</ul>\u305D\u3046\u305D\u3046\u3001\u3082\u3061\u308D\u3093\u8907\u6570\u884C\u306B\u3059\u308B\u3053\u3068\u3082\u3067\u304D\u3061\u3083\u3046\u306E\u3067\u3059\u3002\u306D\u3063\u3002</html>
 
 
 ### Tree Demo ###
--- a/src/demo/share/jfc/SwingSet2/resources/swingset_zh_CN.properties	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/demo/share/jfc/SwingSet2/resources/swingset_zh_CN.properties	Fri Aug 03 12:52:58 2018 -0700
@@ -319,9 +319,9 @@
 InternalFrameDemo.resizable.labelAndMnemonic=\u53EF\u8C03\u6574\u5927\u5C0F
 InternalFrameDemo.iconifiable.labelAndMnemonic=\u53EF\u56FE\u6807\u5316
 InternalFrameDemo.maximizable.labelAndMnemonic=\u53EF\u6700\u5927\u5316
-InternalFrameDemo.toast=Cheers
-InternalFrameDemo.duke=Your Grace
-InternalFrameDemo.duchess=Duchess
+InternalFrameDemo.toast=\u5E72\u676F
+InternalFrameDemo.duke=\u9601\u4E0B\uFF01
+InternalFrameDemo.duchess=\u516C\u7235\u592B\u4EBA
 InternalFrameDemo.cab=\u8C01\u9700\u8981\u51FA\u79DF\u8F66?
 
 
--- a/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -687,8 +687,11 @@
           __ set_info("fast new_instance init check", dont_gc_arguments);
         }
 
+        // If TLAB is disabled, see if there is support for inlining contiguous
+        // allocations.
+        // Otherwise, just go to the slow path.
         if ((id == fast_new_instance_id || id == fast_new_instance_init_check_id) &&
-            UseTLAB && Universe::heap()->supports_inline_contig_alloc()) {
+            !UseTLAB && Universe::heap()->supports_inline_contig_alloc()) {
           Label slow_path;
           Register obj_size = r2;
           Register t1       = r19;
@@ -799,7 +802,10 @@
         }
 #endif // ASSERT
 
-        if (UseTLAB && Universe::heap()->supports_inline_contig_alloc()) {
+        // If TLAB is disabled, see if there is support for inlining contiguous
+        // allocations.
+        // Otherwise, just go to the slow path.
+        if (!UseTLAB && Universe::heap()->supports_inline_contig_alloc()) {
           Register arr_size = r4;
           Register t1       = r2;
           Register t2       = r5;
--- a/src/hotspot/cpu/aarch64/frame_aarch64.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/cpu/aarch64/frame_aarch64.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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.
  *
@@ -539,7 +539,7 @@
   Method* m = *interpreter_frame_method_addr();
 
   // validate the method we'd find in this potential sender
-  if (!m->is_valid_method()) return false;
+  if (!Method::is_valid_method(m)) return false;
 
   // stack frames shouldn't be much larger than max_stack elements
   // this test requires the use of unextended_sp which is the sp as seen by
--- a/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -1778,8 +1778,12 @@
 #else
   // FIXME: membar_release
   __ membar(MacroAssembler::Membar_mask_bits(MacroAssembler::StoreStore | MacroAssembler::LoadStore), Rtemp);
+  Register addr = op->addr()->is_register() ?
+    op->addr()->as_pointer_register() :
+    op->addr()->as_address_ptr()->base()->as_pointer_register();
+  assert(op->addr()->is_register() || op->addr()->as_address_ptr()->disp() == 0, "unexpected disp");
+  assert(op->addr()->is_register() || op->addr()->as_address_ptr()->index() == LIR_OprDesc::illegalOpr(), "unexpected index");
   if (op->code() == lir_cas_int || op->code() == lir_cas_obj) {
-    Register addr = op->addr()->as_register();
     Register cmpval = op->cmp_value()->as_register();
     Register newval = op->new_value()->as_register();
     Register dest = op->result_opr()->as_register();
@@ -1790,7 +1794,6 @@
     __ mov(dest, 0, ne);
   } else if (op->code() == lir_cas_long) {
     assert(VM_Version::supports_cx8(), "wrong machine");
-    Register addr = op->addr()->as_pointer_register();
     Register cmp_value_lo = op->cmp_value()->as_register_lo();
     Register cmp_value_hi = op->cmp_value()->as_register_hi();
     Register new_value_lo = op->new_value()->as_register_lo();
@@ -3468,7 +3471,12 @@
 }
 
 void LIR_Assembler::atomic_op(LIR_Code code, LIR_Opr src, LIR_Opr data, LIR_Opr dest, LIR_Opr tmp) {
+#ifdef AARCH64
   Register ptr = src->as_pointer_register();
+#else
+  assert(src->is_address(), "sanity");
+  Address addr = as_Address(src->as_address_ptr());
+#endif
 
   if (code == lir_xchg) {
 #ifdef AARCH64
@@ -3493,15 +3501,15 @@
 #ifdef AARCH64
     __ ldaxr_w(dst, ptr);
 #else
-    __ ldrex(dst, Address(ptr));
+    __ ldrex(dst, addr);
 #endif
     if (code == lir_xadd) {
       Register tmp_reg = tmp->as_register();
       if (data->is_constant()) {
-        assert_different_registers(dst, ptr, tmp_reg);
+        assert_different_registers(dst, tmp_reg);
         __ add_32(tmp_reg, dst, data->as_constant_ptr()->as_jint());
       } else {
-        assert_different_registers(dst, ptr, tmp_reg, data->as_register());
+        assert_different_registers(dst, tmp_reg, data->as_register());
         __ add_32(tmp_reg, dst, data->as_register());
       }
       new_val = tmp_reg;
@@ -3511,12 +3519,12 @@
       } else {
         new_val = data->as_register();
       }
-      assert_different_registers(dst, ptr, new_val);
+      assert_different_registers(dst, new_val);
     }
 #ifdef AARCH64
     __ stlxr_w(Rtemp, new_val, ptr);
 #else
-    __ strex(Rtemp, new_val, Address(ptr));
+    __ strex(Rtemp, new_val, addr);
 #endif // AARCH64
 
 #ifdef AARCH64
@@ -3551,7 +3559,7 @@
     assert((dst_lo->encoding() & 0x1) == 0, "misaligned register pair");
 
     __ bind(retry);
-    __ ldrexd(dst_lo, Address(ptr));
+    __ ldrexd(dst_lo, addr);
     if (code == lir_xadd) {
       Register tmp_lo = tmp->as_register_lo();
       Register tmp_hi = tmp->as_register_hi();
@@ -3562,7 +3570,7 @@
       if (data->is_constant()) {
         jlong c = data->as_constant_ptr()->as_jlong();
         assert((jlong)((jint)c) == c, "overflow");
-        assert_different_registers(dst_lo, dst_hi, ptr, tmp_lo, tmp_hi);
+        assert_different_registers(dst_lo, dst_hi, tmp_lo, tmp_hi);
         __ adds(tmp_lo, dst_lo, (jint)c);
         __ adc(tmp_hi, dst_hi, 0);
       } else {
@@ -3570,18 +3578,18 @@
         Register new_val_hi = data->as_register_hi();
         __ adds(tmp_lo, dst_lo, new_val_lo);
         __ adc(tmp_hi, dst_hi, new_val_hi);
-        assert_different_registers(dst_lo, dst_hi, ptr, tmp_lo, tmp_hi, new_val_lo, new_val_hi);
+        assert_different_registers(dst_lo, dst_hi, tmp_lo, tmp_hi, new_val_lo, new_val_hi);
       }
       new_val_lo = tmp_lo;
     } else {
       new_val_lo = data->as_register_lo();
       Register new_val_hi = data->as_register_hi();
 
-      assert_different_registers(dst_lo, dst_hi, ptr, new_val_lo, new_val_hi);
+      assert_different_registers(dst_lo, dst_hi, new_val_lo, new_val_hi);
       assert(new_val_hi->encoding() == new_val_lo->encoding() + 1, "non aligned register pair");
       assert((new_val_lo->encoding() & 0x1) == 0, "misaligned register pair");
     }
-    __ strexd(Rtemp, new_val_lo, Address(ptr));
+    __ strexd(Rtemp, new_val_lo, addr);
 #endif // AARCH64
   } else {
     ShouldNotReachHere();
--- a/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -546,9 +546,10 @@
         const Register result = R0;
         const Register klass  = R1;
 
-        if (UseTLAB && Universe::heap()->supports_inline_contig_alloc() && id != new_instance_id) {
-          // We come here when TLAB allocation failed.
-          // In this case we try to allocate directly from eden.
+        // If TLAB is disabled, see if there is support for inlining contiguous
+        // allocations.
+        // Otherwise, just go to the slow path.
+        if (!UseTLAB && Universe::heap()->supports_inline_contig_alloc() && id != new_instance_id) {
           Label slow_case, slow_case_no_pop;
 
           // Make sure the class is fully initialized
@@ -616,9 +617,10 @@
         const Register klass  = R1;
         const Register length = R2;
 
-        if (UseTLAB && Universe::heap()->supports_inline_contig_alloc()) {
-          // We come here when TLAB allocation failed.
-          // In this case we try to allocate directly from eden.
+        // If TLAB is disabled, see if there is support for inlining contiguous
+        // allocations.
+        // Otherwise, just go to the slow path.
+        if (!UseTLAB && Universe::heap()->supports_inline_contig_alloc()) {
           Label slow_case, slow_case_no_pop;
 
 #ifdef AARCH64
--- a/src/hotspot/cpu/arm/frame_arm.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/cpu/arm/frame_arm.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -500,7 +500,7 @@
   Method* m = *interpreter_frame_method_addr();
 
   // validate the method we'd find in this potential sender
-  if (!m->is_valid_method()) return false;
+  if (!Method::is_valid_method(m)) return false;
 
   // stack frames shouldn't be much larger than max_stack elements
 
--- a/src/hotspot/cpu/arm/sharedRuntime_arm.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/cpu/arm/sharedRuntime_arm.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -513,6 +513,7 @@
     case T_ARRAY:
     case T_OBJECT:
     case T_ADDRESS:
+    case T_METADATA:
 #ifndef __ABI_HARD__
     case T_FLOAT:
 #endif // !__ABI_HARD__
--- a/src/hotspot/cpu/ppc/frame_ppc.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/cpu/ppc/frame_ppc.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -49,14 +49,134 @@
 
 bool frame::safe_for_sender(JavaThread *thread) {
   bool safe = false;
-  address   cursp = (address)sp();
-  address   curfp = (address)fp();
-  if ((cursp != NULL && curfp != NULL &&
-      (cursp <= thread->stack_base() && cursp >= thread->stack_base() - thread->stack_size())) &&
-      (curfp <= thread->stack_base() && curfp >= thread->stack_base() - thread->stack_size())) {
-      safe = true;
+  address sp = (address)_sp;
+  address fp = (address)_fp;
+  address unextended_sp = (address)_unextended_sp;
+
+  // Consider stack guards when trying to determine "safe" stack pointers
+  static size_t stack_guard_size = os::uses_stack_guard_pages() ?
+    JavaThread::stack_red_zone_size() + JavaThread::stack_yellow_reserved_zone_size() : 0;
+  size_t usable_stack_size = thread->stack_size() - stack_guard_size;
+
+  // sp must be within the usable part of the stack (not in guards)
+  bool sp_safe = (sp < thread->stack_base()) &&
+                 (sp >= thread->stack_base() - usable_stack_size);
+
+
+  if (!sp_safe) {
+    return false;
   }
-  return safe;
+
+  // Unextended sp must be within the stack and above or equal sp
+  bool unextended_sp_safe = (unextended_sp < thread->stack_base()) && (unextended_sp >= sp);
+
+  if (!unextended_sp_safe) {
+    return false;
+  }
+
+  // An fp must be within the stack and above (but not equal) sp.
+  bool fp_safe = (fp <= thread->stack_base()) &&  (fp > sp);
+  // an interpreter fp must be within the stack and above (but not equal) sp
+  bool fp_interp_safe = (fp <= thread->stack_base()) &&  (fp > sp) &&
+    ((fp - sp) >= (ijava_state_size + top_ijava_frame_abi_size));
+
+  // We know sp/unextended_sp are safe, only fp is questionable here
+
+  // If the current frame is known to the code cache then we can attempt to
+  // to construct the sender and do some validation of it. This goes a long way
+  // toward eliminating issues when we get in frame construction code
+
+  if (_cb != NULL ){
+    // Entry frame checks
+    if (is_entry_frame()) {
+      // An entry frame must have a valid fp.
+      return fp_safe && is_entry_frame_valid(thread);
+    }
+
+    // Now check if the frame is complete and the test is
+    // reliable. Unfortunately we can only check frame completeness for
+    // runtime stubs and nmethods. Other generic buffer blobs are more
+    // problematic so we just assume they are OK. Adapter blobs never have a
+    // complete frame and are never OK
+    if (!_cb->is_frame_complete_at(_pc)) {
+      if (_cb->is_compiled() || _cb->is_adapter_blob() || _cb->is_runtime_stub()) {
+        return false;
+      }
+    }
+
+    // Could just be some random pointer within the codeBlob.
+    if (!_cb->code_contains(_pc)) {
+      return false;
+    }
+
+    if (is_interpreted_frame() && !fp_interp_safe) {
+      return false;
+    }
+
+    abi_minframe* sender_abi = (abi_minframe*) fp;
+    intptr_t* sender_sp = (intptr_t*) fp;
+    address   sender_pc = (address) sender_abi->lr;;
+
+    // We must always be able to find a recognizable pc.
+    CodeBlob* sender_blob = CodeCache::find_blob_unsafe(sender_pc);
+    if (sender_blob == NULL) {
+      return false;
+    }
+
+    // Could be a zombie method
+    if (sender_blob->is_zombie() || sender_blob->is_unloaded()) {
+      return false;
+    }
+
+    // It should be safe to construct the sender though it might not be valid.
+
+    frame sender(sender_sp, sender_pc);
+
+    // Do we have a valid fp?
+    address sender_fp = (address) sender.fp();
+
+    // sender_fp must be within the stack and above (but not
+    // equal) current frame's fp.
+    if (sender_fp > thread->stack_base() || sender_fp <= fp) {
+        return false;
+    }
+
+    // If the potential sender is the interpreter then we can do some more checking.
+    if (Interpreter::contains(sender_pc)) {
+      return sender.is_interpreted_frame_valid(thread);
+    }
+
+    // Could just be some random pointer within the codeBlob.
+    if (!sender.cb()->code_contains(sender_pc)) {
+      return false;
+    }
+
+    // We should never be able to see an adapter if the current frame is something from code cache.
+    if (sender_blob->is_adapter_blob()) {
+      return false;
+    }
+
+    if (sender.is_entry_frame()) {
+      return sender.is_entry_frame_valid(thread);
+    }
+
+    // Frame size is always greater than zero. If the sender frame size is zero or less,
+    // something is really weird and we better give up.
+    if (sender_blob->frame_size() <= 0) {
+      return false;
+    }
+
+    return true;
+  }
+
+  // Must be native-compiled frame. Since sender will try and use fp to find
+  // linkages it must be safe
+
+  if (!fp_safe) {
+    return false;
+  }
+
+  return true;
 }
 
 bool frame::is_interpreted_frame() const  {
--- a/src/hotspot/cpu/sparc/c1_Runtime1_sparc.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/cpu/sparc/c1_Runtime1_sparc.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -407,8 +407,11 @@
           __ set_info("fast new_instance init check", dont_gc_arguments);
         }
 
+        // If TLAB is disabled, see if there is support for inlining contiguous
+        // allocations.
+        // Otherwise, just go to the slow path.
         if ((id == fast_new_instance_id || id == fast_new_instance_init_check_id) &&
-            UseTLAB && Universe::heap()->supports_inline_contig_alloc()) {
+            !UseTLAB && Universe::heap()->supports_inline_contig_alloc()) {
           Label slow_path;
           Register G1_obj_size = G1;
           Register G3_t1 = G3;
--- a/src/hotspot/cpu/sparc/frame_sparc.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/cpu/sparc/frame_sparc.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -648,7 +648,7 @@
   Method* m = *interpreter_frame_method_addr();
 
   // validate the method we'd find in this potential sender
-  if (!m->is_valid_method()) return false;
+  if (!Method::is_valid_method(m)) return false;
 
   // stack frames shouldn't be much larger than max_stack elements
 
--- a/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -1013,7 +1013,10 @@
           __ set_info("fast new_instance init check", dont_gc_arguments);
         }
 
-        if ((id == fast_new_instance_id || id == fast_new_instance_init_check_id) && UseTLAB
+        // If TLAB is disabled, see if there is support for inlining contiguous
+        // allocations.
+        // Otherwise, just go to the slow path.
+        if ((id == fast_new_instance_id || id == fast_new_instance_init_check_id) && !UseTLAB
             && Universe::heap()->supports_inline_contig_alloc()) {
           Label slow_path;
           Register obj_size = rcx;
@@ -1046,13 +1049,9 @@
           }
 #endif // ASSERT
 
-          // if we got here then the TLAB allocation failed, so try
-          // refilling the TLAB or allocating directly from eden.
-          Label retry_tlab, try_eden;
           const Register thread = NOT_LP64(rdi) LP64_ONLY(r15_thread);
           NOT_LP64(__ get_thread(thread));
 
-          __ bind(try_eden);
           // get the instance size (size is postive so movl is fine for 64bit)
           __ movl(obj_size, Address(klass, Klass::layout_helper_offset()));
 
@@ -1133,9 +1132,10 @@
         }
 #endif // ASSERT
 
-        // If we got here, the TLAB allocation failed, so try allocating from
-        // eden if inline contiguous allocations are supported.
-        if (UseTLAB && Universe::heap()->supports_inline_contig_alloc()) {
+        // If TLAB is disabled, see if there is support for inlining contiguous
+        // allocations.
+        // Otherwise, just go to the slow path.
+        if (!UseTLAB && Universe::heap()->supports_inline_contig_alloc()) {
           Register arr_size = rsi;
           Register t1       = rcx;  // must be rcx for use as shift count
           Register t2       = rdi;
--- a/src/hotspot/cpu/x86/frame_x86.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/cpu/x86/frame_x86.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -526,7 +526,7 @@
   Method* m = *interpreter_frame_method_addr();
 
   // validate the method we'd find in this potential sender
-  if (!m->is_valid_method()) return false;
+  if (!Method::is_valid_method(m)) return false;
 
   // stack frames shouldn't be much larger than max_stack elements
   // this test requires the use the unextended_sp which is the sp as seen by
--- a/src/hotspot/cpu/x86/interp_masm_x86.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/cpu/x86/interp_masm_x86.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -1963,7 +1963,9 @@
   incrementl(scratch, increment);
   movl(counter_addr, scratch);
   andl(scratch, mask);
-  jcc(cond, *where);
+  if (where != NULL) {
+    jcc(cond, *where);
+  }
 }
 
 void InterpreterMacroAssembler::notify_method_entry() {
--- a/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -32,6 +32,7 @@
 #include "code/icBuffer.hpp"
 #include "code/nativeInst.hpp"
 #include "code/vtableStubs.hpp"
+#include "gc/shared/collectedHeap.hpp"
 #include "gc/shared/gcLocker.hpp"
 #include "interpreter/interpreter.hpp"
 #include "logging/log.hpp"
@@ -1434,6 +1435,64 @@
   }
 }
 
+// Pin object, return pinned object or null in rax
+static void gen_pin_object(MacroAssembler* masm,
+                           VMRegPair reg) {
+  __ block_comment("gen_pin_object {");
+
+  // rax always contains oop, either incoming or
+  // pinned.
+  Register tmp_reg = rax;
+
+  Label is_null;
+  VMRegPair tmp;
+  VMRegPair in_reg = reg;
+
+  tmp.set_ptr(tmp_reg->as_VMReg());
+  if (reg.first()->is_stack()) {
+    // Load the arg up from the stack
+    move_ptr(masm, reg, tmp);
+    reg = tmp;
+  } else {
+    __ movptr(rax, reg.first()->as_Register());
+  }
+  __ testptr(reg.first()->as_Register(), reg.first()->as_Register());
+  __ jccb(Assembler::equal, is_null);
+
+  if (reg.first()->as_Register() != c_rarg1) {
+    __ movptr(c_rarg1, reg.first()->as_Register());
+  }
+
+  __ call_VM_leaf(
+    CAST_FROM_FN_PTR(address, SharedRuntime::pin_object),
+    r15_thread, c_rarg1);
+
+  __ bind(is_null);
+  __ block_comment("} gen_pin_object");
+}
+
+// Unpin object
+static void gen_unpin_object(MacroAssembler* masm,
+                             VMRegPair reg) {
+  __ block_comment("gen_unpin_object {");
+  Label is_null;
+
+  if (reg.first()->is_stack()) {
+    __ movptr(c_rarg1, Address(rbp, reg2offset_in(reg.first())));
+  } else if (reg.first()->as_Register() != c_rarg1) {
+    __ movptr(c_rarg1, reg.first()->as_Register());
+  }
+
+  __ testptr(c_rarg1, c_rarg1);
+  __ jccb(Assembler::equal, is_null);
+
+  __ call_VM_leaf(
+    CAST_FROM_FN_PTR(address, SharedRuntime::unpin_object),
+    r15_thread, c_rarg1);
+
+  __ bind(is_null);
+  __ block_comment("} gen_unpin_object");
+}
 
 // Check GCLocker::needs_gc and enter the runtime if it's true.  This
 // keeps a new JNI critical region from starting until a GC has been
@@ -2129,7 +2188,7 @@
 
   const Register oop_handle_reg = r14;
 
-  if (is_critical_native) {
+  if (is_critical_native && !Universe::heap()->supports_object_pinning()) {
     check_needs_gc_for_critical_native(masm, stack_slots, total_c_args, total_in_args,
                                        oop_handle_offset, oop_maps, in_regs, in_sig_bt);
   }
@@ -2186,6 +2245,11 @@
   // the incoming and outgoing registers are offset upwards and for
   // critical natives they are offset down.
   GrowableArray<int> arg_order(2 * total_in_args);
+  // Inbound arguments that need to be pinned for critical natives
+  GrowableArray<int> pinned_args(total_in_args);
+  // Current stack slot for storing register based array argument
+  int pinned_slot = oop_handle_offset;
+
   VMRegPair tmp_vmreg;
   tmp_vmreg.set2(rbx->as_VMReg());
 
@@ -2233,6 +2297,23 @@
     switch (in_sig_bt[i]) {
       case T_ARRAY:
         if (is_critical_native) {
+          // pin before unpack
+          if (Universe::heap()->supports_object_pinning()) {
+            save_args(masm, total_c_args, 0, out_regs);
+            gen_pin_object(masm, in_regs[i]);
+            pinned_args.append(i);
+            restore_args(masm, total_c_args, 0, out_regs);
+
+            // rax has pinned array
+            VMRegPair result_reg;
+            result_reg.set_ptr(rax->as_VMReg());
+            move_ptr(masm, result_reg, in_regs[i]);
+            if (!in_regs[i].first()->is_stack()) {
+              assert(pinned_slot <= stack_slots, "overflow");
+              move_ptr(masm, result_reg, VMRegImpl::stack2reg(pinned_slot));
+              pinned_slot += VMRegImpl::slots_per_word;
+            }
+          }
           unpack_array_argument(masm, in_regs[i], in_elem_bt[i], out_regs[c_arg + 1], out_regs[c_arg]);
           c_arg++;
 #ifdef ASSERT
@@ -2449,6 +2530,24 @@
   default       : ShouldNotReachHere();
   }
 
+  // unpin pinned arguments
+  pinned_slot = oop_handle_offset;
+  if (pinned_args.length() > 0) {
+    // save return value that may be overwritten otherwise.
+    save_native_result(masm, ret_type, stack_slots);
+    for (int index = 0; index < pinned_args.length(); index ++) {
+      int i = pinned_args.at(index);
+      assert(pinned_slot <= stack_slots, "overflow");
+      if (!in_regs[i].first()->is_stack()) {
+        int offset = pinned_slot * VMRegImpl::stack_slot_size;
+        __ movq(in_regs[i].first()->as_Register(), Address(rsp, offset));
+        pinned_slot += VMRegImpl::slots_per_word;
+      }
+      gen_unpin_object(masm, in_regs[i]);
+    }
+    restore_native_result(masm, ret_type, stack_slots);
+  }
+
   // Switch thread to "native transition" state before reading the synchronization state.
   // This additional state is necessary because reading and testing the synchronization
   // state is not atomic w.r.t. GC, as this scenario demonstrates:
--- a/src/hotspot/cpu/x86/templateTable_x86.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/cpu/x86/templateTable_x86.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -2227,8 +2227,8 @@
         const Address mdo_backedge_counter(rbx, in_bytes(MethodData::backedge_counter_offset()) +
                                            in_bytes(InvocationCounter::counter_offset()));
         const Address mask(rbx, in_bytes(MethodData::backedge_mask_offset()));
-        __ increment_mask_and_jump(mdo_backedge_counter, increment, mask,
-                                   rax, false, Assembler::zero, &backedge_counter_overflow);
+        __ increment_mask_and_jump(mdo_backedge_counter, increment, mask, rax, false, Assembler::zero,
+                                   UseOnStackReplacement ? &backedge_counter_overflow : NULL);
         __ jmp(dispatch);
       }
       __ bind(no_mdo);
@@ -2236,7 +2236,8 @@
       __ movptr(rcx, Address(rcx, Method::method_counters_offset()));
       const Address mask(rcx, in_bytes(MethodCounters::backedge_mask_offset()));
       __ increment_mask_and_jump(Address(rcx, be_offset), increment, mask,
-                                 rax, false, Assembler::zero, &backedge_counter_overflow);
+                                 rax, false, Assembler::zero,
+                                 UseOnStackReplacement ? &backedge_counter_overflow : NULL);
     } else { // not TieredCompilation
       // increment counter
       __ movptr(rcx, Address(rcx, Method::method_counters_offset()));
--- a/src/hotspot/os/linux/os_linux.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/os/linux/os_linux.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -2826,9 +2826,10 @@
 
   // Map all node ids in which it is possible to allocate memory. Also nodes are
   // not always consecutively available, i.e. available from 0 to the highest
-  // node number.
+  // node number. If the nodes have been bound explicitly using numactl membind,
+  // then allocate memory from those nodes only.
   for (int node = 0; node <= highest_node_number; node++) {
-    if (Linux::isnode_in_configured_nodes((unsigned int)node)) {
+    if (Linux::isnode_in_bound_nodes((unsigned int)node)) {
       ids[i++] = node;
     }
   }
@@ -2929,6 +2930,8 @@
                                                libnuma_dlsym(handle, "numa_bitmask_isbitset")));
       set_numa_distance(CAST_TO_FN_PTR(numa_distance_func_t,
                                        libnuma_dlsym(handle, "numa_distance")));
+      set_numa_get_membind(CAST_TO_FN_PTR(numa_get_membind_func_t,
+                                          libnuma_v2_dlsym(handle, "numa_get_membind")));
 
       if (numa_available() != -1) {
         set_numa_all_nodes((unsigned long*)libnuma_dlsym(handle, "numa_all_nodes"));
@@ -2993,17 +2996,23 @@
   unsigned long *cpu_map = NEW_C_HEAP_ARRAY(unsigned long, cpu_map_size, mtInternal);
   for (size_t i = 0; i < node_num; i++) {
     // Check if node is configured (not a memory-less node). If it is not, find
-    // the closest configured node.
-    if (!isnode_in_configured_nodes(nindex_to_node()->at(i))) {
+    // the closest configured node. Check also if node is bound, i.e. it's allowed
+    // to allocate memory from the node. If it's not allowed, map cpus in that node
+    // to the closest node from which memory allocation is allowed.
+    if (!isnode_in_configured_nodes(nindex_to_node()->at(i)) ||
+        !isnode_in_bound_nodes(nindex_to_node()->at(i))) {
       closest_distance = INT_MAX;
       // Check distance from all remaining nodes in the system. Ignore distance
-      // from itself and from another non-configured node.
+      // from itself, from another non-configured node, and from another non-bound
+      // node.
       for (size_t m = 0; m < node_num; m++) {
-        if (m != i && isnode_in_configured_nodes(nindex_to_node()->at(m))) {
+        if (m != i &&
+            isnode_in_configured_nodes(nindex_to_node()->at(m)) &&
+            isnode_in_bound_nodes(nindex_to_node()->at(m))) {
           distance = numa_distance(nindex_to_node()->at(i), nindex_to_node()->at(m));
           // If a closest node is found, update. There is always at least one
-          // configured node in the system so there is always at least one node
-          // close.
+          // configured and bound node in the system so there is always at least
+          // one node close.
           if (distance != 0 && distance < closest_distance) {
             closest_distance = distance;
             closest_node = nindex_to_node()->at(m);
@@ -3053,6 +3062,7 @@
 os::Linux::numa_set_bind_policy_func_t os::Linux::_numa_set_bind_policy;
 os::Linux::numa_bitmask_isbitset_func_t os::Linux::_numa_bitmask_isbitset;
 os::Linux::numa_distance_func_t os::Linux::_numa_distance;
+os::Linux::numa_get_membind_func_t os::Linux::_numa_get_membind;
 unsigned long* os::Linux::_numa_all_nodes;
 struct bitmask* os::Linux::_numa_all_nodes_ptr;
 struct bitmask* os::Linux::_numa_nodes_ptr;
@@ -5034,8 +5044,9 @@
     if (!Linux::libnuma_init()) {
       UseNUMA = false;
     } else {
-      if ((Linux::numa_max_node() < 1)) {
-        // There's only one node(they start from 0), disable NUMA.
+      if ((Linux::numa_max_node() < 1) || Linux::isbound_to_single_node()) {
+        // If there's only one node (they start from 0) or if the process
+        // is bound explicitly to a single node using membind, disable NUMA.
         UseNUMA = false;
       }
     }
--- a/src/hotspot/os/linux/os_linux.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/os/linux/os_linux.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -228,6 +228,7 @@
   typedef int (*numa_tonode_memory_func_t)(void *start, size_t size, int node);
   typedef void (*numa_interleave_memory_func_t)(void *start, size_t size, unsigned long *nodemask);
   typedef void (*numa_interleave_memory_v2_func_t)(void *start, size_t size, struct bitmask* mask);
+  typedef struct bitmask* (*numa_get_membind_func_t)(void);
 
   typedef void (*numa_set_bind_policy_func_t)(int policy);
   typedef int (*numa_bitmask_isbitset_func_t)(struct bitmask *bmp, unsigned int n);
@@ -244,6 +245,7 @@
   static numa_set_bind_policy_func_t _numa_set_bind_policy;
   static numa_bitmask_isbitset_func_t _numa_bitmask_isbitset;
   static numa_distance_func_t _numa_distance;
+  static numa_get_membind_func_t _numa_get_membind;
   static unsigned long* _numa_all_nodes;
   static struct bitmask* _numa_all_nodes_ptr;
   static struct bitmask* _numa_nodes_ptr;
@@ -259,6 +261,7 @@
   static void set_numa_set_bind_policy(numa_set_bind_policy_func_t func) { _numa_set_bind_policy = func; }
   static void set_numa_bitmask_isbitset(numa_bitmask_isbitset_func_t func) { _numa_bitmask_isbitset = func; }
   static void set_numa_distance(numa_distance_func_t func) { _numa_distance = func; }
+  static void set_numa_get_membind(numa_get_membind_func_t func) { _numa_get_membind = func; }
   static void set_numa_all_nodes(unsigned long* ptr) { _numa_all_nodes = ptr; }
   static void set_numa_all_nodes_ptr(struct bitmask **ptr) { _numa_all_nodes_ptr = (ptr == NULL ? NULL : *ptr); }
   static void set_numa_nodes_ptr(struct bitmask **ptr) { _numa_nodes_ptr = (ptr == NULL ? NULL : *ptr); }
@@ -299,7 +302,7 @@
     if (_numa_bitmask_isbitset != NULL && _numa_all_nodes_ptr != NULL) {
       return _numa_bitmask_isbitset(_numa_all_nodes_ptr, n);
     } else
-      return 0;
+      return false;
   }
   // Check if numa node exists in the system (including zero memory nodes).
   static bool isnode_in_existing_nodes(unsigned int n) {
@@ -318,7 +321,42 @@
       // substitute.
       return _numa_bitmask_isbitset(_numa_all_nodes_ptr, n);
     } else
-      return 0;
+      return false;
+  }
+  // Check if node is in bound node set.
+  static bool isnode_in_bound_nodes(int node) {
+    if (_numa_get_membind != NULL && _numa_bitmask_isbitset != NULL) {
+      return _numa_bitmask_isbitset(_numa_get_membind(), node);
+    } else {
+      return false;
+    }
+  }
+  // Check if bound to only one numa node.
+  // Returns true if bound to a single numa node, otherwise returns false.
+  static bool isbound_to_single_node() {
+    int nodes = 0;
+    struct bitmask* bmp = NULL;
+    unsigned int node = 0;
+    unsigned int highest_node_number = 0;
+
+    if (_numa_get_membind != NULL && _numa_max_node != NULL && _numa_bitmask_isbitset != NULL) {
+      bmp = _numa_get_membind();
+      highest_node_number = _numa_max_node();
+    } else {
+      return false;
+    }
+
+    for (node = 0; node <= highest_node_number; node++) {
+      if (_numa_bitmask_isbitset(bmp, node)) {
+        nodes++;
+      }
+    }
+
+    if (nodes == 1) {
+      return true;
+    } else {
+      return false;
+    }
   }
 };
 
--- a/src/hotspot/os/solaris/dtrace/jhelper.d	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/os/solaris/dtrace/jhelper.d	Fri Aug 03 12:52:58 2018 -0700
@@ -111,7 +111,7 @@
   copyin_offset(OFFSET_HeapBlockHeader_used);
   copyin_offset(OFFSET_oopDesc_metadata);
 
-  copyin_offset(OFFSET_Symbol_length);
+  copyin_offset(OFFSET_Symbol_length_and_refcount);
   copyin_offset(OFFSET_Symbol_body);
 
   copyin_offset(OFFSET_Method_constMethod);
@@ -463,15 +463,17 @@
   /* The symbol is a CPSlot and has lower bit set to indicate metadata */
   this->nameSymbol &= (~1); /* remove metadata lsb */
 
+  /* Because sparc is big endian, the top half length is at the correct offset. */
   this->nameSymbolLength = copyin_uint16(this->nameSymbol +
-      OFFSET_Symbol_length);
+      OFFSET_Symbol_length_and_refcount);
 
   this->signatureSymbol = copyin_ptr(this->constantPool +
       this->signatureIndex * sizeof (pointer) + SIZE_ConstantPool);
   this->signatureSymbol &= (~1); /* remove metadata lsb */
 
+  /* Because sparc is big endian, the top half length is at the correct offset. */
   this->signatureSymbolLength = copyin_uint16(this->signatureSymbol +
-      OFFSET_Symbol_length);
+      OFFSET_Symbol_length_and_refcount);
 
   this->klassPtr = copyin_ptr(this->constantPool +
       OFFSET_ConstantPool_pool_holder);
@@ -479,8 +481,9 @@
   this->klassSymbol = copyin_ptr(this->klassPtr +
       OFFSET_Klass_name);
 
+  /* Because sparc is big endian, the top half length is at the correct offset. */
   this->klassSymbolLength = copyin_uint16(this->klassSymbol +
-      OFFSET_Symbol_length);
+      OFFSET_Symbol_length_and_refcount);
 
   /*
    * Enough for three strings, plus the '.', plus the trailing '\0'.
--- a/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -42,16 +42,60 @@
 }
 
 bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava) {
-  ucontext_t* uc = (ucontext_t*) ucontext;
-  *fr_addr = frame((intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/],
-                   (address)uc->uc_mcontext.regs->nip);
-  return true;
+  assert(this->is_Java_thread(), "must be JavaThread");
+
+  // If we have a last_Java_frame, then we should use it even if
+  // isInJava == true.  It should be more reliable than ucontext info.
+  if (has_last_Java_frame() && frame_anchor()->walkable()) {
+    *fr_addr = pd_last_frame();
+    return true;
+  }
+
+  // At this point, we don't have a last_Java_frame, so
+  // we try to glean some information out of the ucontext
+  // if we were running Java code when SIGPROF came in.
+  if (isInJava) {
+    ucontext_t* uc = (ucontext_t*) ucontext;
+    frame ret_frame((intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/],
+                     (address)uc->uc_mcontext.regs->nip);
+
+    if (ret_frame.pc() == NULL) {
+      // ucontext wasn't useful
+      return false;
+    }
+
+    if (ret_frame.is_interpreted_frame()) {
+       frame::ijava_state* istate = ret_frame.get_ijava_state();
+       if (!((Method*)(istate->method))->is_metaspace_object()) {
+         return false;
+       }
+       uint64_t reg_bcp = uc->uc_mcontext.regs->gpr[14/*R14_bcp*/];
+       uint64_t istate_bcp = istate->bcp;
+       uint64_t code_start = (uint64_t)(((Method*)(istate->method))->code_base());
+       uint64_t code_end = (uint64_t)(((Method*)istate->method)->code_base() + ((Method*)istate->method)->code_size());
+       if (istate_bcp >= code_start && istate_bcp < code_end) {
+         // we have a valid bcp, don't touch it, do nothing
+       } else if (reg_bcp >= code_start && reg_bcp < code_end) {
+         istate->bcp = reg_bcp;
+      } else {
+         return false;
+       }
+    }
+    if (!ret_frame.safe_for_sender(this)) {
+      // nothing else to try if the frame isn't good
+      return false;
+    }
+    *fr_addr = ret_frame;
+    return true;
+  }
+  // nothing else to try
+  return false;
 }
 
 // Forte Analyzer AsyncGetCallTrace profiling support is not implemented on Linux/PPC.
 bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool isInJava) {
-  Unimplemented();
-  return false;
+  assert(this->is_Java_thread(), "must be JavaThread");
+  return pd_get_top_frame_for_profiling(fr_addr, ucontext, isInJava);
 }
 
 void JavaThread::cache_global_variables() { }
--- a/src/hotspot/share/aot/aotCodeHeap.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/aot/aotCodeHeap.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -29,7 +29,7 @@
 #include "classfile/javaAssertions.hpp"
 #include "gc/shared/cardTable.hpp"
 #include "gc/shared/cardTableBarrierSet.hpp"
-#include "gc/shared/collectedHeap.hpp"
+#include "gc/shared/gcConfig.hpp"
 #include "gc/g1/heapRegion.hpp"
 #include "interpreter/abstractInterpreter.hpp"
 #include "jvmci/compilerRuntime.hpp"
@@ -160,10 +160,15 @@
   // Check configuration size
   verify_flag(_config->_config_size, AOTConfiguration::CONFIG_SIZE, "AOT configuration size");
 
+  // Check GC
+  CollectedHeap::Name gc = (CollectedHeap::Name)_config->_gc;
+  if (_valid && !GCConfig::is_gc_selected(gc)) {
+    handle_config_error("Shared file %s error: used '%s' is different from current '%s'", _name, GCConfig::hs_err_name(gc), GCConfig::hs_err_name());
+  }
+
   // Check flags
   verify_flag(_config->_useCompressedOops, UseCompressedOops, "UseCompressedOops");
   verify_flag(_config->_useCompressedClassPointers, UseCompressedClassPointers, "UseCompressedClassPointers");
-  verify_flag(_config->_useG1GC, UseG1GC, "UseG1GC");
   verify_flag(_config->_useTLAB, UseTLAB, "UseTLAB");
   verify_flag(_config->_useBiasedLocking, UseBiasedLocking, "UseBiasedLocking");
   verify_flag(_config->_objectAlignment, ObjectAlignmentInBytes, "ObjectAlignmentInBytes");
--- a/src/hotspot/share/aot/aotCodeHeap.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/aot/aotCodeHeap.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -92,8 +92,8 @@
 } AOTHeader;
 
 typedef struct {
-  enum { CONFIG_SIZE = 7 * jintSize + 12 };
-  // 7 int values
+  enum { CONFIG_SIZE = 8 * jintSize + 11 };
+  // 8 int values
   int _config_size;
   int _narrowOopShift;
   int _narrowKlassShift;
@@ -101,12 +101,12 @@
   int _fieldsAllocationStyle;
   int _objectAlignment;
   int _codeSegmentSize;
-  // byte[12] array map to boolean values here
+  int _gc;
+  // byte[11] array map to boolean values here
   bool _debug_VM;
   bool _useCompressedOops;
   bool _useCompressedClassPointers;
   bool _compactFields;
-  bool _useG1GC;
   bool _useTLAB;
   bool _useBiasedLocking;
   bool _tieredAOT;
--- a/src/hotspot/share/asm/assembler.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/asm/assembler.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -159,6 +159,14 @@
   Label() {
     init();
   }
+
+  ~Label() {
+    assert(is_bound() || is_unused(), "Label was never bound to a location, but it was used as a jmp target");
+  }
+
+  void reset() {
+    init(); //leave _patch_overflow because it points to CodeBuffer.
+  }
 };
 
 // A NearLabel must be bound to a location near its users. Users can
--- a/src/hotspot/share/c1/c1_LIRAssembler.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/c1/c1_LIRAssembler.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -71,7 +71,11 @@
   void record_non_safepoint_debug_info();
 
   // unified bailout support
-  void bailout(const char* msg) const            { compilation()->bailout(msg); }
+  void bailout(const char* msg) {
+    // reset the label in case it hits assertion in destructor.
+    _unwind_handler_entry.reset();
+    compilation()->bailout(msg);
+  }
   bool bailed_out() const                        { return compilation()->bailed_out(); }
 
   // code emission patterns and accessors
--- a/src/hotspot/share/ci/ciObjectFactory.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/ci/ciObjectFactory.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -74,7 +74,7 @@
   ciMetadata* create_new_metadata(Metadata* o);
 
   static bool is_equal(NonPermObject* p, oop key) {
-    return p->object()->get_oop() == key;
+    return oopDesc::equals(p->object()->get_oop(), key);
   }
 
   NonPermObject* &find_non_perm(oop key);
--- a/src/hotspot/share/classfile/classFileParser.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/classfile/classFileParser.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -3572,6 +3572,9 @@
                          "Nest-host class_info_index %u has bad constant type in class file %s",
                          class_info_index, CHECK);
           _nest_host = class_info_index;
+        } else {
+          // Unknown attribute
+          cfs->skip_u1(attribute_length, CHECK);
         }
       } else {
         // Unknown attribute
--- a/src/hotspot/share/classfile/compactHashtable.inline.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/classfile/compactHashtable.inline.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -36,7 +36,7 @@
                                                     u4 offset, const char* name, int len) {
   Symbol* sym = (Symbol*)(_base_address + offset);
   if (sym->equals(name, len)) {
-    assert(sym->refcount() == -1, "must be shared");
+    assert(sym->refcount() == PERM_REFCOUNT, "must be shared");
     return sym;
   }
 
--- a/src/hotspot/share/classfile/dictionary.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/classfile/dictionary.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -182,7 +182,7 @@
     for (ProtectionDomainEntry* current = pd_set(); // accessed at a safepoint
                                 current != NULL;
                                 current = current->_next) {
-      current->_pd_cache->object_no_keepalive()->verify();
+      oopDesc::verify(current->_pd_cache->object_no_keepalive());
     }
   }
 
--- a/src/hotspot/share/classfile/modules.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/classfile/modules.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -307,7 +307,7 @@
 
   oop loader = java_lang_Module::loader(module_handle());
   // Make sure loader is not the jdk.internal.reflect.DelegatingClassLoader.
-  if (loader != java_lang_ClassLoader::non_reflection_class_loader(loader)) {
+  if (!oopDesc::equals(loader, java_lang_ClassLoader::non_reflection_class_loader(loader))) {
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
               "Class loader is an invalid delegating class loader");
   }
--- a/src/hotspot/share/classfile/symbolTable.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/classfile/symbolTable.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -190,6 +190,7 @@
   assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
   // This should never happen with -Xshare:dump but it might in testing mode.
   if (DumpSharedSpaces) return;
+
   // Create a new symbol table
   SymbolTable* new_table = new SymbolTable();
 
@@ -212,10 +213,16 @@
     count++;  // count all entries in this bucket, not just ones with same hash
     if (e->hash() == hash) {
       Symbol* sym = e->literal();
-      if (sym->equals(name, len)) {
-        // something is referencing this symbol now.
-        sym->increment_refcount();
-        return sym;
+      // Skip checking already dead symbols in the bucket.
+      if (sym->refcount() == 0) {
+        count--;   // Don't count this symbol towards rehashing.
+      } else if (sym->equals(name, len)) {
+        if (sym->try_increment_refcount()) {
+          // something is referencing this symbol now.
+          return sym;
+        } else {
+          count--;   // don't count this symbol.
+        }
       }
     }
   }
--- a/src/hotspot/share/classfile/systemDictionary.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/classfile/systemDictionary.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -443,8 +443,18 @@
     // Print out trace information
     LogStream ls(lt);
     ls.print_cr("Checking package access");
-    ls.print("class loader: "); class_loader()->print_value_on(&ls);
-    ls.print(" protection domain: "); protection_domain()->print_value_on(&ls);
+    if (class_loader() != NULL) {
+      ls.print("class loader: ");
+      class_loader()->print_value_on(&ls);
+    } else {
+      ls.print_cr("class loader: NULL");
+    }
+    if (protection_domain() != NULL) {
+      ls.print(" protection domain: ");
+      protection_domain()->print_value_on(&ls);
+    } else {
+      ls.print_cr(" protection domain: NULL");
+    }
     ls.print(" loading: "); klass->print_value_on(&ls);
     ls.cr();
   }
@@ -1908,7 +1918,7 @@
   // Allocate private object used as system class loader lock
   _system_loader_lock_obj = oopFactory::new_intArray(0, CHECK);
   // Initialize basic classes
-  initialize_preloaded_classes(CHECK);
+  resolve_preloaded_classes(CHECK);
 }
 
 // Compact table of directions on the initialization of klasses:
@@ -1922,7 +1932,7 @@
   0
 };
 
-bool SystemDictionary::initialize_wk_klass(WKID id, int init_opt, TRAPS) {
+bool SystemDictionary::resolve_wk_klass(WKID id, int init_opt, TRAPS) {
   assert(id >= (int)FIRST_WKID && id < (int)WKID_LIMIT, "oob");
   int  info = wk_init_info[id - FIRST_WKID];
   int  sid  = (info >> CEIL_LG_OPTION_LIMIT);
@@ -1952,7 +1962,7 @@
   return ((*klassp) != NULL);
 }
 
-void SystemDictionary::initialize_wk_klasses_until(WKID limit_id, WKID &start_id, TRAPS) {
+void SystemDictionary::resolve_wk_klasses_until(WKID limit_id, WKID &start_id, TRAPS) {
   assert((int)start_id <= (int)limit_id, "IDs are out of order!");
   for (int id = (int)start_id; id < (int)limit_id; id++) {
     assert(id >= (int)FIRST_WKID && id < (int)WKID_LIMIT, "oob");
@@ -1960,14 +1970,14 @@
     int sid  = (info >> CEIL_LG_OPTION_LIMIT);
     int opt  = (info & right_n_bits(CEIL_LG_OPTION_LIMIT));
 
-    initialize_wk_klass((WKID)id, opt, CHECK);
+    resolve_wk_klass((WKID)id, opt, CHECK);
   }
 
   // move the starting value forward to the limit:
   start_id = limit_id;
 }
 
-void SystemDictionary::initialize_preloaded_classes(TRAPS) {
+void SystemDictionary::resolve_preloaded_classes(TRAPS) {
   assert(WK_KLASS(Object_klass) == NULL, "preloaded classes should only be initialized once");
 
   // Create the ModuleEntry for java.base.  This call needs to be done here,
@@ -1979,14 +1989,14 @@
   // first do Object, then String, Class
 #if INCLUDE_CDS
   if (UseSharedSpaces) {
-    initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(Object_klass), scan, CHECK);
+    resolve_wk_klasses_through(WK_KLASS_ENUM_NAME(Object_klass), scan, CHECK);
     // Initialize the constant pool for the Object_class
     Object_klass()->constants()->restore_unshareable_info(CHECK);
-    initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(Class_klass), scan, CHECK);
+    resolve_wk_klasses_through(WK_KLASS_ENUM_NAME(Class_klass), scan, CHECK);
   } else
 #endif
   {
-    initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(Class_klass), scan, CHECK);
+    resolve_wk_klasses_through(WK_KLASS_ENUM_NAME(Class_klass), scan, CHECK);
   }
 
   // Calculate offsets for String and Class classes since they are loaded and
@@ -2003,13 +2013,13 @@
   Universe::fixup_mirrors(CHECK);
 
   // do a bunch more:
-  initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(Reference_klass), scan, CHECK);
+  resolve_wk_klasses_through(WK_KLASS_ENUM_NAME(Reference_klass), scan, CHECK);
 
   // Preload ref klasses and set reference types
   InstanceKlass::cast(WK_KLASS(Reference_klass))->set_reference_type(REF_OTHER);
   InstanceRefKlass::update_nonstatic_oop_maps(WK_KLASS(Reference_klass));
 
-  initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(PhantomReference_klass), scan, CHECK);
+  resolve_wk_klasses_through(WK_KLASS_ENUM_NAME(PhantomReference_klass), scan, CHECK);
   InstanceKlass::cast(WK_KLASS(SoftReference_klass))->set_reference_type(REF_SOFT);
   InstanceKlass::cast(WK_KLASS(WeakReference_klass))->set_reference_type(REF_WEAK);
   InstanceKlass::cast(WK_KLASS(FinalReference_klass))->set_reference_type(REF_FINAL);
@@ -2018,9 +2028,9 @@
   // JSR 292 classes
   WKID jsr292_group_start = WK_KLASS_ENUM_NAME(MethodHandle_klass);
   WKID jsr292_group_end   = WK_KLASS_ENUM_NAME(VolatileCallSite_klass);
-  initialize_wk_klasses_until(jsr292_group_start, scan, CHECK);
-  initialize_wk_klasses_through(jsr292_group_end, scan, CHECK);
-  initialize_wk_klasses_until(NOT_JVMCI(WKID_LIMIT) JVMCI_ONLY(FIRST_JVMCI_WKID), scan, CHECK);
+  resolve_wk_klasses_until(jsr292_group_start, scan, CHECK);
+  resolve_wk_klasses_through(jsr292_group_end, scan, CHECK);
+  resolve_wk_klasses_until(NOT_JVMCI(WKID_LIMIT) JVMCI_ONLY(FIRST_JVMCI_WKID), scan, CHECK);
 
   _box_klasses[T_BOOLEAN] = WK_KLASS(Boolean_klass);
   _box_klasses[T_CHAR]    = WK_KLASS(Character_klass);
@@ -2226,12 +2236,14 @@
   ClassLoaderData* loader_data2 = class_loader_data(class_loader2);
 
   Symbol* constraint_name = NULL;
+  // Needs to be in same scope as constraint_name in case a Symbol is created and
+  // assigned to constraint_name.
+  FieldArrayInfo fd;
   if (!FieldType::is_array(class_name)) {
     constraint_name = class_name;
   } else {
     // For array classes, their Klass*s are not kept in the
     // constraint table. The element classes are.
-    FieldArrayInfo fd;
     BasicType t = FieldType::get_array_info(class_name, fd, CHECK_(false));
     // primitive types always pass
     if (t != T_OBJECT) {
--- a/src/hotspot/share/classfile/systemDictionary.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/classfile/systemDictionary.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -98,7 +98,7 @@
 // that makes some minor distinctions, like whether the klass
 // is preloaded, optional, release-specific, etc.
 // The order of these definitions is significant; it is the order in which
-// preloading is actually performed by initialize_preloaded_classes.
+// preloading is actually performed by resolve_preloaded_classes.
 
 #define WK_KLASSES_DO(do_klass)                                                                                          \
   /* well-known classes */                                                                                               \
@@ -417,11 +417,11 @@
 
   JVMCI_ONLY(static InstanceKlass* check_klass_Jvmci(InstanceKlass* k) { return k; })
 
-  static bool initialize_wk_klass(WKID id, int init_opt, TRAPS);
-  static void initialize_wk_klasses_until(WKID limit_id, WKID &start_id, TRAPS);
-  static void initialize_wk_klasses_through(WKID end_id, WKID &start_id, TRAPS) {
+  static bool resolve_wk_klass(WKID id, int init_opt, TRAPS);
+  static void resolve_wk_klasses_until(WKID limit_id, WKID &start_id, TRAPS);
+  static void resolve_wk_klasses_through(WKID end_id, WKID &start_id, TRAPS) {
     int limit = (int)end_id + 1;
-    initialize_wk_klasses_until((WKID) limit, start_id, THREAD);
+    resolve_wk_klasses_until((WKID) limit, start_id, THREAD);
   }
 
 public:
@@ -708,8 +708,8 @@
                                   ClassLoaderData* loader_data,
                                   TRAPS);
 
-  // Initialization
-  static void initialize_preloaded_classes(TRAPS);
+  // Resolve preloaded classes so they can be used like SystemDictionary::String_klass()
+  static void resolve_preloaded_classes(TRAPS);
 
   // Class loader constraints
   static void check_constraints(unsigned int hash,
--- a/src/hotspot/share/code/debugInfo.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/code/debugInfo.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -251,7 +251,11 @@
 }
 
 void ConstantOopReadValue::print_on(outputStream* st) const {
-  value()()->print_value_on(st);
+  if (value()() != NULL) {
+    value()()->print_value_on(st);
+  } else {
+    st->print_cr("NULL");
+  }
 }
 
 
--- a/src/hotspot/share/code/nmethod.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/code/nmethod.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -2332,7 +2332,11 @@
     if (o == (oop)Universe::non_oop_word()) {
       tty->print("non-oop word");
     } else {
-      o->print_value();
+      if (o != NULL) {
+        o->print_value();
+      } else {
+        tty->print_cr("NULL");
+      }
     }
     tty->cr();
   }
@@ -2346,7 +2350,7 @@
     if (m == (Metadata*)Universe::non_oop_word()) {
       tty->print("non-metadata word");
     } else {
-      m->print_value_on_maybe_null(tty);
+      Metadata::print_value_on_maybe_null(tty, m);
     }
     tty->cr();
   }
--- a/src/hotspot/share/gc/cms/compactibleFreeListSpace.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/cms/compactibleFreeListSpace.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -2406,7 +2406,7 @@
       res = _sp->adjustObjectSize(p->size());
       if (_sp->obj_is_alive(addr)) {
         was_live = true;
-        p->verify();
+        oopDesc::verify(p);
       }
     } else {
       FreeChunk* fc = (FreeChunk*)addr;
@@ -2455,7 +2455,7 @@
                   _sp->block_is_obj((HeapWord*)obj),
                   "Should be an object");
         guarantee(oopDesc::is_oop(obj), "Should be an oop");
-        obj->verify();
+        oopDesc::verify(obj);
         if (_past_remark) {
           // Remark has been completed, the object should be marked
           _bit_map->isMarked((HeapWord*)obj);
@@ -2472,7 +2472,7 @@
     } else if (_sp->is_in_reserved(p)) {
       // the reference is from FLS, and points out of FLS
       guarantee(oopDesc::is_oop(obj), "Should be an oop");
-      obj->verify();
+      oopDesc::verify(obj);
     }
   }
 
--- a/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -573,7 +573,6 @@
         log_warning(gc)("task_queues allocation failure.");
         return;
       }
-      _hash_seed = NEW_C_HEAP_ARRAY(int, num_queues, mtGC);
       typedef Padded<OopTaskQueue> PaddedOopTaskQueue;
       for (i = 0; i < num_queues; i++) {
         PaddedOopTaskQueue *q = new PaddedOopTaskQueue();
@@ -585,7 +584,6 @@
       }
       for (i = 0; i < num_queues; i++) {
         _task_queues->queue(i)->initialize();
-        _hash_seed[i] = 17;  // copied from ParNew
       }
     }
   }
@@ -3416,7 +3414,6 @@
   oop obj_to_scan;
   CMSBitMap* bm = &(_collector->_markBitMap);
   CMSMarkStack* ovflw = &(_collector->_markStack);
-  int* seed = _collector->hash_seed(i);
   ParConcMarkingClosure cl(_collector, this, work_q, bm, ovflw);
   while (true) {
     cl.trim_queue(0);
@@ -3426,7 +3423,7 @@
       // overflow stack may already have been stolen from us.
       // assert(work_q->size() > 0, "Work from overflow stack");
       continue;
-    } else if (task_queues()->steal(i, seed, /* reference */ obj_to_scan)) {
+    } else if (task_queues()->steal(i, /* reference */ obj_to_scan)) {
       assert(oopDesc::is_oop(obj_to_scan), "Should be an oop");
       assert(bm->isMarked((HeapWord*)obj_to_scan), "Grey object");
       obj_to_scan->oop_iterate(&cl);
@@ -4325,7 +4322,7 @@
                                   ParMarkRefsIntoAndScanClosure* cl);
 
   // ... work stealing for the above
-  void do_work_steal(int i, ParMarkRefsIntoAndScanClosure* cl, int* seed);
+  void do_work_steal(int i, ParMarkRefsIntoAndScanClosure* cl);
 };
 
 class RemarkCLDClosure : public CLDClosure {
@@ -4470,7 +4467,7 @@
   // ---------- ... and drain overflow list.
   _timer.reset();
   _timer.start();
-  do_work_steal(worker_id, &par_mrias_cl, _collector->hash_seed(worker_id));
+  do_work_steal(worker_id, &par_mrias_cl);
   _timer.stop();
   log_trace(gc, task)("Finished work stealing in %dth thread: %3.3f sec", worker_id, _timer.seconds());
 }
@@ -4619,8 +4616,7 @@
 
 // . see if we can share work_queues with ParNew? XXX
 void
-CMSParRemarkTask::do_work_steal(int i, ParMarkRefsIntoAndScanClosure* cl,
-                                int* seed) {
+CMSParRemarkTask::do_work_steal(int i, ParMarkRefsIntoAndScanClosure* cl) {
   OopTaskQueue* work_q = work_queue(i);
   NOT_PRODUCT(int num_steals = 0;)
   oop obj_to_scan;
@@ -4651,7 +4647,7 @@
     // Verify that we have no work before we resort to stealing
     assert(work_q->size() == 0, "Have work, shouldn't steal");
     // Try to steal from other queues that have work
-    if (task_queues()->steal(i, seed, /* reference */ obj_to_scan)) {
+    if (task_queues()->steal(i, /* reference */ obj_to_scan)) {
       NOT_PRODUCT(num_steals++;)
       assert(oopDesc::is_oop(obj_to_scan), "Oops, not an oop!");
       assert(bm->isMarked((HeapWord*)obj_to_scan), "Stole an unmarked oop?");
@@ -5041,8 +5037,7 @@
 
   void do_work_steal(int i,
                      CMSParDrainMarkingStackClosure* drain,
-                     CMSParKeepAliveClosure* keep_alive,
-                     int* seed);
+                     CMSParKeepAliveClosure* keep_alive);
 
   virtual void work(uint worker_id);
 };
@@ -5060,8 +5055,7 @@
   CMSIsAliveClosure is_alive_closure(_span, _mark_bit_map);
   _task.work(worker_id, is_alive_closure, par_keep_alive, par_drain_stack);
   if (_task.marks_oops_alive()) {
-    do_work_steal(worker_id, &par_drain_stack, &par_keep_alive,
-                  _collector->hash_seed(worker_id));
+    do_work_steal(worker_id, &par_drain_stack, &par_keep_alive);
   }
   assert(work_queue(worker_id)->size() == 0, "work_queue should be empty");
   assert(_collector->_overflow_list == NULL, "non-empty _overflow_list");
@@ -5080,8 +5074,7 @@
 // . see if we can share work_queues with ParNew? XXX
 void CMSRefProcTaskProxy::do_work_steal(int i,
   CMSParDrainMarkingStackClosure* drain,
-  CMSParKeepAliveClosure* keep_alive,
-  int* seed) {
+  CMSParKeepAliveClosure* keep_alive) {
   OopTaskQueue* work_q = work_queue(i);
   NOT_PRODUCT(int num_steals = 0;)
   oop obj_to_scan;
@@ -5110,7 +5103,7 @@
     // Verify that we have no work before we resort to stealing
     assert(work_q->size() == 0, "Have work, shouldn't steal");
     // Try to steal from other queues that have work
-    if (task_queues()->steal(i, seed, /* reference */ obj_to_scan)) {
+    if (task_queues()->steal(i, /* reference */ obj_to_scan)) {
       NOT_PRODUCT(num_steals++;)
       assert(oopDesc::is_oop(obj_to_scan), "Oops, not an oop!");
       assert(_mark_bit_map->isMarked((HeapWord*)obj_to_scan), "Stole an unmarked oop?");
--- a/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -544,8 +544,6 @@
   Stack<oop, mtGC>     _preserved_oop_stack;
   Stack<markOop, mtGC> _preserved_mark_stack;
 
-  int*             _hash_seed;
-
   // In support of multi-threaded concurrent phases
   YieldingFlexibleWorkGang* _conc_workers;
 
@@ -713,7 +711,6 @@
   bool stop_world_and_do(CMS_op_type op);
 
   OopTaskQueueSet* task_queues() { return _task_queues; }
-  int*             hash_seed(int i) { return &_hash_seed[i]; }
   YieldingFlexibleWorkGang* conc_workers() { return _conc_workers; }
 
   // Support for parallelizing Eden rescan in CMS remark phase
--- a/src/hotspot/share/gc/cms/parNewGeneration.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/cms/parNewGeneration.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -106,7 +106,6 @@
   #endif // TASKQUEUE_STATS
 
   _survivor_chunk_array = (ChunkArray*) old_gen()->get_data_recorder(thread_num());
-  _hash_seed = 17;  // Might want to take time-based random value.
   _start = os::elapsedTime();
   _old_gen_closure.set_generation(old_gen_);
   _old_gen_root_closure.set_generation(old_gen_);
@@ -438,7 +437,7 @@
 }
 
 void ParScanThreadStateSet::print_taskqueue_stats() {
-  if (!log_develop_is_enabled(Trace, gc, task, stats)) {
+  if (!log_is_enabled(Trace, gc, task, stats)) {
     return;
   }
   Log(gc, task, stats) log;
@@ -550,7 +549,6 @@
 
     // Attempt to steal work from promoted.
     if (task_queues()->steal(par_scan_state()->thread_num(),
-                             par_scan_state()->hash_seed(),
                              obj_to_scan)) {
       bool res = work_q->push(obj_to_scan);
       assert(res, "Empty queue should have room for a push.");
--- a/src/hotspot/share/gc/cms/parNewGeneration.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/cms/parNewGeneration.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -96,7 +96,6 @@
 
   HeapWord *_young_old_boundary;
 
-  int _hash_seed;
   int _thread_num;
   AgeTable _ageTable;
 
@@ -165,7 +164,6 @@
   // Is new_obj a candidate for scan_partial_array_and_push_remainder method.
   inline bool should_be_partially_scanned(oop new_obj, oop old_obj) const;
 
-  int* hash_seed()  { return &_hash_seed; }
   int  thread_num() { return _thread_num; }
 
   // Allocate a to-space block of size "sz", or else return NULL.
--- a/src/hotspot/share/gc/g1/g1Arguments.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1Arguments.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -31,7 +31,7 @@
 class CollectedHeap;
 
 class G1Arguments : public GCArguments {
-  friend class G1HeapVerifierTest_parse_Test;
+  friend class G1HeapVerifierTest;
 
 private:
   static void initialize_verification_types();
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -52,6 +52,7 @@
 #include "gc/g1/g1RemSet.hpp"
 #include "gc/g1/g1RootClosures.hpp"
 #include "gc/g1/g1RootProcessor.hpp"
+#include "gc/g1/g1SATBMarkQueueFilter.hpp"
 #include "gc/g1/g1StringDedup.hpp"
 #include "gc/g1/g1ThreadLocalData.hpp"
 #include "gc/g1/g1YCTypes.hpp"
@@ -1668,7 +1669,9 @@
   // Perform any initialization actions delegated to the policy.
   g1_policy()->init(this, &_collection_set);
 
-  G1BarrierSet::satb_mark_queue_set().initialize(SATB_Q_CBL_mon,
+  G1SATBMarkQueueFilter* satb_filter = new G1SATBMarkQueueFilter(this);
+  G1BarrierSet::satb_mark_queue_set().initialize(satb_filter,
+                                                 SATB_Q_CBL_mon,
                                                  SATB_Q_FL_lock,
                                                  G1SATBProcessCompletedThreshold,
                                                  Shared_SATB_Q_lock);
@@ -3716,15 +3719,12 @@
 
 class G1CopyingKeepAliveClosure: public OopClosure {
   G1CollectedHeap*         _g1h;
-  OopClosure*              _copy_non_heap_obj_cl;
   G1ParScanThreadState*    _par_scan_state;
 
 public:
   G1CopyingKeepAliveClosure(G1CollectedHeap* g1h,
-                            OopClosure* non_heap_obj_cl,
                             G1ParScanThreadState* pss):
     _g1h(g1h),
-    _copy_non_heap_obj_cl(non_heap_obj_cl),
     _par_scan_state(pss)
   {}
 
@@ -3744,22 +3744,10 @@
       // If the referent has not been forwarded then we have to keep
       // it alive by policy. Therefore we have copy the referent.
       //
-      // If the reference field is in the G1 heap then we can push
-      // on the PSS queue. When the queue is drained (after each
-      // phase of reference processing) the object and it's followers
-      // will be copied, the reference field set to point to the
-      // new location, and the RSet updated. Otherwise we need to
-      // use the the non-heap or metadata closures directly to copy
-      // the referent object and update the pointer, while avoiding
-      // updating the RSet.
-
-      if (_g1h->is_in_g1_reserved(p)) {
-        _par_scan_state->push_on_queue(p);
-      } else {
-        assert(!Metaspace::contains((const void*)p),
-               "Unexpectedly found a pointer from metadata: " PTR_FORMAT, p2i(p));
-        _copy_non_heap_obj_cl->do_oop(p);
-      }
+      // When the queue is drained (after each phase of reference processing)
+      // the object and it's followers will be copied, the reference field set
+      // to point to the new location, and the RSet updated.
+      _par_scan_state->push_on_queue(p);
     }
   }
 };
@@ -3851,7 +3839,7 @@
     pss->set_ref_discoverer(NULL);
 
     // Keep alive closure.
-    G1CopyingKeepAliveClosure keep_alive(_g1h, pss->closures()->raw_strong_oops(), pss);
+    G1CopyingKeepAliveClosure keep_alive(_g1h, pss);
 
     // Complete GC closure
     G1ParEvacuateFollowersClosure drain_queue(_g1h, pss, _task_queues, _terminator);
@@ -3903,7 +3891,7 @@
   assert(pss->queue_is_empty(), "pre-condition");
 
   // Keep alive closure.
-  G1CopyingKeepAliveClosure keep_alive(this, pss->closures()->raw_strong_oops(), pss);
+  G1CopyingKeepAliveClosure keep_alive(this, pss);
 
   // Serial Complete GC closure
   G1STWDrainQueueClosure drain_queue(this, pss);
--- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -2466,8 +2466,8 @@
                        hits, misses, percent_of(hits, hits + misses));
 }
 
-bool G1ConcurrentMark::try_stealing(uint worker_id, int* hash_seed, G1TaskQueueEntry& task_entry) {
-  return _task_queues->steal(worker_id, hash_seed, task_entry);
+bool G1ConcurrentMark::try_stealing(uint worker_id, G1TaskQueueEntry& task_entry) {
+  return _task_queues->steal(worker_id, task_entry);
 }
 
 /*****************************************************************************
@@ -2773,7 +2773,7 @@
            "only way to reach here");
     while (!has_aborted()) {
       G1TaskQueueEntry entry;
-      if (_cm->try_stealing(_worker_id, &_hash_seed, entry)) {
+      if (_cm->try_stealing(_worker_id, entry)) {
         scan_task_entry(entry);
 
         // And since we're towards the end, let's totally drain the
@@ -2915,7 +2915,6 @@
   _refs_reached(0),
   _refs_reached_limit(0),
   _real_refs_reached_limit(0),
-  _hash_seed(17),
   _has_aborted(false),
   _has_timed_out(false),
   _draining_satb_buffers(false),
--- a/src/hotspot/share/gc/g1/g1ConcurrentMark.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -519,7 +519,7 @@
   }
 
   // Attempts to steal an object from the task queues of other tasks
-  bool try_stealing(uint worker_id, int* hash_seed, G1TaskQueueEntry& task_entry);
+  bool try_stealing(uint worker_id, G1TaskQueueEntry& task_entry);
 
   G1ConcurrentMark(G1CollectedHeap* g1h,
                    G1RegionToSpaceMapper* prev_bitmap_storage,
@@ -685,8 +685,6 @@
   // it was decreased).
   size_t                      _real_refs_reached_limit;
 
-  // Used by the work stealing
-  int                         _hash_seed;
   // If true, then the task has aborted for some reason
   bool                        _has_aborted;
   // Set when the task aborts because it has met its time quota
--- a/src/hotspot/share/gc/g1/g1FullGCMarker.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1FullGCMarker.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -46,15 +46,14 @@
 void G1FullGCMarker::complete_marking(OopQueueSet* oop_stacks,
                                       ObjArrayTaskQueueSet* array_stacks,
                                       ParallelTaskTerminator* terminator) {
-  int hash_seed = 17;
   do {
     drain_stack();
     ObjArrayTask steal_array;
-    if (array_stacks->steal(_worker_id, &hash_seed, steal_array)) {
+    if (array_stacks->steal(_worker_id, steal_array)) {
       follow_array_chunk(objArrayOop(steal_array.obj()), steal_array.index());
     } else {
       oop steal_oop;
-      if (oop_stacks->steal(_worker_id, &hash_seed, steal_oop)) {
+      if (oop_stacks->steal(_worker_id, steal_oop)) {
         follow_object(steal_oop);
       }
     }
--- a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -47,7 +47,6 @@
     _age_table(false),
     _tenuring_threshold(g1h->g1_policy()->tenuring_threshold()),
     _scanner(g1h, this),
-    _hash_seed(17),
     _worker_id(worker_id),
     _stack_trim_upper_threshold(GCDrainStackTargetSize * 2 + 1),
     _stack_trim_lower_threshold(GCDrainStackTargetSize),
--- a/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -57,7 +57,6 @@
   uint              _tenuring_threshold;
   G1ScanEvacuatedObjClosure  _scanner;
 
-  int  _hash_seed;
   uint _worker_id;
 
   // Upper and lower threshold to start and end work queue draining.
--- a/src/hotspot/share/gc/g1/g1ParScanThreadState.inline.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.inline.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -140,7 +140,7 @@
 
 void G1ParScanThreadState::steal_and_trim_queue(RefToScanQueueSet *task_queues) {
   StarTask stolen_task;
-  while (task_queues->steal(_worker_id, &_hash_seed, stolen_task)) {
+  while (task_queues->steal(_worker_id, stolen_task)) {
     assert(verify_task(stolen_task), "sanity");
     dispatch_reference(stolen_task);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/g1/g1SATBMarkQueueFilter.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -0,0 +1,107 @@
+/*
+ * 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.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/g1/g1CollectedHeap.inline.hpp"
+#include "gc/g1/g1SATBMarkQueueFilter.hpp"
+#include "gc/g1/heapRegion.hpp"
+#include "gc/g1/satbMarkQueue.hpp"
+#include "oops/oop.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/globalDefinitions.hpp"
+
+G1SATBMarkQueueFilter::G1SATBMarkQueueFilter(G1CollectedHeap* g1h) : _g1h(g1h) {}
+
+// Return true if a SATB buffer entry refers to an object that
+// requires marking.
+//
+// The entry must point into the G1 heap.  In particular, it must not
+// be a NULL pointer.  NULL pointers are pre-filtered and never
+// inserted into a SATB buffer.
+//
+// An entry that is below the NTAMS pointer for the containing heap
+// region requires marking. Such an entry must point to a valid object.
+//
+// An entry that is at least the NTAMS pointer for the containing heap
+// region might be any of the following, none of which should be marked.
+//
+// * A reference to an object allocated since marking started.
+//   According to SATB, such objects are implicitly kept live and do
+//   not need to be dealt with via SATB buffer processing.
+//
+// * A reference to a young generation object. Young objects are
+//   handled separately and are not marked by concurrent marking.
+//
+// * A stale reference to a young generation object. If a young
+//   generation object reference is recorded and not filtered out
+//   before being moved by a young collection, the reference becomes
+//   stale.
+//
+// * A stale reference to an eagerly reclaimed humongous object.  If a
+//   humongous object is recorded and then reclaimed, the reference
+//   becomes stale.
+//
+// The stale reference cases are implicitly handled by the NTAMS
+// comparison. Because of the possibility of stale references, buffer
+// processing must be somewhat circumspect and not assume entries
+// in an unfiltered buffer refer to valid objects.
+
+static inline bool requires_marking(const void* entry, G1CollectedHeap* g1h) {
+  // Includes rejection of NULL pointers.
+  assert(g1h->is_in_reserved(entry),
+         "Non-heap pointer in SATB buffer: " PTR_FORMAT, p2i(entry));
+
+  HeapRegion* region = g1h->heap_region_containing(entry);
+  assert(region != NULL, "No region for " PTR_FORMAT, p2i(entry));
+  if (entry >= region->next_top_at_mark_start()) {
+    return false;
+  }
+
+  assert(oopDesc::is_oop(oop(entry), true /* ignore mark word */),
+         "Invalid oop in SATB buffer: " PTR_FORMAT, p2i(entry));
+
+  return true;
+}
+
+static inline bool discard_entry(const void* entry, G1CollectedHeap* g1h) {
+  return !requires_marking(entry, g1h) || g1h->is_marked_next((oop)entry);
+}
+
+// Workaround for not yet having std::bind.
+class G1SATBMarkQueueFilterFn {
+  G1CollectedHeap* _g1h;
+
+public:
+  G1SATBMarkQueueFilterFn(G1CollectedHeap* g1h) : _g1h(g1h) {}
+
+  // Return true if entry should be filtered out (removed), false if
+  // it should be retained.
+  bool operator()(const void* entry) const {
+    return discard_entry(entry, _g1h);
+  }
+};
+
+void G1SATBMarkQueueFilter::filter(SATBMarkQueue* queue) {
+  queue->apply_filter(G1SATBMarkQueueFilterFn(_g1h));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/g1/g1SATBMarkQueueFilter.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ *
+ */
+
+#ifndef SHARE_GC_G1_G1SATBMARKQUEUEFILTER_HPP
+#define SHARE_GC_G1_G1SATBMARKQUEUEFILTER_HPP
+
+#include "gc/g1/satbMarkQueue.hpp"
+
+class G1CollectedHeap;
+
+class G1SATBMarkQueueFilter : public SATBMarkQueueFilter {
+  G1CollectedHeap* _g1h;
+
+public:
+  G1SATBMarkQueueFilter(G1CollectedHeap* g1h);
+
+  virtual void filter(SATBMarkQueue* queue);
+};
+
+#endif // SHARE_GC_G1_G1SATBMARKQUEUEFILTER_HPP
--- a/src/hotspot/share/gc/g1/satbMarkQueue.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/g1/satbMarkQueue.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -52,103 +52,9 @@
   flush_impl();
 }
 
-// Return true if a SATB buffer entry refers to an object that
-// requires marking.
-//
-// The entry must point into the G1 heap.  In particular, it must not
-// be a NULL pointer.  NULL pointers are pre-filtered and never
-// inserted into a SATB buffer.
-//
-// An entry that is below the NTAMS pointer for the containing heap
-// region requires marking. Such an entry must point to a valid object.
-//
-// An entry that is at least the NTAMS pointer for the containing heap
-// region might be any of the following, none of which should be marked.
-//
-// * A reference to an object allocated since marking started.
-//   According to SATB, such objects are implicitly kept live and do
-//   not need to be dealt with via SATB buffer processing.
-//
-// * A reference to a young generation object. Young objects are
-//   handled separately and are not marked by concurrent marking.
-//
-// * A stale reference to a young generation object. If a young
-//   generation object reference is recorded and not filtered out
-//   before being moved by a young collection, the reference becomes
-//   stale.
-//
-// * A stale reference to an eagerly reclaimed humongous object.  If a
-//   humongous object is recorded and then reclaimed, the reference
-//   becomes stale.
-//
-// The stale reference cases are implicitly handled by the NTAMS
-// comparison. Because of the possibility of stale references, buffer
-// processing must be somewhat circumspect and not assume entries
-// in an unfiltered buffer refer to valid objects.
-
-inline bool requires_marking(const void* entry, G1CollectedHeap* heap) {
-  // Includes rejection of NULL pointers.
-  assert(heap->is_in_reserved(entry),
-         "Non-heap pointer in SATB buffer: " PTR_FORMAT, p2i(entry));
-
-  HeapRegion* region = heap->heap_region_containing(entry);
-  assert(region != NULL, "No region for " PTR_FORMAT, p2i(entry));
-  if (entry >= region->next_top_at_mark_start()) {
-    return false;
-  }
-
-  assert(oopDesc::is_oop(oop(entry), true /* ignore mark word */),
-         "Invalid oop in SATB buffer: " PTR_FORMAT, p2i(entry));
-
-  return true;
-}
-
-inline bool retain_entry(const void* entry, G1CollectedHeap* heap) {
-  return requires_marking(entry, heap) && !heap->is_marked_next((oop)entry);
-}
-
-// This method removes entries from a SATB buffer that will not be
-// useful to the concurrent marking threads.  Entries are retained if
-// they require marking and are not already marked. Retained entries
-// are compacted toward the top of the buffer.
-
-void SATBMarkQueue::filter() {
-  G1CollectedHeap* g1h = G1CollectedHeap::heap();
-  void** buf = _buf;
-
-  if (buf == NULL) {
-    // nothing to do
-    return;
-  }
-
-  // Two-fingered compaction toward the end.
-  void** src = &buf[index()];
-  void** dst = &buf[capacity()];
-  assert(src <= dst, "invariant");
-  for ( ; src < dst; ++src) {
-    // Search low to high for an entry to keep.
-    void* entry = *src;
-    if (retain_entry(entry, g1h)) {
-      // Found keeper.  Search high to low for an entry to discard.
-      while (src < --dst) {
-        if (!retain_entry(*dst, g1h)) {
-          *dst = entry;         // Replace discard with keeper.
-          break;
-        }
-      }
-      // If discard search failed (src == dst), the outer loop will also end.
-    }
-  }
-  // dst points to the lowest retained entry, or the end of the buffer
-  // if all the entries were filtered out.
-  set_index(dst - buf);
-}
-
-// This method will first apply the above filtering to the buffer. If
-// post-filtering a large enough chunk of the buffer has been cleared
-// we can re-use the buffer (instead of enqueueing it) and we can just
-// allow the mutator to carry on executing using the same buffer
-// instead of replacing it.
+// This method will first apply filtering to the buffer. If filtering
+// retains a small enough collection in the buffer, we can continue to
+// use the buffer as-is, instead of enqueueing and replacing it.
 
 bool SATBMarkQueue::should_enqueue_buffer() {
   assert(_lock == NULL || _lock->owned_by_self(),
@@ -198,13 +104,17 @@
 
 SATBMarkQueueSet::SATBMarkQueueSet() :
   PtrQueueSet(),
-  _shared_satb_queue(this, true /* permanent */) { }
+  _shared_satb_queue(this, true /* permanent */),
+  _filter(NULL)
+{}
 
-void SATBMarkQueueSet::initialize(Monitor* cbl_mon, Mutex* fl_lock,
+void SATBMarkQueueSet::initialize(SATBMarkQueueFilter* filter,
+                                  Monitor* cbl_mon, Mutex* fl_lock,
                                   int process_completed_threshold,
                                   Mutex* lock) {
   PtrQueueSet::initialize(cbl_mon, fl_lock, process_completed_threshold, -1);
   _shared_satb_queue.set_lock(lock);
+  _filter = filter;
 }
 
 void SATBMarkQueueSet::handle_zero_index_for_thread(JavaThread* t) {
--- a/src/hotspot/share/gc/g1/satbMarkQueue.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/g1/satbMarkQueue.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -47,11 +47,15 @@
 
 private:
   // Filter out unwanted entries from the buffer.
-  void filter();
+  inline void filter();
 
 public:
   SATBMarkQueue(SATBMarkQueueSet* qset, bool permanent = false);
 
+  // Removes entries from the buffer that are no longer needed.
+  template<typename Filter>
+  inline void apply_filter(Filter filter_out);
+
   // Process queue entries and free resources.
   void flush();
 
@@ -86,8 +90,15 @@
 
 };
 
+class SATBMarkQueueFilter : public CHeapObj<mtGC> {
+public:
+  virtual ~SATBMarkQueueFilter() {}
+  virtual void filter(SATBMarkQueue* queue) = 0;
+};
+
 class SATBMarkQueueSet: public PtrQueueSet {
   SATBMarkQueue _shared_satb_queue;
+  SATBMarkQueueFilter* _filter;
 
 #ifdef ASSERT
   void dump_active_states(bool expected_active);
@@ -97,7 +108,8 @@
 public:
   SATBMarkQueueSet();
 
-  void initialize(Monitor* cbl_mon, Mutex* fl_lock,
+  void initialize(SATBMarkQueueFilter* filter,
+                  Monitor* cbl_mon, Mutex* fl_lock,
                   int process_completed_threshold,
                   Mutex* lock);
 
@@ -109,6 +121,10 @@
   // set itself, has an active value same as expected_active.
   void set_active_all_threads(bool active, bool expected_active);
 
+  void filter(SATBMarkQueue* queue) {
+    _filter->filter(queue);
+  }
+
   // Filter all the currently-active SATB buffers.
   void filter_thread_buffers();
 
@@ -129,4 +145,45 @@
   void abandon_partial_marking();
 };
 
+inline void SATBMarkQueue::filter() {
+  static_cast<SATBMarkQueueSet*>(qset())->filter(this);
+}
+
+// Removes entries from the buffer that are no longer needed, as
+// determined by filter. If e is a void* entry in the buffer,
+// filter_out(e) must be a valid expression whose value is convertible
+// to bool. Entries are removed (filtered out) if the result is true,
+// retained if false.
+template<typename Filter>
+inline void SATBMarkQueue::apply_filter(Filter filter_out) {
+  void** buf = this->_buf;
+
+  if (buf == NULL) {
+    // nothing to do
+    return;
+  }
+
+  // Two-fingered compaction toward the end.
+  void** src = &buf[this->index()];
+  void** dst = &buf[this->capacity()];
+  assert(src <= dst, "invariant");
+  for ( ; src < dst; ++src) {
+    // Search low to high for an entry to keep.
+    void* entry = *src;
+    if (!filter_out(entry)) {
+      // Found keeper.  Search high to low for an entry to discard.
+      while (src < --dst) {
+        if (filter_out(*dst)) {
+          *dst = entry;         // Replace discard with keeper.
+          break;
+        }
+      }
+      // If discard search failed (src == dst), the outer loop will also end.
+    }
+  }
+  // dst points to the lowest retained entry, or the end of the buffer
+  // if all the entries were filtered out.
+  this->set_index(dst - buf);
+}
+
 #endif // SHARE_VM_GC_G1_SATBMARKQUEUE_HPP
--- a/src/hotspot/share/gc/parallel/immutableSpace.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/parallel/immutableSpace.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -75,7 +75,7 @@
   HeapWord* t = end();
   HeapWord* prev_p = NULL;
   while (p < t) {
-    oop(p)->verify();
+    oopDesc::verify(oop(p));
     prev_p = p;
     p += oop(p)->size();
   }
--- a/src/hotspot/share/gc/parallel/mutableSpace.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/parallel/mutableSpace.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -250,7 +250,7 @@
   HeapWord* t = top();
   HeapWord* prev_p = NULL;
   while (p < t) {
-    oop(p)->verify();
+    oopDesc::verify(oop(p));
     prev_p = p;
     p += oop(p)->size();
   }
--- a/src/hotspot/share/gc/parallel/pcTasks.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/parallel/pcTasks.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -183,13 +183,12 @@
 
   oop obj = NULL;
   ObjArrayTask task;
-  int random_seed = 17;
   do {
-    while (ParCompactionManager::steal_objarray(which, &random_seed, task)) {
+    while (ParCompactionManager::steal_objarray(which,  task)) {
       cm->follow_contents((objArrayOop)task.obj(), task.index());
       cm->follow_marking_stacks();
     }
-    while (ParCompactionManager::steal(which, &random_seed, obj)) {
+    while (ParCompactionManager::steal(which, obj)) {
       cm->follow_contents(obj);
       cm->follow_marking_stacks();
     }
@@ -217,10 +216,9 @@
   guarantee(cm->region_stack()->is_empty(), "Not empty");
 
   size_t region_index = 0;
-  int random_seed = 17;
 
   while(true) {
-    if (ParCompactionManager::steal(which, &random_seed, region_index)) {
+    if (ParCompactionManager::steal(which, region_index)) {
       PSParallelCompact::fill_and_update_region(cm, region_index);
       cm->drain_region_stacks();
     } else {
--- a/src/hotspot/share/gc/parallel/psCompactionManager.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/parallel/psCompactionManager.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -159,9 +159,9 @@
   // Access function for compaction managers
   static ParCompactionManager* gc_thread_compaction_manager(uint index);
 
-  static bool steal(int queue_num, int* seed, oop& t);
-  static bool steal_objarray(int queue_num, int* seed, ObjArrayTask& t);
-  static bool steal(int queue_num, int* seed, size_t& region);
+  static bool steal(int queue_num, oop& t);
+  static bool steal_objarray(int queue_num, ObjArrayTask& t);
+  static bool steal(int queue_num, size_t& region);
 
   // Process tasks remaining on any marking stack
   void follow_marking_stacks();
--- a/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -37,16 +37,16 @@
 #include "utilities/debug.hpp"
 #include "utilities/globalDefinitions.hpp"
 
-inline bool ParCompactionManager::steal(int queue_num, int* seed, oop& t) {
-  return stack_array()->steal(queue_num, seed, t);
+inline bool ParCompactionManager::steal(int queue_num, oop& t) {
+  return stack_array()->steal(queue_num, t);
 }
 
-inline bool ParCompactionManager::steal_objarray(int queue_num, int* seed, ObjArrayTask& t) {
-  return _objarray_queues->steal(queue_num, seed, t);
+inline bool ParCompactionManager::steal_objarray(int queue_num, ObjArrayTask& t) {
+  return _objarray_queues->steal(queue_num, t);
 }
 
-inline bool ParCompactionManager::steal(int queue_num, int* seed, size_t& region) {
-  return region_array()->steal(queue_num, seed, region);
+inline bool ParCompactionManager::steal(int queue_num, size_t& region) {
+  return region_array()->steal(queue_num, region);
 }
 
 inline void ParCompactionManager::push(oop obj) {
--- a/src/hotspot/share/gc/parallel/psPromotionManager.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/parallel/psPromotionManager.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -158,7 +158,7 @@
 
 void
 PSPromotionManager::print_taskqueue_stats() {
-  if (!log_develop_is_enabled(Trace, gc, task, stats)) {
+  if (!log_is_enabled(Trace, gc, task, stats)) {
     return;
   }
   Log(gc, task, stats) log;
--- a/src/hotspot/share/gc/parallel/psPromotionManager.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/parallel/psPromotionManager.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -159,7 +159,7 @@
   static PSPromotionManager* gc_thread_promotion_manager(uint index);
   static PSPromotionManager* vm_thread_promotion_manager();
 
-  static bool steal_depth(int queue_num, int* seed, StarTask& t);
+  static bool steal_depth(int queue_num, StarTask& t);
 
   PSPromotionManager();
 
--- a/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -322,8 +322,8 @@
   }
 }
 
-inline bool PSPromotionManager::steal_depth(int queue_num, int* seed, StarTask& t) {
-  return stack_array_depth()->steal(queue_num, seed, t);
+inline bool PSPromotionManager::steal_depth(int queue_num, StarTask& t) {
+  return stack_array_depth()->steal(queue_num, t);
 }
 
 #if TASKQUEUE_STATS
--- a/src/hotspot/share/gc/parallel/psTasks.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/parallel/psTasks.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -141,10 +141,9 @@
   guarantee(pm->stacks_empty(),
             "stacks should be empty at this point");
 
-  int random_seed = 17;
   while(true) {
     StarTask p;
-    if (PSPromotionManager::steal_depth(which, &random_seed, p)) {
+    if (PSPromotionManager::steal_depth(which, p)) {
       TASKQUEUE_STATS_ONLY(pm->record_steal(p));
       pm->process_popped_location_depth(p);
       pm->drain_stacks_depth(true);
--- a/src/hotspot/share/gc/shared/gcConfig.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/shared/gcConfig.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -226,6 +226,15 @@
   return "unknown gc";
 }
 
+const char* GCConfig::hs_err_name(CollectedHeap::Name name) {
+  FOR_EACH_SUPPORTED_GC(gc) {
+    if (gc->_name == name) {
+      return gc->_hs_err_name;
+    }
+  }
+  return "unknown gc";
+}
+
 GCArguments* GCConfig::arguments() {
   assert(_arguments != NULL, "Not initialized");
   return _arguments;
--- a/src/hotspot/share/gc/shared/gcConfig.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/shared/gcConfig.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -50,6 +50,7 @@
   static bool is_gc_selected_ergonomically();
 
   static const char* hs_err_name();
+  static const char* hs_err_name(CollectedHeap::Name name);
 
   static GCArguments* arguments();
 };
--- a/src/hotspot/share/gc/shared/space.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/shared/space.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -461,7 +461,7 @@
   HeapWord* t = top();
   HeapWord* prev_p = NULL;
   while (p < t) {
-    oop(p)->verify();
+    oopDesc::verify(oop(p));
     prev_p = p;
     p += oop(p)->size();
   }
@@ -708,7 +708,7 @@
     }
 
     if (objs == OBJ_SAMPLE_INTERVAL) {
-      oop(p)->verify();
+      oopDesc::verify(oop(p));
       objs = 0;
     } else {
       objs++;
--- a/src/hotspot/share/gc/shared/taskqueue.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/shared/taskqueue.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -111,24 +111,6 @@
 #endif // ASSERT
 #endif // TASKQUEUE_STATS
 
-int TaskQueueSetSuper::randomParkAndMiller(int *seed0) {
-  const int a =      16807;
-  const int m = 2147483647;
-  const int q =     127773;  /* m div a */
-  const int r =       2836;  /* m mod a */
-  assert(sizeof(int) == 4, "I think this relies on that");
-  int seed = *seed0;
-  int hi   = seed / q;
-  int lo   = seed % q;
-  int test = a * lo - r * hi;
-  if (test > 0)
-    seed = test;
-  else
-    seed = test + m;
-  *seed0 = seed;
-  return seed;
-}
-
 ParallelTaskTerminator::
 ParallelTaskTerminator(uint n_threads, TaskQueueSetSuper* queue_set) :
   _n_threads(n_threads),
--- a/src/hotspot/share/gc/shared/taskqueue.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/shared/taskqueue.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -26,6 +26,7 @@
 #define SHARE_VM_GC_SHARED_TASKQUEUE_HPP
 
 #include "memory/allocation.hpp"
+#include "memory/padded.hpp"
 #include "oops/oopsHierarchy.hpp"
 #include "utilities/ostream.hpp"
 #include "utilities/stack.hpp"
@@ -298,12 +299,30 @@
   template<typename Fn> void iterate(Fn fn);
 
 private:
+  DEFINE_PAD_MINUS_SIZE(0, DEFAULT_CACHE_LINE_SIZE, 0);
   // Element array.
   volatile E* _elems;
+
+  DEFINE_PAD_MINUS_SIZE(1, DEFAULT_CACHE_LINE_SIZE, sizeof(E*));
+  // Queue owner local variables. Not to be accessed by other threads.
+
+  static const uint InvalidQueueId = uint(-1);
+  uint _last_stolen_queue_id; // The id of the queue we last stole from
+
+  int _seed; // Current random seed used for selecting a random queue during stealing.
+
+  DEFINE_PAD_MINUS_SIZE(2, DEFAULT_CACHE_LINE_SIZE, sizeof(uint) + sizeof(int));
+public:
+  int next_random_queue_id();
+
+  void set_last_stolen_queue_id(uint id)     { _last_stolen_queue_id = id; }
+  uint last_stolen_queue_id() const          { return _last_stolen_queue_id; }
+  bool is_last_stolen_queue_id_valid() const { return _last_stolen_queue_id != InvalidQueueId; }
+  void invalidate_last_stolen_queue_id()     { _last_stolen_queue_id = InvalidQueueId; }
 };
 
 template<class E, MEMFLAGS F, unsigned int N>
-GenericTaskQueue<E, F, N>::GenericTaskQueue() {
+GenericTaskQueue<E, F, N>::GenericTaskQueue() : _last_stolen_queue_id(InvalidQueueId), _seed(17 /* random number */) {
   assert(sizeof(Age) == sizeof(size_t), "Depends on this.");
 }
 
@@ -348,8 +367,6 @@
 };
 
 class TaskQueueSetSuper {
-protected:
-  static int randomParkAndMiller(int* seed0);
 public:
   // Returns "true" if some TaskQueue in the set contains a task.
   virtual bool peek() = 0;
@@ -367,22 +384,19 @@
   uint _n;
   T** _queues;
 
-  bool steal_best_of_2(uint queue_num, int* seed, E& t);
+  bool steal_best_of_2(uint queue_num, E& t);
 
 public:
-  GenericTaskQueueSet(int n);
+  GenericTaskQueueSet(uint n);
   ~GenericTaskQueueSet();
 
   void register_queue(uint i, T* q);
 
   T* queue(uint n);
 
-  // The thread with queue number "queue_num" (and whose random number seed is
-  // at "seed") is trying to steal a task from some other queue.  (It may try
-  // several queues, according to some configuration parameter.)  If some steal
-  // succeeds, returns "true" and sets "t" to the stolen task, otherwise returns
-  // false.
-  bool steal(uint queue_num, int* seed, E& t);
+  // Try to steal a task from some other queue than queue_num. It may perform several attempts at doing so.
+  // Returns if stealing succeeds, and sets "t" to the stolen task.
+  bool steal(uint queue_num, E& t);
 
   bool peek();
 
--- a/src/hotspot/share/gc/shared/taskqueue.inline.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/shared/taskqueue.inline.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -34,10 +34,10 @@
 #include "utilities/stack.inline.hpp"
 
 template <class T, MEMFLAGS F>
-inline GenericTaskQueueSet<T, F>::GenericTaskQueueSet(int n) : _n(n) {
+inline GenericTaskQueueSet<T, F>::GenericTaskQueueSet(uint n) : _n(n) {
   typedef T* GenericTaskQueuePtr;
   _queues = NEW_C_HEAP_ARRAY(GenericTaskQueuePtr, n, F);
-  for (int i = 0; i < n; i++) {
+  for (uint i = 0; i < n; i++) {
     _queues[i] = NULL;
   }
 }
@@ -227,18 +227,71 @@
   return resAge == oldAge;
 }
 
+inline int randomParkAndMiller(int *seed0) {
+  const int a =      16807;
+  const int m = 2147483647;
+  const int q =     127773;  /* m div a */
+  const int r =       2836;  /* m mod a */
+  STATIC_ASSERT(sizeof(int) == 4);
+  int seed = *seed0;
+  int hi   = seed / q;
+  int lo   = seed % q;
+  int test = a * lo - r * hi;
+  if (test > 0) {
+    seed = test;
+  } else {
+    seed = test + m;
+  }
+  *seed0 = seed;
+  return seed;
+}
+
+template<class E, MEMFLAGS F, unsigned int N>
+int GenericTaskQueue<E, F, N>::next_random_queue_id() {
+  return randomParkAndMiller(&_seed);
+}
+
 template<class T, MEMFLAGS F> bool
-GenericTaskQueueSet<T, F>::steal_best_of_2(uint queue_num, int* seed, E& t) {
+GenericTaskQueueSet<T, F>::steal_best_of_2(uint queue_num, E& t) {
   if (_n > 2) {
+    T* const local_queue = _queues[queue_num];
     uint k1 = queue_num;
-    while (k1 == queue_num) k1 = TaskQueueSetSuper::randomParkAndMiller(seed) % _n;
+
+    if (local_queue->is_last_stolen_queue_id_valid()) {
+      k1 = local_queue->last_stolen_queue_id();
+      assert(k1 != queue_num, "Should not be the same");
+    } else {
+      while (k1 == queue_num) {
+        k1 = local_queue->next_random_queue_id() % _n;
+      }
+    }
+
     uint k2 = queue_num;
-    while (k2 == queue_num || k2 == k1) k2 = TaskQueueSetSuper::randomParkAndMiller(seed) % _n;
+    while (k2 == queue_num || k2 == k1) {
+      k2 = local_queue->next_random_queue_id() % _n;
+    }
     // Sample both and try the larger.
     uint sz1 = _queues[k1]->size();
     uint sz2 = _queues[k2]->size();
-    if (sz2 > sz1) return _queues[k2]->pop_global(t);
-    else return _queues[k1]->pop_global(t);
+
+    uint sel_k = 0;
+    bool suc = false;
+
+    if (sz2 > sz1) {
+      sel_k = k2;
+      suc = _queues[k2]->pop_global(t);
+    } else if (sz1 > 0) {
+      sel_k = k1;
+      suc = _queues[k1]->pop_global(t);
+    }
+
+    if (suc) {
+      local_queue->set_last_stolen_queue_id(sel_k);
+    } else {
+      local_queue->invalidate_last_stolen_queue_id();
+    }
+
+    return suc;
   } else if (_n == 2) {
     // Just try the other one.
     uint k = (queue_num + 1) % 2;
@@ -250,10 +303,10 @@
 }
 
 template<class T, MEMFLAGS F> bool
-GenericTaskQueueSet<T, F>::steal(uint queue_num, int* seed, E& t) {
+GenericTaskQueueSet<T, F>::steal(uint queue_num, E& t) {
   for (uint i = 0; i < 2 * _n; i++) {
     TASKQUEUE_STATS_ONLY(queue(queue_num)->stats.record_steal_attempt());
-    if (steal_best_of_2(queue_num, seed, t)) {
+    if (steal_best_of_2(queue_num, t)) {
       TASKQUEUE_STATS_ONLY(queue(queue_num)->stats.record_steal());
       return true;
     }
--- a/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -311,7 +311,7 @@
   HeapWord* t = top();
   HeapWord* prev_p = NULL;
   while (p < t) {
-    oop(p)->verify();
+    oopDesc::verify(oop(p));
     prev_p = p;
     p += oop(p)->size();
   }
--- a/src/hotspot/share/interpreter/interpreterRuntime.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -435,6 +435,7 @@
 
 
 IRT_ENTRY(void, InterpreterRuntime::create_klass_exception(JavaThread* thread, char* name, oopDesc* obj))
+  // Produce the error message first because note_trap can safepoint
   ResourceMark rm(thread);
   const char* klass_name = obj->klass()->external_name();
   // lookup exception klass
@@ -448,20 +449,22 @@
 IRT_END
 
 IRT_ENTRY(void, InterpreterRuntime::throw_ArrayIndexOutOfBoundsException(JavaThread* thread, arrayOopDesc* a, jint index))
+  // Produce the error message first because note_trap can safepoint
+  ResourceMark rm(thread);
+  stringStream ss;
+  ss.print("Index %d out of bounds for length %d", index, a->length());
+
   if (ProfileTraps) {
     note_trap(thread, Deoptimization::Reason_range_check, CHECK);
   }
 
-  ResourceMark rm(thread);
-  stringStream ss;
-  ss.print("Index %d out of bounds for length %d", index, a->length());
-
   THROW_MSG(vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), ss.as_string());
 IRT_END
 
 IRT_ENTRY(void, InterpreterRuntime::throw_ClassCastException(
   JavaThread* thread, oopDesc* obj))
 
+  // Produce the error message first because note_trap can safepoint
   ResourceMark rm(thread);
   char* message = SharedRuntime::generate_class_cast_message(
     thread, obj->klass());
--- a/src/hotspot/share/jfr/periodic/sampling/jfrCallTrace.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/jfr/periodic/sampling/jfrCallTrace.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -50,7 +50,7 @@
       const bool known_valid = (state == _thread_in_native || state == _thread_in_vm || state == _thread_blocked);
       if (known_valid || candidate.is_interpreted_frame_valid(_thread)) {
         Method* im = candidate.interpreter_frame_method();
-        if (known_valid && !im->is_valid_method()) {
+        if (known_valid && !Method::is_valid_method(im)) {
           return false;
         }
         *method = im;
--- a/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTraceRepository.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTraceRepository.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -431,7 +431,7 @@
       break;
     }
     const Method* method = st.method();
-    if (!method->is_valid_method()) {
+    if (!Method::is_valid_method(method)) {
       // we throw away everything we've gathered in this sample since
       // none of it is safe
       return false;
--- a/src/hotspot/share/jvmci/jvmciRuntime.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/jvmci/jvmciRuntime.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -715,7 +715,7 @@
   if (JVMCIRuntime::_well_known_classes_initialized == false) {
     guarantee(can_initialize_JVMCI(), "VM is not yet sufficiently booted to initialize JVMCI");
     SystemDictionary::WKID scan = SystemDictionary::FIRST_JVMCI_WKID;
-    SystemDictionary::initialize_wk_klasses_through(SystemDictionary::LAST_JVMCI_WKID, scan, CHECK);
+    SystemDictionary::resolve_wk_klasses_through(SystemDictionary::LAST_JVMCI_WKID, scan, CHECK);
     JVMCIJavaClasses::compute_offsets(CHECK);
     JVMCIRuntime::_well_known_classes_initialized = true;
   }
--- a/src/hotspot/share/memory/allocation.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/memory/allocation.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -113,29 +113,30 @@
  */
 enum MemoryType {
   // Memory type by sub systems. It occupies lower byte.
-  mtJavaHeap          = 0x00,  // Java heap
-  mtClass             = 0x01,  // memory class for Java classes
-  mtThread            = 0x02,  // memory for thread objects
-  mtThreadStack       = 0x03,
-  mtCode              = 0x04,  // memory for generated code
-  mtGC                = 0x05,  // memory for GC
-  mtCompiler          = 0x06,  // memory for compiler
-  mtInternal          = 0x07,  // memory used by VM, but does not belong to
-                                 // any of above categories, and not used for
-                                 // native memory tracking
-  mtOther             = 0x08,  // memory not used by VM
-  mtSymbol            = 0x09,  // symbol
-  mtNMT               = 0x0A,  // memory used by native memory tracking
-  mtClassShared       = 0x0B,  // class data sharing
-  mtChunk             = 0x0C,  // chunk that holds content of arenas
-  mtTest              = 0x0D,  // Test type for verifying NMT
-  mtTracing           = 0x0E,  // memory used for Tracing
-  mtLogging           = 0x0F,  // memory for logging
-  mtArguments         = 0x10,  // memory for argument processing
-  mtModule            = 0x11,  // memory for module processing
-  mtNone              = 0x12,  // undefined
-  mt_number_of_types  = 0x13   // number of memory types (mtDontTrack
-                                 // is not included as validate type)
+  mtJavaHeap,          // Java heap
+  mtClass,             // memory class for Java classes
+  mtThread,            // memory for thread objects
+  mtThreadStack,
+  mtCode,              // memory for generated code
+  mtGC,                // memory for GC
+  mtCompiler,          // memory for compiler
+  mtInternal,          // memory used by VM, but does not belong to
+                       // any of above categories, and not used for
+                       // native memory tracking
+  mtOther,             // memory not used by VM
+  mtSymbol,            // symbol
+  mtNMT,               // memory used by native memory tracking
+  mtClassShared,       // class data sharing
+  mtChunk,             // chunk that holds content of arenas
+  mtTest,              // Test type for verifying NMT
+  mtTracing,           // memory used for Tracing
+  mtLogging,           // memory for logging
+  mtArguments,         // memory for argument processing
+  mtModule,            // memory for module processing
+  mtSafepoint,         // memory for safepoint support
+  mtNone,              // undefined
+  mt_number_of_types   // number of memory types (mtDontTrack
+                       // is not included as validate type)
 };
 
 typedef MemoryType MEMFLAGS;
--- a/src/hotspot/share/oops/instanceKlass.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/oops/instanceKlass.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -3072,7 +3072,7 @@
   st->print(BULLET"access:            "); access_flags().print_on(st);            st->cr();
   st->print(BULLET"state:             "); st->print_cr("%s", state_names[_init_state]);
   st->print(BULLET"name:              "); name()->print_value_on(st);             st->cr();
-  st->print(BULLET"super:             "); super()->print_value_on_maybe_null(st); st->cr();
+  st->print(BULLET"super:             "); Metadata::print_value_on_maybe_null(st, super()); st->cr();
   st->print(BULLET"sub:               ");
   Klass* sub = subklass();
   int n;
@@ -3095,7 +3095,7 @@
     }
   }
 
-  st->print(BULLET"arrays:            "); array_klasses()->print_value_on_maybe_null(st); st->cr();
+  st->print(BULLET"arrays:            "); Metadata::print_value_on_maybe_null(st, array_klasses()); st->cr();
   st->print(BULLET"methods:           "); methods()->print_value_on(st);                  st->cr();
   if (Verbose || WizardMode) {
     Array<Method*>* method_array = methods();
@@ -3122,7 +3122,7 @@
     class_loader_data()->print_value_on(st);
     st->cr();
   }
-  st->print(BULLET"host class:        "); host_klass()->print_value_on_maybe_null(st); st->cr();
+  st->print(BULLET"host class:        "); Metadata::print_value_on_maybe_null(st, host_klass()); st->cr();
   if (source_file_name() != NULL) {
     st->print(BULLET"source file:       ");
     source_file_name()->print_value_on(st);
@@ -3158,7 +3158,13 @@
   }
   st->print(BULLET"inner classes:     "); inner_classes()->print_value_on(st);     st->cr();
   st->print(BULLET"nest members:     "); nest_members()->print_value_on(st);     st->cr();
-  st->print(BULLET"java mirror:       "); java_mirror()->print_value_on(st);       st->cr();
+  if (java_mirror() != NULL) {
+    st->print(BULLET"java mirror:       ");
+    java_mirror()->print_value_on(st);
+    st->cr();
+  } else {
+    st->print_cr(BULLET"java mirror:       NULL");
+  }
   st->print(BULLET"vtable length      %d  (start addr: " INTPTR_FORMAT ")", vtable_length(), p2i(start_of_vtable())); st->cr();
   if (vtable_length() > 0 && (Verbose || WizardMode))  print_vtable(start_of_vtable(), vtable_length(), st);
   st->print(BULLET"itable length      %d (start addr: " INTPTR_FORMAT ")", itable_length(), p2i(start_of_itable())); st->cr();
@@ -3229,11 +3235,11 @@
     st->cr();
     Klass* mirrored_klass = java_lang_Class::as_Klass(obj);
     st->print(BULLET"fake entry for mirror: ");
-    mirrored_klass->print_value_on_maybe_null(st);
+    Metadata::print_value_on_maybe_null(st, mirrored_klass);
     st->cr();
     Klass* array_klass = java_lang_Class::array_klass_acquire(obj);
     st->print(BULLET"fake entry for array: ");
-    array_klass->print_value_on_maybe_null(st);
+    Metadata::print_value_on_maybe_null(st, array_klass);
     st->cr();
     st->print_cr(BULLET"fake entry for oop_size: %d", java_lang_Class::oop_size(obj));
     st->print_cr(BULLET"fake entry for static_oop_field_count: %d", java_lang_Class::static_oop_field_count(obj));
--- a/src/hotspot/share/oops/metadata.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/oops/metadata.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -56,18 +56,11 @@
   void print()       const { print_on(tty); }
   void print_value() const { print_value_on(tty); }
 
-  void print_maybe_null() const { print_on_maybe_null(tty); }
-  void print_on_maybe_null(outputStream* st) const {
-    if (this == NULL)
+  static void print_value_on_maybe_null(outputStream* st, const Metadata* m) {
+    if (NULL == m)
       st->print("NULL");
     else
-      print_on(st);
-  }
-  void print_value_on_maybe_null(outputStream* st) const {
-    if (this == NULL)
-      st->print("NULL");
-    else
-      print_value_on(st);
+      m->print_value_on(st);
   }
 
   virtual void print_on(outputStream* st) const;       // First level print
--- a/src/hotspot/share/oops/method.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/oops/method.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -1095,7 +1095,7 @@
 }
 
 void Method::restore_unshareable_info(TRAPS) {
-  assert(is_method() && is_valid_method(), "ensure C++ vtable is restored");
+  assert(is_method() && is_valid_method(this), "ensure C++ vtable is restored");
 
   // Since restore_unshareable_info can be called more than once for a method, don't
   // redo any work.
@@ -2166,16 +2166,16 @@
 }
 
 // Check that this pointer is valid by checking that the vtbl pointer matches
-bool Method::is_valid_method() const {
-  if (this == NULL) {
+bool Method::is_valid_method(const Method* m) {
+  if (m == NULL) {
     return false;
-  } else if ((intptr_t(this) & (wordSize-1)) != 0) {
+  } else if ((intptr_t(m) & (wordSize-1)) != 0) {
     // Quick sanity check on pointer.
     return false;
-  } else if (is_shared()) {
-    return MetaspaceShared::is_valid_shared_method(this);
-  } else if (Metaspace::contains_non_shared(this)) {
-    return has_method_vptr((const void*)this);
+  } else if (m->is_shared()) {
+    return MetaspaceShared::is_valid_shared_method(m);
+  } else if (Metaspace::contains_non_shared(m)) {
+    return has_method_vptr((const void*)m);
   } else {
     return false;
   }
--- a/src/hotspot/share/oops/method.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/oops/method.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -984,7 +984,7 @@
 
   // Check for valid method pointer
   static bool has_method_vptr(const void* ptr);
-  bool is_valid_method() const;
+  static bool is_valid_method(const Method* m);
 
   // Verify
   void verify() { verify_on(tty); }
--- a/src/hotspot/share/oops/objArrayKlass.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/oops/objArrayKlass.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -477,8 +477,12 @@
   int print_len = MIN2((intx) oa->length(), MaxElementPrintSize);
   for(int index = 0; index < print_len; index++) {
     st->print(" - %3d : ", index);
-    oa->obj_at(index)->print_value_on(st);
-    st->cr();
+    if (oa->obj_at(index) != NULL) {
+      oa->obj_at(index)->print_value_on(st);
+      st->cr();
+    } else {
+      st->print_cr("NULL");
+    }
   }
   int remaining = oa->length() - print_len;
   if (remaining > 0) {
@@ -494,7 +498,11 @@
   element_klass()->print_value_on(st);
   int len = objArrayOop(obj)->length();
   st->print("[%d] ", len);
-  obj->print_address_on(st);
+  if (obj != NULL) {
+    obj->print_address_on(st);
+  } else {
+    st->print_cr("NULL");
+  }
 }
 
 const char* ObjArrayKlass::internal_name() const {
--- a/src/hotspot/share/oops/oop.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/oops/oop.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -36,11 +36,7 @@
 bool always_do_update_barrier = false;
 
 void oopDesc::print_on(outputStream* st) const {
-  if (this == NULL) {
-    st->print_cr("NULL");
-  } else {
-    klass()->oop_print_on(oop(this), st);
-  }
+  klass()->oop_print_on(oop(this), st);
 }
 
 void oopDesc::print_address_on(outputStream* st) const {
@@ -71,9 +67,7 @@
 
 void oopDesc::print_value_on(outputStream* st) const {
   oop obj = oop(this);
-  if (this == NULL) {
-    st->print("NULL");
-  } else if (java_lang_String::is_instance(obj)) {
+  if (java_lang_String::is_instance(obj)) {
     java_lang_String::print(obj, st);
     print_address_on(st);
   } else {
@@ -82,15 +76,15 @@
 }
 
 
-void oopDesc::verify_on(outputStream* st) {
-  if (this != NULL) {
-    klass()->oop_verify_on(this, st);
+void oopDesc::verify_on(outputStream* st, oopDesc* oop_desc) {
+  if (oop_desc != NULL) {
+    oop_desc->klass()->oop_verify_on(oop_desc, st);
   }
 }
 
 
-void oopDesc::verify() {
-  verify_on(tty);
+void oopDesc::verify(oopDesc* oop_desc) {
+  verify_on(tty, oop_desc);
 }
 
 intptr_t oopDesc::slow_identity_hash() {
--- a/src/hotspot/share/oops/oop.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/oops/oop.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -226,8 +226,8 @@
   void release_address_field_put(int offset, address contents);
 
   // printing functions for VM debugging
-  void print_on(outputStream* st) const;         // First level print
-  void print_value_on(outputStream* st) const;   // Second level print.
+  void print_on(outputStream* st) const;        // First level print
+  void print_value_on(outputStream* st) const;  // Second level print.
   void print_address_on(outputStream* st) const; // Address printing
 
   // printing on default output stream
@@ -240,8 +240,8 @@
   char* print_value_string();
 
   // verification operations
-  void verify_on(outputStream* st);
-  void verify();
+  static void verify_on(outputStream* st, oopDesc* oop_desc);
+  static void verify(oopDesc* oopDesc);
 
   // locking operations
   inline bool is_locked()   const;
--- a/src/hotspot/share/oops/symbol.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/oops/symbol.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,11 +34,22 @@
 #include "runtime/atomic.hpp"
 #include "runtime/os.hpp"
 
+uint32_t Symbol::pack_length_and_refcount(int length, int refcount) {
+  STATIC_ASSERT(max_symbol_length == ((1 << 16) - 1));
+  STATIC_ASSERT(PERM_REFCOUNT == ((1 << 16) - 1));
+  assert(length >= 0, "negative length");
+  assert(length <= max_symbol_length, "too long symbol");
+  assert(refcount >= 0, "negative refcount");
+  assert(refcount <= PERM_REFCOUNT, "invalid refcount");
+  uint32_t hi = length;
+  uint32_t lo = refcount;
+  return (hi << 16) | lo;
+}
+
 Symbol::Symbol(const u1* name, int length, int refcount) {
-  _refcount = refcount;
-  _length = length;
+  _length_and_refcount =  pack_length_and_refcount(length, refcount);
   _identity_hash = (short)os::random();
-  for (int i = 0; i < _length; i++) {
+  for (int i = 0; i < length; i++) {
     byte_at_put(i, name[i]);
   }
 }
@@ -207,26 +218,68 @@
   return AltHashing::murmur3_32(seed, (const jbyte*)as_C_string(), utf8_length());
 }
 
-void Symbol::increment_refcount() {
-  // Only increment the refcount if non-negative.  If negative either
-  // overflow has occurred or it is a permanent symbol in a read only
-  // shared archive.
-  if (_refcount >= 0) { // not a permanent symbol
-    Atomic::inc(&_refcount);
-    NOT_PRODUCT(Atomic::inc(&_total_count);)
+// Increment refcount while checking for zero.  If the Symbol's refcount becomes zero
+// a thread could be concurrently removing the Symbol.  This is used during SymbolTable
+// lookup to avoid reviving a dead Symbol.
+bool Symbol::try_increment_refcount() {
+  uint32_t found = _length_and_refcount;
+  while (true) {
+    uint32_t old_value = found;
+    int refc = extract_refcount(old_value);
+    if (refc == PERM_REFCOUNT) {
+      return true;  // sticky max or created permanent
+    } else if (refc == 0) {
+      return false; // dead, can't revive.
+    } else {
+      found = Atomic::cmpxchg(old_value + 1, &_length_and_refcount, old_value);
+      if (found == old_value) {
+        return true; // successfully updated.
+      }
+      // refcount changed, try again.
+    }
   }
 }
 
+// The increment_refcount() is called when not doing lookup. It is assumed that you
+// have a symbol with a non-zero refcount and it can't become zero while referenced by
+// this caller.
+void Symbol::increment_refcount() {
+  if (!try_increment_refcount()) {
+#ifdef ASSERT
+    print();
+    fatal("refcount has gone to zero");
+#endif
+  }
+#ifndef PRODUCT
+  if (refcount() != PERM_REFCOUNT) { // not a permanent symbol
+    NOT_PRODUCT(Atomic::inc(&_total_count);)
+  }
+#endif
+}
+
+// Decrement refcount potentially while racing increment, so we need
+// to check the value after attempting to decrement so that if another
+// thread increments to PERM_REFCOUNT the value is not decremented.
 void Symbol::decrement_refcount() {
-  if (_refcount >= 0) { // not a permanent symbol
-    short new_value = Atomic::add(short(-1), &_refcount);
+  uint32_t found = _length_and_refcount;
+  while (true) {
+    uint32_t old_value = found;
+    int refc = extract_refcount(old_value);
+    if (refc == PERM_REFCOUNT) {
+      return;  // refcount is permanent, permanent is sticky
+    } else if (refc == 0) {
 #ifdef ASSERT
-    if (new_value == -1) { // we have transitioned from 0 -> -1
       print();
-      assert(false, "reference count underflow for symbol");
+      fatal("refcount underflow");
+#endif
+      return;
+    } else {
+      found = Atomic::cmpxchg(old_value - 1, &_length_and_refcount, old_value);
+      if (found == old_value) {
+        return;  // successfully updated.
+      }
+      // refcount changed, try again.
     }
-#endif
-    (void)new_value;
   }
 }
 
--- a/src/hotspot/share/oops/symbol.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/oops/symbol.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -96,9 +96,9 @@
 // type without virtual functions.
 class ClassLoaderData;
 
-// Set _refcount to PERM_REFCOUNT to prevent the Symbol from being GC'ed.
+// Set _refcount to PERM_REFCOUNT to prevent the Symbol from being freed.
 #ifndef PERM_REFCOUNT
-#define PERM_REFCOUNT -1
+#define PERM_REFCOUNT ((1 << 16) - 1)
 #endif
 
 class Symbol : public MetaspaceObj {
@@ -107,15 +107,15 @@
   friend class MoveSymbols;
 
  private:
-  ATOMIC_SHORT_PAIR(
-    volatile short _refcount,  // needs atomic operation
-    unsigned short _length     // number of UTF8 characters in the symbol (does not need atomic op)
-  );
+
+  // This is an int because it needs atomic operation on the refcount.  Mask length
+  // in high half word. length is the number of UTF8 characters in the symbol
+  volatile uint32_t _length_and_refcount;
   short _identity_hash;
   jbyte _body[2];
 
   enum {
-    // max_symbol_length is constrained by type of _length
+    // max_symbol_length must fit into the top 16 bits of _length_and_refcount
     max_symbol_length = (1 << 16) -1
   };
 
@@ -129,7 +129,7 @@
   }
 
   void byte_at_put(int index, int value) {
-    assert(index >=0 && index < _length, "symbol index overflow");
+    assert(index >=0 && index < length(), "symbol index overflow");
     _body[index] = value;
   }
 
@@ -140,6 +140,12 @@
 
   void  operator delete(void* p);
 
+  static int extract_length(uint32_t value)   { return value >> 16; }
+  static int extract_refcount(uint32_t value) { return value & 0xffff; }
+  static uint32_t pack_length_and_refcount(int length, int refcount);
+
+  int length() const   { return extract_length(_length_and_refcount); }
+
  public:
   // Low-level access (used with care, since not GC-safe)
   const jbyte* base() const { return &_body[0]; }
@@ -155,28 +161,29 @@
   unsigned identity_hash() const {
     unsigned addr_bits = (unsigned)((uintptr_t)this >> (LogMinObjAlignmentInBytes + 3));
     return ((unsigned)_identity_hash & 0xffff) |
-           ((addr_bits ^ (_length << 8) ^ (( _body[0] << 8) | _body[1])) << 16);
+           ((addr_bits ^ (length() << 8) ^ (( _body[0] << 8) | _body[1])) << 16);
   }
 
   // For symbol table alternate hashing
   unsigned int new_hash(juint seed);
 
   // Reference counting.  See comments above this class for when to use.
-  int refcount() const      { return _refcount; }
+  int refcount() const { return extract_refcount(_length_and_refcount); }
+  bool try_increment_refcount();
   void increment_refcount();
   void decrement_refcount();
   bool is_permanent() {
-    return (_refcount == PERM_REFCOUNT);
+    return (refcount() == PERM_REFCOUNT);
   }
 
   int byte_at(int index) const {
-    assert(index >=0 && index < _length, "symbol index overflow");
+    assert(index >=0 && index < length(), "symbol index overflow");
     return base()[index];
   }
 
   const jbyte* bytes() const { return base(); }
 
-  int utf8_length() const { return _length; }
+  int utf8_length() const { return length(); }
 
   // Compares the symbol with a string.
   bool equals(const char* str, int len) const {
--- a/src/hotspot/share/prims/forte.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/prims/forte.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -248,7 +248,7 @@
     // a valid method. Then again we may have caught an interpreter
     // frame in the middle of construction and the bci field is
     // not yet valid.
-    if (!method->is_valid_method()) return false;
+    if (!Method::is_valid_method(method)) return false;
     *method_p = method; // If the Method* found is invalid, it is
                         // ignored by forte_fill_call_trace_given_top().
                         // So set method_p only if the Method is valid.
@@ -434,7 +434,7 @@
   // Check if a Java Method has been found.
   if (method == NULL) return;
 
-  if (!method->is_valid_method()) {
+  if (!Method::is_valid_method(method)) {
     trace->num_frames = ticks_GC_active; // -2
     return;
   }
@@ -445,7 +445,7 @@
     bci = st.bci();
     method = st.method();
 
-    if (!method->is_valid_method()) {
+    if (!Method::is_valid_method(method)) {
       // we throw away everything we've gathered in this sample since
       // none of it is safe
       trace->num_frames = ticks_GC_active; // -2
--- a/src/hotspot/share/prims/jvmti.xsl	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/prims/jvmti.xsl	Fri Aug 03 12:52:58 2018 -0700
@@ -59,10 +59,10 @@
         </style>
   </head>
   <body>
-    <div class="centered">
+    <div class="centered" role="banner">
       <xsl:apply-templates select="title"/>
     </div>
-    <ul>
+    <ul role="navigation">
       <li>
         <a href="#SpecificationIntro"><b>Introduction</b></a>
         <ul>
@@ -167,6 +167,7 @@
       </li>
     </ul>
     <!-- end table of contents, begin body -->
+    <div role="main">
     <div class="sep"/>
     <hr class="thick"/>
     <div class="sep"/>
@@ -202,6 +203,7 @@
     </xsl:if>
     <p id="ChangeHistory"/>
       <xsl:apply-templates select="changehistory"/>
+    </div>
   </body>
 </html>
 </xsl:template>
--- a/src/hotspot/share/prims/whitebox.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/prims/whitebox.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -1785,6 +1785,14 @@
 WB_END
 
 
+WB_ENTRY(jboolean, WB_IsJFRIncludedInVmBuild(JNIEnv* env))
+#if INCLUDE_JFR
+  return true;
+#else
+  return false;
+#endif // INCLUDE_JFR
+WB_END
+
 #if INCLUDE_CDS
 
 WB_ENTRY(jint, WB_GetOffsetForName(JNIEnv* env, jobject o, jstring name))
@@ -2163,6 +2171,7 @@
   {CC"getResolvedReferences", CC"(Ljava/lang/Class;)Ljava/lang/Object;", (void*)&WB_GetResolvedReferences},
   {CC"areOpenArchiveHeapObjectsMapped",   CC"()Z",    (void*)&WB_AreOpenArchiveHeapObjectsMapped},
   {CC"isCDSIncludedInVmBuild",            CC"()Z",    (void*)&WB_IsCDSIncludedInVmBuild },
+  {CC"isJFRIncludedInVmBuild",            CC"()Z",    (void*)&WB_IsJFRIncludedInVmBuild },
   {CC"isJavaHeapArchiveSupported",      CC"()Z",      (void*)&WB_IsJavaHeapArchiveSupported },
 
   {CC"clearInlineCaches0",  CC"(Z)V",                 (void*)&WB_ClearInlineCaches },
--- a/src/hotspot/share/runtime/fieldDescriptor.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/runtime/fieldDescriptor.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -188,12 +188,20 @@
     case T_ARRAY:
       st->print(" ");
       NOT_LP64(as_int = obj->int_field(offset()));
-      obj->obj_field(offset())->print_value_on(st);
+      if (obj->obj_field(offset()) != NULL) {
+        obj->obj_field(offset())->print_value_on(st);
+      } else {
+        st->print_cr("NULL");
+      }
       break;
     case T_OBJECT:
       st->print(" ");
       NOT_LP64(as_int = obj->int_field(offset()));
-      obj->obj_field(offset())->print_value_on(st);
+      if (obj->obj_field(offset()) != NULL) {
+        obj->obj_field(offset())->print_value_on(st);
+      } else {
+        st->print_cr("NULL");
+      }
       break;
     default:
       ShouldNotReachHere();
--- a/src/hotspot/share/runtime/jniHandles.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/runtime/jniHandles.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -318,7 +318,7 @@
 class VerifyJNIHandles: public OopClosure {
 public:
   virtual void do_oop(oop* root) {
-    (*root)->verify();
+    oopDesc::verify(*root);
   }
   virtual void do_oop(narrowOop* root) { ShouldNotReachHere(); }
 };
--- a/src/hotspot/share/runtime/objectMonitor.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/runtime/objectMonitor.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -2354,10 +2354,6 @@
   SETKNOB(FastHSSEC);
   #undef SETKNOB
 
-  if (Knob_Verbose) {
-    sanity_checks();
-  }
-
   if (os::is_MP()) {
     BackOffMask = (1 << Knob_SpinBackOff) - 1;
     if (Knob_ReportSettings) {
@@ -2376,70 +2372,3 @@
   InitDone = 1;
 }
 
-void ObjectMonitor::sanity_checks() {
-  int error_cnt = 0;
-  int warning_cnt = 0;
-  bool verbose = Knob_Verbose != 0 NOT_PRODUCT(|| VerboseInternalVMTests);
-
-  if (verbose) {
-    tty->print_cr("INFO: sizeof(ObjectMonitor)=" SIZE_FORMAT,
-                  sizeof(ObjectMonitor));
-    tty->print_cr("INFO: sizeof(PaddedEnd<ObjectMonitor>)=" SIZE_FORMAT,
-                  sizeof(PaddedEnd<ObjectMonitor>));
-  }
-
-  uint cache_line_size = VM_Version::L1_data_cache_line_size();
-  if (verbose) {
-    tty->print_cr("INFO: L1_data_cache_line_size=%u", cache_line_size);
-  }
-
-  ObjectMonitor dummy;
-  u_char *addr_begin  = (u_char*)&dummy;
-  u_char *addr_header = (u_char*)&dummy._header;
-  u_char *addr_owner  = (u_char*)&dummy._owner;
-
-  uint offset_header = (uint)(addr_header - addr_begin);
-  if (verbose) tty->print_cr("INFO: offset(_header)=%u", offset_header);
-
-  uint offset_owner = (uint)(addr_owner - addr_begin);
-  if (verbose) tty->print_cr("INFO: offset(_owner)=%u", offset_owner);
-
-  if ((uint)(addr_header - addr_begin) != 0) {
-    tty->print_cr("ERROR: offset(_header) must be zero (0).");
-    error_cnt++;
-  }
-
-  if (cache_line_size != 0) {
-    // We were able to determine the L1 data cache line size so
-    // do some cache line specific sanity checks
-
-    if ((offset_owner - offset_header) < cache_line_size) {
-      tty->print_cr("WARNING: the _header and _owner fields are closer "
-                    "than a cache line which permits false sharing.");
-      warning_cnt++;
-    }
-
-    if ((sizeof(PaddedEnd<ObjectMonitor>) % cache_line_size) != 0) {
-      tty->print_cr("WARNING: PaddedEnd<ObjectMonitor> size is not a "
-                    "multiple of a cache line which permits false sharing.");
-      warning_cnt++;
-    }
-  }
-
-  ObjectSynchronizer::sanity_checks(verbose, cache_line_size, &error_cnt,
-                                    &warning_cnt);
-
-  if (verbose || error_cnt != 0 || warning_cnt != 0) {
-    tty->print_cr("INFO: error_cnt=%d", error_cnt);
-    tty->print_cr("INFO: warning_cnt=%d", warning_cnt);
-  }
-
-  guarantee(error_cnt == 0,
-            "Fatal error(s) found in ObjectMonitor::sanity_checks()");
-}
-
-#ifndef PRODUCT
-void ObjectMonitor_test() {
-  ObjectMonitor::sanity_checks();
-}
-#endif
--- a/src/hotspot/share/runtime/objectMonitor.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/runtime/objectMonitor.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -103,11 +103,11 @@
 //   coherency misses. There is no single optimal layout for both
 //   single-threaded and multi-threaded environments.
 //
-// - See ObjectMonitor::sanity_checks() for how critical restrictions are
-//   enforced and advisory recommendations are reported.
+// - See TEST_VM(ObjectMonitor, sanity) gtest for how critical restrictions are
+//   enforced.
 // - Adjacent ObjectMonitors should be separated by enough space to avoid
 //   false sharing. This is handled by the ObjectMonitor allocation code
-//   in synchronizer.cpp. Also see ObjectSynchronizer::sanity_checks().
+//   in synchronizer.cpp. Also see TEST_VM(SynchronizerTest, sanity) gtest.
 //
 // Futures notes:
 //   - Separating _owner from the <remaining_fields> by enough space to
@@ -294,8 +294,6 @@
   bool      check(TRAPS);       // true if the thread owns the monitor.
   void      check_slow(TRAPS);
   void      clear();
-  static void sanity_checks();  // public for -XX:+ExecuteInternalVMTests
-                                // in PRODUCT for -XX:SyncKnobs=Verbose=1
 
   void      enter(TRAPS);
   void      exit(bool not_suspended, TRAPS);
--- a/src/hotspot/share/runtime/safepointMechanism.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/runtime/safepointMechanism.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -51,7 +51,7 @@
       const size_t allocation_size = 2 * page_size;
       char* polling_page = os::reserve_memory(allocation_size, NULL, page_size);
       os::commit_memory_or_exit(polling_page, allocation_size, false, "Unable to commit Safepoint polling page");
-      MemTracker::record_virtual_memory_type((address)polling_page, mtInternal);
+      MemTracker::record_virtual_memory_type((address)polling_page, mtSafepoint);
 
       char* bad_page  = polling_page;
       char* good_page = polling_page + page_size;
@@ -76,6 +76,7 @@
     char* polling_page = os::reserve_memory(page_size, NULL, page_size);
     os::commit_memory_or_exit(polling_page, page_size, false, "Unable to commit Safepoint polling page");
     os::protect_memory(polling_page, page_size, os::MEM_PROT_READ);
+    MemTracker::record_virtual_memory_type((address)polling_page, mtSafepoint);
 
     log_info(os)("SafePoint Polling address: " INTPTR_FORMAT, p2i(polling_page));
     os::set_polling_page((address)(polling_page));
--- a/src/hotspot/share/runtime/sharedRuntime.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/runtime/sharedRuntime.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -2863,6 +2863,22 @@
   GCLocker::unlock_critical(thread);
 JRT_END
 
+JRT_LEAF(oopDesc*, SharedRuntime::pin_object(JavaThread* thread, oopDesc* obj))
+  assert(Universe::heap()->supports_object_pinning(), "Why we are here?");
+  assert(obj != NULL, "Should not be null");
+  oop o(obj);
+  o = Universe::heap()->pin_object(thread, o);
+  assert(o != NULL, "Should not be null");
+  return o;
+JRT_END
+
+JRT_LEAF(void, SharedRuntime::unpin_object(JavaThread* thread, oopDesc* obj))
+  assert(Universe::heap()->supports_object_pinning(), "Why we are here?");
+  assert(obj != NULL, "Should not be null");
+  oop o(obj);
+  Universe::heap()->unpin_object(thread, o);
+JRT_END
+
 // -------------------------------------------------------------------------
 // Java-Java calling convention
 // (what you use when Java calls Java)
--- a/src/hotspot/share/runtime/sharedRuntime.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/runtime/sharedRuntime.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -486,6 +486,10 @@
   // Block before entering a JNI critical method
   static void block_for_jni_critical(JavaThread* thread);
 
+  // Pin/Unpin object
+  static oopDesc* pin_object(JavaThread* thread, oopDesc* obj);
+  static void unpin_object(JavaThread* thread, oopDesc* obj);
+
   // A compiled caller has just called the interpreter, but compiled code
   // exists.  Patch the caller so he no longer calls into the interpreter.
   static void fixup_callers_callsite(Method* moop, address ret_pc);
--- a/src/hotspot/share/runtime/synchronizer.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/runtime/synchronizer.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -1906,52 +1906,20 @@
 //------------------------------------------------------------------------------
 // Debugging code
 
-void ObjectSynchronizer::sanity_checks(const bool verbose,
-                                       const uint cache_line_size,
-                                       int *error_cnt_ptr,
-                                       int *warning_cnt_ptr) {
-  u_char *addr_begin      = (u_char*)&GVars;
-  u_char *addr_stwRandom  = (u_char*)&GVars.stwRandom;
-  u_char *addr_hcSequence = (u_char*)&GVars.hcSequence;
+u_char* ObjectSynchronizer::get_gvars_addr() {
+  return (u_char*)&GVars;
+}
 
-  if (verbose) {
-    tty->print_cr("INFO: sizeof(SharedGlobals)=" SIZE_FORMAT,
-                  sizeof(SharedGlobals));
-  }
+u_char* ObjectSynchronizer::get_gvars_hcSequence_addr() {
+  return (u_char*)&GVars.hcSequence;
+}
 
-  uint offset_stwRandom = (uint)(addr_stwRandom - addr_begin);
-  if (verbose) tty->print_cr("INFO: offset(stwRandom)=%u", offset_stwRandom);
+size_t ObjectSynchronizer::get_gvars_size() {
+  return sizeof(SharedGlobals);
+}
 
-  uint offset_hcSequence = (uint)(addr_hcSequence - addr_begin);
-  if (verbose) {
-    tty->print_cr("INFO: offset(_hcSequence)=%u", offset_hcSequence);
-  }
-
-  if (cache_line_size != 0) {
-    // We were able to determine the L1 data cache line size so
-    // do some cache line specific sanity checks
-
-    if (offset_stwRandom < cache_line_size) {
-      tty->print_cr("WARNING: the SharedGlobals.stwRandom field is closer "
-                    "to the struct beginning than a cache line which permits "
-                    "false sharing.");
-      (*warning_cnt_ptr)++;
-    }
-
-    if ((offset_hcSequence - offset_stwRandom) < cache_line_size) {
-      tty->print_cr("WARNING: the SharedGlobals.stwRandom and "
-                    "SharedGlobals.hcSequence fields are closer than a cache "
-                    "line which permits false sharing.");
-      (*warning_cnt_ptr)++;
-    }
-
-    if ((sizeof(SharedGlobals) - offset_hcSequence) < cache_line_size) {
-      tty->print_cr("WARNING: the SharedGlobals.hcSequence field is closer "
-                    "to the struct end than a cache line which permits false "
-                    "sharing.");
-      (*warning_cnt_ptr)++;
-    }
-  }
+u_char* ObjectSynchronizer::get_gvars_stwRandom_addr() {
+  return (u_char*)&GVars.stwRandom;
 }
 
 #ifndef PRODUCT
--- a/src/hotspot/share/runtime/synchronizer.hpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/runtime/synchronizer.hpp	Fri Aug 03 12:52:58 2018 -0700
@@ -153,12 +153,11 @@
   static void thread_local_used_oops_do(Thread* thread, OopClosure* f);
 
   // debugging
-  static void sanity_checks(const bool verbose,
-                            const unsigned int cache_line_size,
-                            int *error_cnt_ptr, int *warning_cnt_ptr);
   static int  verify_objmon_isinpool(ObjectMonitor *addr) PRODUCT_RETURN0;
 
  private:
+  friend class SynchronizerTest;
+
   enum { _BLOCKSIZE = 128 };
   // global list of blocks of monitors
   static PaddedEnd<ObjectMonitor> * volatile gBlockList;
@@ -177,6 +176,11 @@
   // Process oops in monitors on the given list
   static void list_oops_do(ObjectMonitor* list, OopClosure* f);
 
+  // Support for SynchronizerTest access to GVars fields:
+  static u_char* get_gvars_addr();
+  static u_char* get_gvars_hcSequence_addr();
+  static size_t get_gvars_size();
+  static u_char* get_gvars_stwRandom_addr();
 };
 
 // ObjectLocker enforced balanced locking and can never thrown an
--- a/src/hotspot/share/runtime/vmStructs.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/runtime/vmStructs.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -330,9 +330,8 @@
   nonstatic_field(ConstMethod,                 _size_of_parameters,                           u2)                                    \
   nonstatic_field(ObjArrayKlass,               _element_klass,                                Klass*)                                \
   nonstatic_field(ObjArrayKlass,               _bottom_klass,                                 Klass*)                                \
-  volatile_nonstatic_field(Symbol,             _refcount,                                     short)                                 \
+  volatile_nonstatic_field(Symbol,             _length_and_refcount,                          unsigned int)                          \
   nonstatic_field(Symbol,                      _identity_hash,                                short)                                 \
-  nonstatic_field(Symbol,                      _length,                                       unsigned short)                        \
   unchecked_nonstatic_field(Symbol,            _body,                                         sizeof(jbyte)) /* NOTE: no type */     \
   nonstatic_field(Symbol,                      _body[0],                                      jbyte)                                 \
   nonstatic_field(TypeArrayKlass,              _max_length,                                   jint)                                  \
--- a/src/hotspot/share/services/memTracker.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/services/memTracker.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -32,9 +32,14 @@
 #include "services/memReporter.hpp"
 #include "services/mallocTracker.inline.hpp"
 #include "services/memTracker.hpp"
+#include "utilities/debug.hpp"
 #include "utilities/defaultStream.hpp"
 #include "utilities/vmError.hpp"
 
+#ifdef _WINDOWS
+#include <windows.h>
+#endif
+
 #ifdef SOLARIS
   volatile bool NMT_stack_walkable = false;
 #else
@@ -48,24 +53,35 @@
 Mutex*      MemTracker::_query_lock = NULL;
 bool MemTracker::_is_nmt_env_valid = true;
 
+static const size_t buffer_size = 64;
 
 NMT_TrackingLevel MemTracker::init_tracking_level() {
+  // Memory type is encoded into tracking header as a byte field,
+  // make sure that we don't overflow it.
+  STATIC_ASSERT(mt_number_of_types <= max_jubyte);
+
+  char nmt_env_variable[buffer_size];
+  jio_snprintf(nmt_env_variable, sizeof(nmt_env_variable), "NMT_LEVEL_%d", os::current_process_id());
+  const char* nmt_env_value;
+#ifdef _WINDOWS
+  // Read the NMT environment variable from the PEB instead of the CRT
+  char value[buffer_size];
+  nmt_env_value = GetEnvironmentVariable(nmt_env_variable, value, (DWORD)sizeof(value)) != 0 ? value : NULL;
+#else
+  nmt_env_value = ::getenv(nmt_env_variable);
+#endif
   NMT_TrackingLevel level = NMT_off;
-  char buf[64];
-  jio_snprintf(buf, sizeof(buf), "NMT_LEVEL_%d", os::current_process_id());
-  const char *nmt_option = ::getenv(buf);
-  if (nmt_option != NULL) {
-    if (strcmp(nmt_option, "summary") == 0) {
+  if (nmt_env_value != NULL) {
+    if (strcmp(nmt_env_value, "summary") == 0) {
       level = NMT_summary;
-    } else if (strcmp(nmt_option, "detail") == 0) {
+    } else if (strcmp(nmt_env_value, "detail") == 0) {
       level = NMT_detail;
-    } else if (strcmp(nmt_option, "off") != 0) {
-      // The option value is invalid
+    } else if (strcmp(nmt_env_value, "off") != 0) {
+      // The value of the environment variable is invalid
       _is_nmt_env_valid = false;
     }
-
     // Remove the environment variable to avoid leaking to child processes
-    os::unsetenv(buf);
+    os::unsetenv(nmt_env_variable);
   }
 
   if (!MallocTracker::initialize(level) ||
--- a/src/hotspot/share/services/nmtCommon.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/services/nmtCommon.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -44,6 +44,7 @@
   "Logging",
   "Arguments",
   "Module",
+  "Safepoint",
   "Unknown"
 };
 
--- a/src/hotspot/share/utilities/internalVMTests.cpp	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/hotspot/share/utilities/internalVMTests.cpp	Fri Aug 03 12:52:58 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -47,7 +47,6 @@
   run_unit_test(TestVirtualSpace_test);
   run_unit_test(TestMetaspaceUtils_test);
   run_unit_test(GCTimer_test);
-  run_unit_test(ObjectMonitor_test);
   // These tests require the "C" locale to correctly parse decimal values
   const char* orig_locale = setlocale(LC_NUMERIC, NULL);
   setlocale(LC_NUMERIC, "C");
--- a/src/java.base/macosx/native/libjava/java_props_macosx.c	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/java.base/macosx/native/libjava/java_props_macosx.c	Fri Aug 03 12:52:58 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -45,11 +45,22 @@
 }
 
 #define LOCALEIDLENGTH  128
+#ifndef kCFCoreFoundationVersionNumber10_11_Max
+#define kCFCoreFoundationVersionNumber10_11_Max 1299
+#endif
 char *getMacOSXLocale(int cat) {
     const char* retVal = NULL;
     char languageString[LOCALEIDLENGTH];
     char localeString[LOCALEIDLENGTH];
 
+    // Since macOS 10.12, there is no separate language selection for
+    // "format" locale, e.g., date format. Use the preferred language
+    // for all LC_* categories.
+    if (kCFCoreFoundationVersionNumber >
+        kCFCoreFoundationVersionNumber10_11_Max) {
+        cat = LC_MESSAGES;
+    }
+
     switch (cat) {
     case LC_MESSAGES:
         {
--- a/src/java.base/share/classes/com/sun/crypto/provider/CipherCore.java	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/java.base/share/classes/com/sun/crypto/provider/CipherCore.java	Fri Aug 03 12:52:58 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -673,7 +673,12 @@
             if (len == output.length) {
                 return output;
             } else {
-                return Arrays.copyOf(output, len);
+                byte[] copy = Arrays.copyOf(output, len);
+                if (decrypting) {
+                    // Zero out internal buffer which is no longer required
+                    Arrays.fill(output, (byte) 0x00);
+                }
+                return copy;
             }
         } catch (ShortBufferException e) {
             // should never happen
@@ -767,11 +772,14 @@
                         inputLen -= temp;
                         buffered = Math.addExact(buffered, temp);
                     }
-                    // process 'buffer'
+                    // process 'buffer'. When finished we can null out 'buffer'
+                    // Only necessary to null out if buffer holds data for encryption
                     if (decrypting) {
                          outLen = cipher.decrypt(buffer, 0, buffered, output, outputOffset);
                     } else {
                          outLen = cipher.encrypt(buffer, 0, buffered, output, outputOffset);
+                         //encrypt mode. Zero out internal (input) buffer
+                         Arrays.fill(buffer, (byte) 0x00);
                     }
                     outputOffset = Math.addExact(outputOffset, outLen);
                     buffered = 0;
@@ -846,7 +854,12 @@
             output = new byte[getOutputSizeByOperation(inputLen, true)];
             int len = doFinal(input, inputOffset, inputLen, output, 0);
             if (len < output.length) {
-                return Arrays.copyOf(output, len);
+                byte[] copy = Arrays.copyOf(output, len);
+                if (decrypting) {
+                    // Zero out internal (ouput) array
+                    Arrays.fill(output, (byte) 0x00);
+                }
+                return copy;
             } else {
                 return output;
             }
@@ -959,6 +972,11 @@
             finalOffset = 0;
             if (buffered != 0) {
                 System.arraycopy(buffer, 0, finalBuf, 0, buffered);
+                if (!decrypting) {
+                    // done with input buffer. We should zero out the
+                    // data if we're in encrypt mode.
+                    Arrays.fill(buffer, (byte) 0x00);
+                }
             }
             if (inputLen != 0) {
                 System.arraycopy(input, inputOffset, finalBuf,
@@ -1005,6 +1023,8 @@
             }
             // copy the result into user-supplied output buffer
             System.arraycopy(outWithPadding, 0, output, outputOffset, outLen);
+            // decrypt mode. Zero out output data that's not required
+            Arrays.fill(outWithPadding, (byte) 0x00);
         } else { // encrypting
             try {
                 outLen = finalNoPadding(finalBuf, finalOffset, output,
@@ -1012,6 +1032,10 @@
             } finally {
                 // reset after doFinal() for GCM encryption
                 requireReinit = (cipherMode == GCM_MODE);
+                if (finalBuf != input) {
+                    // done with internal finalBuf array. Copied to output
+                    Arrays.fill(finalBuf, (byte) 0x00);
+                }
             }
         }
 
--- a/src/java.base/share/classes/com/sun/crypto/provider/KeyProtector.java	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/java.base/share/classes/com/sun/crypto/provider/KeyProtector.java	Fri Aug 03 12:52:58 2018 -0700
@@ -37,12 +37,15 @@
 import java.security.AlgorithmParameters;
 import java.security.spec.InvalidParameterSpecException;
 import java.security.spec.PKCS8EncodedKeySpec;
+import java.util.Arrays;
 
 import javax.crypto.Cipher;
 import javax.crypto.CipherSpi;
 import javax.crypto.SecretKey;
 import javax.crypto.SealedObject;
 import javax.crypto.spec.*;
+import javax.security.auth.DestroyFailedException;
+
 import sun.security.x509.AlgorithmId;
 import sun.security.util.ObjectIdentifier;
 
@@ -103,15 +106,20 @@
 
         // create PBE key from password
         PBEKeySpec pbeKeySpec = new PBEKeySpec(this.password);
-        SecretKey sKey = new PBEKey(pbeKeySpec, "PBEWithMD5AndTripleDES");
-        pbeKeySpec.clearPassword();
-
-        // encrypt private key
+        SecretKey sKey = null;
         PBEWithMD5AndTripleDESCipher cipher;
-        cipher = new PBEWithMD5AndTripleDESCipher();
-        cipher.engineInit(Cipher.ENCRYPT_MODE, sKey, pbeSpec, null);
+        try {
+            sKey = new PBEKey(pbeKeySpec, "PBEWithMD5AndTripleDES", false);
+            // encrypt private key
+            cipher = new PBEWithMD5AndTripleDESCipher();
+            cipher.engineInit(Cipher.ENCRYPT_MODE, sKey, pbeSpec, null);
+        } finally {
+            pbeKeySpec.clearPassword();
+            if (sKey != null) sKey.destroy();
+        }
         byte[] plain = key.getEncoded();
         byte[] encrKey = cipher.engineDoFinal(plain, 0, plain.length);
+        Arrays.fill(plain, (byte) 0x00);
 
         // wrap encrypted private key in EncryptedPrivateKeyInfo
         // (as defined in PKCS#8)
@@ -131,8 +139,8 @@
     Key recover(EncryptedPrivateKeyInfo encrInfo)
         throws UnrecoverableKeyException, NoSuchAlgorithmException
     {
-        byte[] plain;
-
+        byte[] plain = null;
+        SecretKey sKey = null;
         try {
             String encrAlg = encrInfo.getAlgorithm().getOID().toString();
             if (!encrAlg.equals(PBE_WITH_MD5_AND_DES3_CBC_OID)
@@ -160,8 +168,7 @@
 
                 // create PBE key from password
                 PBEKeySpec pbeKeySpec = new PBEKeySpec(this.password);
-                SecretKey sKey =
-                    new PBEKey(pbeKeySpec, "PBEWithMD5AndTripleDES");
+                sKey = new PBEKey(pbeKeySpec, "PBEWithMD5AndTripleDES", false);
                 pbeKeySpec.clearPassword();
 
                 // decrypt private key
@@ -178,7 +185,6 @@
                 (new PrivateKeyInfo(plain).getAlgorithm().getOID()).getName();
             KeyFactory kFac = KeyFactory.getInstance(oidName);
             return kFac.generatePrivate(new PKCS8EncodedKeySpec(plain));
-
         } catch (NoSuchAlgorithmException ex) {
             // Note: this catch needed to be here because of the
             // later catch of GeneralSecurityException
@@ -187,6 +193,15 @@
             throw new UnrecoverableKeyException(ioe.getMessage());
         } catch (GeneralSecurityException gse) {
             throw new UnrecoverableKeyException(gse.getMessage());
+        } finally {
+            if (plain != null) Arrays.fill(plain, (byte) 0x00);
+            if (sKey != null) {
+                try {
+                    sKey.destroy();
+                } catch (DestroyFailedException e) {
+                    //shouldn't happen
+                }
+            }
         }
     }
 
@@ -262,7 +277,7 @@
         // of <code>protectedKey</code>. If the two digest values are
         // different, throw an exception.
         md.update(passwdBytes);
-        java.util.Arrays.fill(passwdBytes, (byte)0x00);
+        Arrays.fill(passwdBytes, (byte)0x00);
         passwdBytes = null;
         md.update(plainKey);
         digest = md.digest();
@@ -291,17 +306,21 @@
 
         // create PBE key from password
         PBEKeySpec pbeKeySpec = new PBEKeySpec(this.password);
-        SecretKey sKey = new PBEKey(pbeKeySpec, "PBEWithMD5AndTripleDES");
+        SecretKey sKey = null;
+        Cipher cipher;
+        try {
+            sKey = new PBEKey(pbeKeySpec, "PBEWithMD5AndTripleDES", false);
         pbeKeySpec.clearPassword();
 
         // seal key
-        Cipher cipher;
-
         PBEWithMD5AndTripleDESCipher cipherSpi;
         cipherSpi = new PBEWithMD5AndTripleDESCipher();
         cipher = new CipherForKeyProtector(cipherSpi, SunJCE.getInstance(),
                                            "PBEWithMD5AndTripleDES");
         cipher.init(Cipher.ENCRYPT_MODE, sKey, pbeSpec);
+        } finally {
+            if (sKey != null) sKey.destroy();
+        }
         return new SealedObjectForKeyProtector(key, cipher);
     }
 
@@ -309,12 +328,13 @@
      * Unseals the sealed key.
      */
     Key unseal(SealedObject so)
-        throws NoSuchAlgorithmException, UnrecoverableKeyException
-    {
+        throws NoSuchAlgorithmException, UnrecoverableKeyException {
+        SecretKey sKey = null;
         try {
             // create PBE key from password
             PBEKeySpec pbeKeySpec = new PBEKeySpec(this.password);
-            SecretKey skey = new PBEKey(pbeKeySpec, "PBEWithMD5AndTripleDES");
+            sKey = new PBEKey(pbeKeySpec,
+                    "PBEWithMD5AndTripleDES", false);
             pbeKeySpec.clearPassword();
 
             SealedObjectForKeyProtector soForKeyProtector = null;
@@ -342,7 +362,7 @@
             Cipher cipher = new CipherForKeyProtector(cipherSpi,
                                                       SunJCE.getInstance(),
                                                       "PBEWithMD5AndTripleDES");
-            cipher.init(Cipher.DECRYPT_MODE, skey, params);
+            cipher.init(Cipher.DECRYPT_MODE, sKey, params);
             return soForKeyProtector.getKey(cipher);
         } catch (NoSuchAlgorithmException ex) {
             // Note: this catch needed to be here because of the
@@ -354,6 +374,14 @@
             throw new UnrecoverableKeyException(cnfe.getMessage());
         } catch (GeneralSecurityException gse) {
             throw new UnrecoverableKeyException(gse.getMessage());
+        } finally {
+            if (sKey != null) {
+                try {
+                    sKey.destroy();
+                } catch (DestroyFailedException e) {
+                    //shouldn't happen
+                }
+            }
         }
     }
 }
--- a/src/java.base/share/classes/com/sun/crypto/provider/PBEKey.java	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/java.base/share/classes/com/sun/crypto/provider/PBEKey.java	Fri Aug 03 12:52:58 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
 import java.security.MessageDigest;
 import java.security.KeyRep;
 import java.security.spec.InvalidKeySpecException;
+import java.util.Arrays;
 import java.util.Locale;
 import javax.crypto.SecretKey;
 import javax.crypto.spec.PBEKeySpec;
@@ -54,7 +55,8 @@
      *
      * @param keytype the given PBE key specification
      */
-    PBEKey(PBEKeySpec keySpec, String keytype) throws InvalidKeySpecException {
+    PBEKey(PBEKeySpec keySpec, String keytype, boolean useCleaner)
+            throws InvalidKeySpecException {
         char[] passwd = keySpec.getPassword();
         if (passwd == null) {
             // Should allow an empty password.
@@ -71,13 +73,15 @@
         this.key = new byte[passwd.length];
         for (int i=0; i<passwd.length; i++)
             this.key[i] = (byte) (passwd[i] & 0x7f);
-        java.util.Arrays.fill(passwd, ' ');
+        Arrays.fill(passwd, ' ');
         type = keytype;
 
         // Use the cleaner to zero the key when no longer referenced
-        final byte[] k = this.key;
-        CleanerFactory.cleaner().register(this,
-                () -> java.util.Arrays.fill(k, (byte)0x00));
+        if (useCleaner) {
+            final byte[] k = this.key;
+            CleanerFactory.cleaner().register(this,
+                () -> Arrays.fill(k, (byte) 0x00));
+        }
     }
 
     public byte[] getEncoded() {
@@ -122,11 +126,23 @@
 
         byte[] thatEncoded = that.getEncoded();
         boolean ret = MessageDigest.isEqual(this.key, thatEncoded);
-        java.util.Arrays.fill(thatEncoded, (byte)0x00);
+        Arrays.fill(thatEncoded, (byte)0x00);
         return ret;
     }
 
     /**
+     * Clears the internal copy of the key.
+     *
+     */
+    @Override
+    public void destroy() {
+        if (key != null) {
+            Arrays.fill(key, (byte) 0x00);
+            key = null;
+        }
+    }
+
+    /**
      * readObject is called to restore the state of this key from
      * a stream.
      */
--- a/src/java.base/share/classes/com/sun/crypto/provider/PBEKeyFactory.java	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/java.base/share/classes/com/sun/crypto/provider/PBEKeyFactory.java	Fri Aug 03 12:52:58 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -216,7 +216,7 @@
         if (!(keySpec instanceof PBEKeySpec)) {
             throw new InvalidKeySpecException("Invalid key spec");
         }
-        return new PBEKey((PBEKeySpec)keySpec, type);
+        return new PBEKey((PBEKeySpec)keySpec, type, true);
     }
 
     /**
--- a/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java	Fri Aug 03 12:52:58 2018 -0700
@@ -332,7 +332,7 @@
         if ((inLen == 0) || (in == null)) {
             return;
         }
-        if (bufOfs + inLen > buffer.length) {
+        if (inLen > (buffer.length - bufOfs)) {
             bufOfs = buffer.length + 1;
             return;
         }
--- a/src/java.base/share/classes/com/sun/java/util/jar/pack/DriverResource_ja.java	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/java.base/share/classes/com/sun/java/util/jar/pack/DriverResource_ja.java	Fri Aug 03 12:52:58 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -42,6 +42,7 @@
     public static final String MORE_INFO = "MORE_INFO";
     public static final String DUPLICATE_OPTION = "DUPLICATE_OPTION";
     public static final String BAD_SPEC = "BAD_SPEC";
+    public static final String DEPRECATED = "DEPRECATED";
 
     /*
      * The following are the output of 'pack200' and 'unpack200' commands.
@@ -89,7 +90,7 @@
                 "  -q\u3001--quiet                     \u5197\u9577\u6027\u3092\u6700\u4F4E\u30EC\u30D9\u30EB\u306B\u8A2D\u5B9A\u3057\u307E\u3059",
                 "  -l{F}\u3001--log-file={F}           \u6307\u5B9A\u306E\u30ED\u30B0\u30FB\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306FSystem.out ",
                 "                                  ('-'\u306E\u5834\u5408)\u306B\u51FA\u529B\u3057\u307E\u3059",
-                "  -?\u3001-h\u3001--help                  \u3053\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3057\u307E\u3059",
+                "  -?\u3001-h\u3001--help                  \u3053\u306E\u30D8\u30EB\u30D7\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3057\u307E\u3059",
                 "  -V\u3001--version                   \u30D7\u30ED\u30B0\u30E9\u30E0\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3057\u307E\u3059",
                 "  -J{X}                           \u30AA\u30D7\u30B7\u30E7\u30F3X\u3092\u57FA\u790E\u3068\u306A\u308BJava VM\u306B\u6E21\u3057\u307E\u3059",
                 "",
@@ -118,7 +119,7 @@
                 "  -q\u3001--quiet                   \u5197\u9577\u6027\u3092\u6700\u4F4E\u30EC\u30D9\u30EB\u306B\u8A2D\u5B9A\u3057\u307E\u3059",
                 "  -l{F}\u3001--log-file={F}           \u6307\u5B9A\u306E\u30ED\u30B0\u30FB\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F",
                 "                                  System.out ('-'\u306E\u5834\u5408)\u306B\u51FA\u529B\u3057\u307E\u3059",
-                "  -?\u3001-h\u3001--help                \u3053\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3057\u307E\u3059",
+                "  -?\u3001-h\u3001--help                \u3053\u306E\u30D8\u30EB\u30D7\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3057\u307E\u3059",
                 "  -V\u3001--version                 \u30D7\u30ED\u30B0\u30E9\u30E0\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3057\u307E\u3059",
                 "  -J{X}                         \u30AA\u30D7\u30B7\u30E7\u30F3X\u3092\u57FA\u790E\u3068\u306A\u308BJava VM\u306B\u6E21\u3057\u307E\u3059"
             }
@@ -126,6 +127,7 @@
         {MORE_INFO, "(\u8A73\u7D30\u306F\u3001{0} --help\u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002)"}, // parameter 0:command name
         {DUPLICATE_OPTION, "\u91CD\u8907\u30AA\u30D7\u30B7\u30E7\u30F3: {0}"}, // parameter 0:option
         {BAD_SPEC, "{0}\u306E\u7121\u52B9\u306A\u4ED5\u69D8: {1}"}, // parameter 0:option;parameter 1:specifier
+        {DEPRECATED, "\n\u8B66\u544A: {0}\u30C4\u30FC\u30EB\u306F\u975E\u63A8\u5968\u3067\u3042\u308A\u3001\u4ECA\u5F8C\u306EJDK\u30EA\u30EA\u30FC\u30B9\u3067\u524A\u9664\u3055\u308C\u308B\u4E88\u5B9A\u3067\u3059\u3002\n"} // parameter 0:command name
     };
 
     protected Object[][] getContents() {
--- a/src/java.base/share/classes/com/sun/java/util/jar/pack/DriverResource_zh_CN.java	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/java.base/share/classes/com/sun/java/util/jar/pack/DriverResource_zh_CN.java	Fri Aug 03 12:52:58 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -42,6 +42,7 @@
     public static final String MORE_INFO = "MORE_INFO";
     public static final String DUPLICATE_OPTION = "DUPLICATE_OPTION";
     public static final String BAD_SPEC = "BAD_SPEC";
+    public static final String DEPRECATED = "DEPRECATED";
 
     /*
      * The following are the output of 'pack200' and 'unpack200' commands.
@@ -89,7 +90,7 @@
                 "  -q, --quiet                     \u5C06\u8BE6\u7EC6\u7A0B\u5EA6\u8BBE\u7F6E\u4E3A\u6700\u4F4E\u7EA7\u522B",
                 "  -l{F}, --log-file={F}           \u8F93\u51FA\u5230\u7ED9\u5B9A\u65E5\u5FD7\u6587\u4EF6, ",
                 "                                  \u6216\u5BF9\u4E8E System.out \u6307\u5B9A '-'",
-                "  -?, -h, --help                  \u8F93\u51FA\u6B64\u6D88\u606F",
+                "  -?, -h, --help                  \u8F93\u51FA\u6B64\u5E2E\u52A9\u6D88\u606F",
                 "  -V, --version                   \u8F93\u51FA\u7A0B\u5E8F\u7248\u672C",
                 "  -J{X}                           \u5C06\u9009\u9879 X \u4F20\u9012\u7ED9\u57FA\u7840 Java VM",
                 "",
@@ -118,7 +119,7 @@
                 "  -q, --quiet                     \u5C06\u8BE6\u7EC6\u7A0B\u5EA6\u8BBE\u7F6E\u4E3A\u6700\u4F4E\u7EA7\u522B",
                 "  -l{F}, --log-file={F}         \u8F93\u51FA\u5230\u7ED9\u5B9A\u65E5\u5FD7\u6587\u4EF6, \u6216",
                 "                                \u5BF9\u4E8E System.out \u6307\u5B9A '-'",
-                "  -?, -h, --help                \u8F93\u51FA\u6B64\u6D88\u606F",
+                "  -?, -h, --help                \u8F93\u51FA\u6B64\u5E2E\u52A9\u6D88\u606F",
                 "  -V, --version                 \u8F93\u51FA\u7A0B\u5E8F\u7248\u672C",
                 "  -J{X}                         \u5C06\u9009\u9879 X \u4F20\u9012\u7ED9\u57FA\u7840 Java VM"
             }
@@ -126,6 +127,7 @@
         {MORE_INFO, "(\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u8FD0\u884C {0} --help\u3002)"}, // parameter 0:command name
         {DUPLICATE_OPTION, "\u91CD\u590D\u7684\u9009\u9879: {0}"}, // parameter 0:option
         {BAD_SPEC, "{0}\u7684\u89C4\u8303\u9519\u8BEF: {1}"}, // parameter 0:option;parameter 1:specifier
+        {DEPRECATED, "\n\u8B66\u544A\uFF1A{0} \u5DE5\u5177\u5DF2\u8FC7\u65F6\uFF0C\u8BA1\u5212\u5728\u672A\u6765\u7684 JDK \u53D1\u884C\u7248\u4E2D\u5220\u9664\u3002\n"} // parameter 0:command name
     };
 
     protected Object[][] getContents() {
--- a/src/java.base/share/classes/java/lang/String.java	Wed Aug 01 11:02:19 2018 +0530
+++ b/src/java.base/s